@aborruso/ckan-mcp-server 0.4.68 → 0.4.69
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LOG.md +4 -0
- package/dist/index.js +8 -6
- package/dist/worker.js +70 -69
- package/package.json +1 -1
package/LOG.md
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
# LOG
|
|
2
2
|
|
|
3
|
+
## 2026-03-04 (v0.4.69)
|
|
4
|
+
|
|
5
|
+
- feat: `ckan_package_search` and `ckan_package_show` JSON output now include `view_url` field pointing to the dataset page on the source portal
|
|
6
|
+
|
|
3
7
|
## 2026-03-04 (v0.4.68)
|
|
4
8
|
|
|
5
9
|
- feat: SPARQL endpoint config in `portals.json` — `sparql.endpoint_url` + `sparql.method` per portal (Italy: `lod.dati.gov.it/sparql`, GET-only)
|
package/dist/index.js
CHANGED
|
@@ -872,7 +872,7 @@ function resolvePageParams(page, pageSize, start, rows) {
|
|
|
872
872
|
}
|
|
873
873
|
return { effectiveStart: start, effectiveRows: rows };
|
|
874
874
|
}
|
|
875
|
-
function compactSearchResult(result) {
|
|
875
|
+
function compactSearchResult(result, serverUrl) {
|
|
876
876
|
return {
|
|
877
877
|
count: result.count,
|
|
878
878
|
results: (result.results || []).map((pkg) => ({
|
|
@@ -883,13 +883,14 @@ function compactSearchResult(result) {
|
|
|
883
883
|
organization: pkg.organization?.title || pkg.organization?.name || null,
|
|
884
884
|
tags: (pkg.tags || []).map((t) => t.name),
|
|
885
885
|
num_resources: pkg.num_resources ?? 0,
|
|
886
|
-
metadata_modified: pkg.metadata_modified
|
|
886
|
+
metadata_modified: pkg.metadata_modified,
|
|
887
|
+
...serverUrl ? { view_url: getDatasetViewUrl(serverUrl, pkg) } : {}
|
|
887
888
|
})),
|
|
888
889
|
...result.facets && Object.keys(result.facets).length > 0 ? { facets: result.facets } : {},
|
|
889
890
|
...result.search_facets && Object.keys(result.search_facets).length > 0 ? { search_facets: result.search_facets } : {}
|
|
890
891
|
};
|
|
891
892
|
}
|
|
892
|
-
function compactPackageShow(result) {
|
|
893
|
+
function compactPackageShow(result, serverUrl) {
|
|
893
894
|
return {
|
|
894
895
|
id: result.id,
|
|
895
896
|
name: result.name,
|
|
@@ -917,7 +918,8 @@ function compactPackageShow(result) {
|
|
|
917
918
|
datastore_active: r.datastore_active ?? null,
|
|
918
919
|
created: r.created || null,
|
|
919
920
|
last_modified: r.last_modified || null
|
|
920
|
-
}))
|
|
921
|
+
})),
|
|
922
|
+
...serverUrl ? { view_url: getDatasetViewUrl(serverUrl, result) } : {}
|
|
921
923
|
};
|
|
922
924
|
}
|
|
923
925
|
function registerPackageTools(server2) {
|
|
@@ -1111,7 +1113,7 @@ Typical workflow: ckan_package_search \u2192 ckan_package_show (get full metadat
|
|
|
1111
1113
|
}
|
|
1112
1114
|
}
|
|
1113
1115
|
if (params.response_format === "json" /* JSON */) {
|
|
1114
|
-
const compact = compactSearchResult(result);
|
|
1116
|
+
const compact = compactSearchResult(result, params.server_url);
|
|
1115
1117
|
return {
|
|
1116
1118
|
content: [{ type: "text", text: truncateJson(compact) }]
|
|
1117
1119
|
};
|
|
@@ -1496,7 +1498,7 @@ Typical workflow: ckan_package_show \u2192 pick a resource with datastore_active
|
|
|
1496
1498
|
}
|
|
1497
1499
|
);
|
|
1498
1500
|
if (params.response_format === "json" /* JSON */) {
|
|
1499
|
-
const compact = compactPackageShow(enrichPackageShowResult(result));
|
|
1501
|
+
const compact = compactPackageShow(enrichPackageShowResult(result), params.server_url);
|
|
1500
1502
|
return {
|
|
1501
1503
|
content: [{ type: "text", text: truncateJson(compact) }],
|
|
1502
1504
|
structuredContent: compact
|