Skip to content

Commit e5c4d70

Browse files
aborrusoclaude
andcommitted
feat: source portal DataStore fallback + LLM error hints (v0.4.104)
- ckan_list_resources probes source portal for harvested datasets (datastore_active=false + CKAN URL pattern) - Add source_datastore_active, source_portal_url fields; check_source_portal param (default true) - Add CkanApiError class and formatCkanError() with actionable LLM hints per HTTP status/action - Replace raw error.message in all tool catch blocks with formatCkanError() - Archive completed OpenSpec changes; 12+9 new tests (399 total) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 53ebc1f commit e5c4d70

41 files changed

Lines changed: 881 additions & 117 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

LOG.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,19 @@
11
# LOG
22

3+
## 2026-05-20
4+
5+
### v0.4.104
6+
7+
- Source portal DataStore fallback + LLM error hints (see 2026-05-18 entries below)
8+
9+
## 2026-05-18
10+
11+
- Source portal DataStore fallback: `ckan_list_resources` now probes the source portal when a resource has `datastore_active=false` and its download URL belongs to a different CKAN instance (harvested dataset pattern). Adds `source_datastore_active` and `source_portal_url` fields to output. New `check_source_portal` parameter (default `true`) to skip extra HTTP calls. New `extractSourcePortal()` utility in `url-generator.ts`. Scoped to CKAN-to-CKAN harvesting (detects `/resource/{uuid}/` URL pattern). 12 new tests → 399 total.
12+
- LLM error hints: add `CkanApiError` class to `makeCkanRequest` (carries `status` + `action`); add `formatCkanError()` with hint table mapping HTTP status/action → actionable suggestion for the LLM (404 datastore → `ckan_package_show`, 404 package → `ckan_package_search`, 400 SQL → check columns, 503 → retry, etc.)
13+
- Replace raw `error.message` interpolation in all tool catch blocks (datastore, package, organization, group, analyze, portal-discovery, quality) with `formatCkanError()`
14+
- Replace fragile string-match in `organization.ts` (`includes('CKAN API error (500)')`) with `error instanceof CkanApiError && error.status === 500`
15+
- Tests: 9 new unit tests for `CkanApiError` and `formatCkanError` → 387 total (381 pass, 6 skipped)
16+
317
## 2026-04-22
418

519
- Security: add optional domain allowlist (`CKAN_ALLOWED_DOMAINS` env var) in `validateServerUrl()`; blocks requests to unlisted public domains — CERT-AgID MCP recommendation

manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"dxt_version": "0.1",
33
"name": "ckan-mcp-server",
4-
"version": "0.4.103",
4+
"version": "0.4.104",
55
"display_name": "CKAN MCP Server",
66
"description": "Explore open data portals based on CKAN (dati.gov.it, data.gov, open.canada.ca, ...)",
77
"long_description": "MCP server for interacting with CKAN-based open data portals. Provides tools for advanced dataset search with Solr syntax, DataStore queries for tabular data analysis, organization and group exploration, and complete metadata access.",

openspec/changes/add-source-portal-datastore-fallback/tasks.md

Lines changed: 0 additions & 10 deletions
This file was deleted.

openspec/changes/add-contributing-guide/proposal.md renamed to openspec/changes/archive/2026-05-18-add-contributing-guide/proposal.md

File renamed without changes.

openspec/changes/add-contributing-guide/specs/contributor-guide/spec.md renamed to openspec/changes/archive/2026-05-18-add-contributing-guide/specs/contributor-guide/spec.md

File renamed without changes.

openspec/changes/add-contributing-guide/tasks.md renamed to openspec/changes/archive/2026-05-18-add-contributing-guide/tasks.md

File renamed without changes.

openspec/changes/add-dxt-packaging/design.md renamed to openspec/changes/archive/2026-05-18-add-dxt-packaging/design.md

File renamed without changes.

openspec/changes/add-dxt-packaging/proposal.md renamed to openspec/changes/archive/2026-05-18-add-dxt-packaging/proposal.md

File renamed without changes.

openspec/changes/add-dxt-packaging/specs/dxt-packaging/spec.md renamed to openspec/changes/archive/2026-05-18-add-dxt-packaging/specs/dxt-packaging/spec.md

File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)