@cyanheads/eurostat-mcp-server 0.2.0 → 0.4.0
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/CLAUDE.md +1 -1
- package/Dockerfile +16 -3
- package/README.md +29 -6
- package/dist/index.js +23 -2
- package/dist/index.js.map +1 -1
- package/dist/mcp-server/resources/definitions/eurostat-dataset.resource.d.ts +3 -3
- package/dist/mcp-server/resources/definitions/eurostat-dataset.resource.d.ts.map +1 -1
- package/dist/mcp-server/resources/definitions/eurostat-dataset.resource.js +4 -2
- package/dist/mcp-server/resources/definitions/eurostat-dataset.resource.js.map +1 -1
- package/dist/mcp-server/tools/definitions/eurostat-browse-themes.tool.d.ts +1 -0
- package/dist/mcp-server/tools/definitions/eurostat-browse-themes.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/eurostat-browse-themes.tool.js +9 -0
- package/dist/mcp-server/tools/definitions/eurostat-browse-themes.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/eurostat-dataframe-describe.tool.d.ts +40 -0
- package/dist/mcp-server/tools/definitions/eurostat-dataframe-describe.tool.d.ts.map +1 -0
- package/dist/mcp-server/tools/definitions/eurostat-dataframe-describe.tool.js +113 -0
- package/dist/mcp-server/tools/definitions/eurostat-dataframe-describe.tool.js.map +1 -0
- package/dist/mcp-server/tools/definitions/eurostat-dataframe-query.tool.d.ts +34 -0
- package/dist/mcp-server/tools/definitions/eurostat-dataframe-query.tool.d.ts.map +1 -0
- package/dist/mcp-server/tools/definitions/eurostat-dataframe-query.tool.js +98 -0
- package/dist/mcp-server/tools/definitions/eurostat-dataframe-query.tool.js.map +1 -0
- package/dist/mcp-server/tools/definitions/eurostat-get-dataset-info.tool.d.ts +3 -3
- package/dist/mcp-server/tools/definitions/eurostat-get-dataset-info.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/eurostat-get-dataset-info.tool.js +16 -8
- package/dist/mcp-server/tools/definitions/eurostat-get-dataset-info.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/eurostat-query-dataset.tool.d.ts +9 -0
- package/dist/mcp-server/tools/definitions/eurostat-query-dataset.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/eurostat-query-dataset.tool.js +82 -21
- package/dist/mcp-server/tools/definitions/eurostat-query-dataset.tool.js.map +1 -1
- package/dist/services/canvas-accessor.d.ts +26 -0
- package/dist/services/canvas-accessor.d.ts.map +1 -0
- package/dist/services/canvas-accessor.js +57 -0
- package/dist/services/canvas-accessor.js.map +1 -0
- package/dist/services/eurostat-catalogue/eurostat-catalogue-service.d.ts +20 -1
- package/dist/services/eurostat-catalogue/eurostat-catalogue-service.d.ts.map +1 -1
- package/dist/services/eurostat-catalogue/eurostat-catalogue-service.js +35 -3
- package/dist/services/eurostat-catalogue/eurostat-catalogue-service.js.map +1 -1
- package/dist/services/eurostat-data/eurostat-data-service.d.ts +78 -6
- package/dist/services/eurostat-data/eurostat-data-service.d.ts.map +1 -1
- package/dist/services/eurostat-data/eurostat-data-service.js +185 -27
- package/dist/services/eurostat-data/eurostat-data-service.js.map +1 -1
- package/dist/services/eurostat-data/types.d.ts +61 -4
- package/dist/services/eurostat-data/types.d.ts.map +1 -1
- package/dist/services/eurostat-data/types.js +11 -0
- package/dist/services/eurostat-data/types.js.map +1 -1
- package/package.json +2 -1
- package/server.json +58 -4
package/CLAUDE.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# Agent Protocol
|
|
2
2
|
|
|
3
3
|
**Server:** @cyanheads/eurostat-mcp-server
|
|
4
|
-
**Version:** 0.
|
|
4
|
+
**Version:** 0.4.0
|
|
5
5
|
**Framework:** [@cyanheads/mcp-ts-core](https://www.npmjs.com/package/@cyanheads/mcp-ts-core) `^0.11.1`
|
|
6
6
|
**Engines:** Bun ≥1.3.0, Node ≥24.0.0
|
|
7
7
|
**Zod:** `^4.4.3`
|
package/Dockerfile
CHANGED
|
@@ -47,7 +47,10 @@ LABEL org.opencontainers.image.source="https://github.com/cyanheads/eurostat-mcp
|
|
|
47
47
|
COPY package.json bun.lock ./
|
|
48
48
|
|
|
49
49
|
# Install only production dependencies, ignoring any lifecycle scripts (like 'prepare')
|
|
50
|
-
# that are not needed in the final production image.
|
|
50
|
+
# that are not needed in the final production image. This installs every direct
|
|
51
|
+
# runtime dependency, including the @duckdb/node-api binding that backs DataCanvas —
|
|
52
|
+
# the canvas is gated at runtime by CANVAS_PROVIDER_TYPE, not at build time, so the
|
|
53
|
+
# image always carries the binding and a deployment turns the feature on with an env var.
|
|
51
54
|
RUN --mount=type=cache,target=/root/.bun/install/cache \
|
|
52
55
|
bun install --production --frozen-lockfile --ignore-scripts
|
|
53
56
|
|
|
@@ -75,8 +78,16 @@ COPY --from=build /usr/src/app/dist ./dist
|
|
|
75
78
|
# The 'oven/bun' image already provides a non-root user named 'bun'.
|
|
76
79
|
# We will use this existing user for enhanced security.
|
|
77
80
|
|
|
78
|
-
# Create and set permissions for the log
|
|
79
|
-
|
|
81
|
+
# Create and set permissions for the log and canvas directories, assigning ownership
|
|
82
|
+
# to the 'bun' user. DuckDB writes spill files under CANVAS_TEMP_PATH and the framework
|
|
83
|
+
# sandboxes path exports to CANVAS_EXPORT_PATH. The export root is the one that breaks
|
|
84
|
+
# by default: it resolves under the working directory /usr/src/app, which this non-root
|
|
85
|
+
# user does not own. Both are pointed at owned directories below so neither depends on
|
|
86
|
+
# the image's writable-by-accident paths.
|
|
87
|
+
RUN mkdir -p /var/log/eurostat-mcp-server \
|
|
88
|
+
/var/lib/eurostat-mcp-server/canvas-tmp \
|
|
89
|
+
/var/lib/eurostat-mcp-server/canvas-exports \
|
|
90
|
+
&& chown -R bun:bun /var/log/eurostat-mcp-server /var/lib/eurostat-mcp-server
|
|
80
91
|
|
|
81
92
|
# Switch to the non-root user
|
|
82
93
|
USER bun
|
|
@@ -94,6 +105,8 @@ ENV MCP_SESSION_MODE="stateless"
|
|
|
94
105
|
ENV MCP_LOG_LEVEL="info"
|
|
95
106
|
ENV LOGS_DIR="/var/log/eurostat-mcp-server"
|
|
96
107
|
ENV MCP_FORCE_CONSOLE_LOGGING="true"
|
|
108
|
+
ENV CANVAS_TEMP_PATH="/var/lib/eurostat-mcp-server/canvas-tmp"
|
|
109
|
+
ENV CANVAS_EXPORT_PATH="/var/lib/eurostat-mcp-server/canvas-exports"
|
|
97
110
|
|
|
98
111
|
# Expose the port the server listens on
|
|
99
112
|
EXPOSE ${MCP_HTTP_PORT}
|
package/README.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<div align="center">
|
|
2
2
|
<h1>@cyanheads/eurostat-mcp-server</h1>
|
|
3
3
|
<p><b>Search and query the Eurostat catalogue — EU economy, demography, trade, health, and NUTS regional data via MCP. STDIO or Streamable HTTP.</b>
|
|
4
|
-
<div>5 Tools • 1 Resource</div>
|
|
4
|
+
<div>5 Tools (7 with the dataframe canvas) • 1 Resource</div>
|
|
5
5
|
</p>
|
|
6
6
|
</div>
|
|
7
7
|
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
|
|
12
|
-
[](./CHANGELOG.md) [](./LICENSE) [](https://github.com/users/cyanheads/packages/container/package/eurostat-mcp-server) [](https://modelcontextprotocol.io/) [](https://www.npmjs.com/package/@cyanheads/eurostat-mcp-server) [](https://www.typescriptlang.org/) [](https://bun.sh/)
|
|
13
13
|
|
|
14
14
|
</div>
|
|
15
15
|
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
|
|
32
32
|
## Tools
|
|
33
33
|
|
|
34
|
-
5 tools for discovering and querying Eurostat statistical datasets:
|
|
34
|
+
5 tools for discovering and querying Eurostat statistical datasets, plus 2 more when the optional dataframe canvas is enabled:
|
|
35
35
|
|
|
36
36
|
| Tool | Description |
|
|
37
37
|
|:---|:---|
|
|
@@ -40,6 +40,8 @@
|
|
|
40
40
|
| `eurostat_get_dataset_info` | Fetch metadata for a dataset: dimensions with sample values, time range, observation count, and last-update date |
|
|
41
41
|
| `eurostat_get_dimension_values` | List all valid codes for a specific dimension (e.g., all geo codes, all unit codes); supports NUTS hierarchy filtering |
|
|
42
42
|
| `eurostat_query_dataset` | Fetch decoded statistical observations with dimension filters, NUTS geo-level, and time-range controls |
|
|
43
|
+
| `eurostat_dataframe_describe` | List the tables staged on a dataframe canvas with their row counts and column types — canvas only |
|
|
44
|
+
| `eurostat_dataframe_query` | Run a read-only SQL SELECT across staged tables — canvas only |
|
|
43
45
|
|
|
44
46
|
### `eurostat_search_datasets`
|
|
45
47
|
|
|
@@ -63,6 +65,7 @@ Navigate the Eurostat theme tree.
|
|
|
63
65
|
- With `theme_code`: returns immediate children — subtheme folders and datasets in that branch
|
|
64
66
|
- Each entry includes code, label, type (folder/dataset/table), data period, and observation count where available
|
|
65
67
|
- Returns a breadcrumb path from root to the current node, plus a `nextStep` hint suited to the level (drill into folders or inspect a dataset)
|
|
68
|
+
- One branch per folder code — Eurostat files a few folder codes under several branches; a code resolves to the first one the catalogue lists, which never has fewer children than the branches it shadows, and `otherPlacements` names those so the ambiguity is visible
|
|
66
69
|
- Use for structured discovery when you know the domain but not the exact dataset code
|
|
67
70
|
|
|
68
71
|
---
|
|
@@ -73,7 +76,7 @@ Fetch metadata for a Eurostat dataset before querying it.
|
|
|
73
76
|
|
|
74
77
|
- Returns all dimensions with their codes, labels, and up to 10 sample values each
|
|
75
78
|
- Reports overall time range and total observation count across all periods, each omitted when Eurostat does not report it
|
|
76
|
-
- Uses a minimal Statistics API call (most recent period only), plus one bounded follow-up to count the dataset's periods when it has a `time` dimension
|
|
79
|
+
- Uses a minimal Statistics API call (most recent period only), plus one bounded follow-up to count the dataset's periods when it has a `time` dimension. If that follow-up fails, the call still returns everything the first request produced, with the `time` dimension's value count omitted rather than reported as 1
|
|
77
80
|
- For dimensions with more than 10 values, use `eurostat_get_dimension_values` for the full list
|
|
78
81
|
- Provides a link to the ESMS metadata page when available
|
|
79
82
|
|
|
@@ -98,8 +101,22 @@ Fetch statistical data from a Eurostat dataset.
|
|
|
98
101
|
- Time range via `since_period`/`until_period` (e.g., `"2020"`, `"2023-Q1"`) or `last_n_periods` for the N most recent
|
|
99
102
|
- Returns decoded observations with dimension codes and labels, numeric values, and status flags (`p` = provisional, `e` = estimated, etc.)
|
|
100
103
|
- Reports total observation count, missing value count, and the effective time range of the result, each period bound omitted when neither the observations nor Eurostat report it
|
|
104
|
+
- Inline rows are capped at 5,000, applied while decoding so a broad query never builds the rest; `obsCount`, `missingObsCount` and `timeRange` still describe the whole match, and `truncated` flags when the cap bit. Filter the query to shrink what Eurostat sends — the cap bounds the decode, not the transfer
|
|
105
|
+
- With the dataframe canvas enabled, a match past the cap is also staged whole as a SQL table and the response returns `canvasId` / `tableName` / `stagedRowCount`; the rows are streamed into the table one at a time from the response body already in memory, so nothing extra is fetched and the match is never materialized as an array. Without a canvas those fields are absent and narrowing the query is the way to the rest
|
|
106
|
+
- Pass `canvas_id` from an earlier response to stage several results side by side and join across them
|
|
101
107
|
- Async-response detection — large unfiltered queries return an actionable, non-retryable error with filter guidance rather than silently timing out
|
|
102
108
|
|
|
109
|
+
---
|
|
110
|
+
|
|
111
|
+
### `eurostat_dataframe_describe` / `eurostat_dataframe_query`
|
|
112
|
+
|
|
113
|
+
SQL over the results `eurostat_query_dataset` stages. **Listed only when the dataframe canvas is enabled** (`CANVAS_PROVIDER_TYPE=duckdb`); the server is fully functional without it, and clients never see tools they cannot call.
|
|
114
|
+
|
|
115
|
+
- `eurostat_dataframe_describe` lists the staged tables with row counts and column names and types — call it before writing SQL
|
|
116
|
+
- `eurostat_dataframe_query` runs a single read-only `SELECT`. Statement chaining, non-`SELECT` verbs, and functions that read files or external data are rejected with a typed error
|
|
117
|
+
- Staged columns are flat: each dimension contributes a code column named after the dimension (`geo`) and a label column beside it (`geo_label`), followed by `obs_value`, `obs_flag`, and `obs_flag_label`
|
|
118
|
+
- The DuckDB binding ships with the server, so `CANVAS_PROVIDER_TYPE=duckdb` is the only switch. The exception is the one-click `.mcpb` bundle, which strips platform-specific native bindings to stay portable — a bundle install cannot run the canvas, so reach for the npm, Docker, or from-source install for SQL analytics
|
|
119
|
+
|
|
103
120
|
## Resource
|
|
104
121
|
|
|
105
122
|
| Type | Name | Description |
|
|
@@ -124,6 +141,7 @@ Eurostat-specific:
|
|
|
124
141
|
- Async-response detection — Eurostat returns a warning object rather than an error for over-limit queries; the server intercepts it and returns an actionable error with filter guidance
|
|
125
142
|
- NUTS hierarchy geo-level filtering across query and dimension-value tools
|
|
126
143
|
- Status flag decoding (provisional, estimated, definition differs, etc.)
|
|
144
|
+
- Optional DuckDB dataframe canvas — a query matching more than the inline cap is streamed row by row into a SQL table, reaching the observations the cap drops without a second request to Eurostat
|
|
127
145
|
|
|
128
146
|
Agent-friendly output:
|
|
129
147
|
|
|
@@ -249,6 +267,10 @@ All configuration is validated at startup via Zod schemas in `src/config/server-
|
|
|
249
267
|
| `EUROSTAT_BASE_URL` | Eurostat API base URL | `https://ec.europa.eu/eurostat/api/dissemination` |
|
|
250
268
|
| `EUROSTAT_REQUEST_TIMEOUT_MS` | HTTP request timeout in ms | `30000` |
|
|
251
269
|
| `EUROSTAT_TOC_CACHE_TTL_MS` | Catalogue TOC cache lifetime in ms — the first search or browse call past this age refreshes it | `43200000` (12 hours) |
|
|
270
|
+
| `CANVAS_PROVIDER_TYPE` | `duckdb` enables the dataframe canvas: lists the two dataframe tools and lets `eurostat_query_dataset` stage a match past its inline cap | `none` |
|
|
271
|
+
| `CANVAS_TEMP_PATH` | Directory DuckDB writes canvas spill files to. Must be writable by the server process | `<os tmpdir>/mcp-canvas` |
|
|
272
|
+
| `CANVAS_TTL_MS` | Sliding lifetime of a staged canvas in ms; every call against it extends the window | `86400000` (24 hours) |
|
|
273
|
+
| `CANVAS_DEFAULT_ROW_LIMIT` | Max rows one `eurostat_dataframe_query` returns before reporting `truncated` | `10000` |
|
|
252
274
|
| `OTEL_ENABLED` | Enable OpenTelemetry | `false` |
|
|
253
275
|
|
|
254
276
|
## Running the server
|
|
@@ -277,10 +299,11 @@ All configuration is validated at startup via Zod schemas in `src/config/server-
|
|
|
277
299
|
|
|
278
300
|
| Directory | Purpose |
|
|
279
301
|
|:---|:---|
|
|
280
|
-
| `src/mcp-server/tools` | Tool definitions (`*.tool.ts`). Five tools for discovery and data access. |
|
|
302
|
+
| `src/mcp-server/tools` | Tool definitions (`*.tool.ts`). Five tools for discovery and data access, plus two canvas-gated dataframe tools. |
|
|
281
303
|
| `src/mcp-server/resources` | Resource definitions. Dataset metadata resource. |
|
|
282
304
|
| `src/services/eurostat-catalogue` | Catalogue service — fetches and parses the Eurostat TOC TXT file; TTL-bounded in-memory cache. |
|
|
283
|
-
| `src/services/eurostat-data` | Data service — Statistics API HTTP client, JSON-stat 2.0 decoder, async-response detection. |
|
|
305
|
+
| `src/services/eurostat-data` | Data service — Statistics API HTTP client, JSON-stat 2.0 decoder, async-response detection, dataframe row source. |
|
|
306
|
+
| `src/services/canvas-accessor.ts` | Module-level accessor for the optional DataCanvas, plus the acquire helper that names the misconfigured path on a permission failure. |
|
|
284
307
|
| `src/config` | Server-specific environment variable parsing and validation with Zod. |
|
|
285
308
|
| `tests/` | Unit and integration tests, mirroring the `src/` structure. |
|
|
286
309
|
|
package/dist/index.js
CHANGED
|
@@ -3,15 +3,32 @@
|
|
|
3
3
|
* @fileoverview eurostat-mcp-server MCP server entry point.
|
|
4
4
|
* @module index
|
|
5
5
|
*/
|
|
6
|
-
import { createApp } from '@cyanheads/mcp-ts-core';
|
|
6
|
+
import { createApp, disabledTool } from '@cyanheads/mcp-ts-core';
|
|
7
|
+
import { config } from '@cyanheads/mcp-ts-core/config';
|
|
7
8
|
import { eurostatDatasetResource } from './mcp-server/resources/definitions/eurostat-dataset.resource.js';
|
|
8
9
|
import { eurostatBrowseThemes } from './mcp-server/tools/definitions/eurostat-browse-themes.tool.js';
|
|
10
|
+
import { eurostatDataframeDescribe } from './mcp-server/tools/definitions/eurostat-dataframe-describe.tool.js';
|
|
11
|
+
import { eurostatDataframeQuery } from './mcp-server/tools/definitions/eurostat-dataframe-query.tool.js';
|
|
9
12
|
import { eurostatGetDatasetInfo } from './mcp-server/tools/definitions/eurostat-get-dataset-info.tool.js';
|
|
10
13
|
import { eurostatGetDimensionValues } from './mcp-server/tools/definitions/eurostat-get-dimension-values.tool.js';
|
|
11
14
|
import { eurostatQueryDataset } from './mcp-server/tools/definitions/eurostat-query-dataset.tool.js';
|
|
12
15
|
import { eurostatSearchDatasets } from './mcp-server/tools/definitions/eurostat-search-datasets.tool.js';
|
|
16
|
+
import { setCanvas } from './services/canvas-accessor.js';
|
|
13
17
|
import { initEurostatCatalogueService } from './services/eurostat-catalogue/eurostat-catalogue-service.js';
|
|
14
18
|
import { initEurostatDataService } from './services/eurostat-data/eurostat-data-service.js';
|
|
19
|
+
/**
|
|
20
|
+
* The dataframe tools address tables on a canvas, so without one they have
|
|
21
|
+
* nothing to talk to. `disabledTool` keeps them off `tools/list` — clients
|
|
22
|
+
* cannot call them — while leaving them visible on the landing page and the
|
|
23
|
+
* server card with the variable that turns them on, so an operator can see the
|
|
24
|
+
* capability exists rather than wondering why the README documents a tool the
|
|
25
|
+
* server does not advertise.
|
|
26
|
+
*/
|
|
27
|
+
const canvasEnabled = config.canvas.providerType !== 'none';
|
|
28
|
+
const CANVAS_OFF = {
|
|
29
|
+
reason: 'This deployment runs without a dataframe canvas, so there are no tables to address.',
|
|
30
|
+
hint: 'CANVAS_PROVIDER_TYPE=duckdb',
|
|
31
|
+
};
|
|
15
32
|
await createApp({
|
|
16
33
|
name: 'eurostat-mcp-server',
|
|
17
34
|
title: 'eurostat-mcp-server',
|
|
@@ -21,16 +38,20 @@ await createApp({
|
|
|
21
38
|
eurostatGetDatasetInfo,
|
|
22
39
|
eurostatGetDimensionValues,
|
|
23
40
|
eurostatQueryDataset,
|
|
41
|
+
canvasEnabled ? eurostatDataframeDescribe : disabledTool(eurostatDataframeDescribe, CANVAS_OFF),
|
|
42
|
+
canvasEnabled ? eurostatDataframeQuery : disabledTool(eurostatDataframeQuery, CANVAS_OFF),
|
|
24
43
|
],
|
|
25
44
|
resources: [eurostatDatasetResource],
|
|
26
45
|
prompts: [],
|
|
27
46
|
instructions: `Eurostat MCP server — EU statistical data across the Eurostat catalogue.
|
|
28
47
|
Workflow: eurostat_search_datasets or eurostat_browse_themes to find a dataset code → eurostat_get_dataset_info to see dimensions → eurostat_get_dimension_values to list valid filter values → eurostat_query_dataset to fetch observations.
|
|
29
|
-
Apply dimension filters to
|
|
48
|
+
Apply dimension filters to keep queries small: an unfiltered query on a large dataset is slow and can return an async response error instead of data.
|
|
49
|
+
eurostat_query_dataset returns at most 5,000 observations inline. When the match is larger and this deployment runs a dataframe canvas, the whole match is also staged as a SQL table named in the response — read it with eurostat_dataframe_query (eurostat_dataframe_describe lists the table and column names). The dataframe tools are not listed when the canvas is off; there, narrowing the filters is what brings the rest of a capped match into reach.`,
|
|
30
50
|
landing: { requireAuth: false },
|
|
31
51
|
setup(core) {
|
|
32
52
|
initEurostatCatalogueService(core.config, core.storage);
|
|
33
53
|
initEurostatDataService(core.config, core.storage);
|
|
54
|
+
setCanvas(core.canvas);
|
|
34
55
|
},
|
|
35
56
|
});
|
|
36
57
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA;;;GAGG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA;;;GAGG;AAEH,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AACjE,OAAO,EAAE,MAAM,EAAE,MAAM,+BAA+B,CAAC;AACvD,OAAO,EAAE,uBAAuB,EAAE,MAAM,iEAAiE,CAAC;AAC1G,OAAO,EAAE,oBAAoB,E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AAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;QACxD,uBAAuB,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;QACnD,SAAS,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IACzB,CAAC;CACF,CAAC,CAAC"}
|
|
@@ -11,11 +11,11 @@ export declare const eurostatDatasetResource: import("@cyanheads/mcp-ts-core").R
|
|
|
11
11
|
dimensions: z.ZodArray<z.ZodObject<{
|
|
12
12
|
code: z.ZodString;
|
|
13
13
|
label: z.ZodString;
|
|
14
|
-
valuesCount: z.ZodNumber
|
|
15
|
-
sampleValues: z.ZodArray<z.ZodObject<{
|
|
14
|
+
valuesCount: z.ZodOptional<z.ZodNumber>;
|
|
15
|
+
sampleValues: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
16
16
|
code: z.ZodString;
|
|
17
17
|
label: z.ZodString;
|
|
18
|
-
}, z.core.$strip
|
|
18
|
+
}, z.core.$strip>>>;
|
|
19
19
|
}, z.core.$strip>>;
|
|
20
20
|
timeRange: z.ZodObject<{
|
|
21
21
|
start: z.ZodOptional<z.ZodString>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"eurostat-dataset.resource.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/resources/definitions/eurostat-dataset.resource.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAY,CAAC,EAAE,MAAM,wBAAwB,CAAC;AAGrD,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"eurostat-dataset.resource.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/resources/definitions/eurostat-dataset.resource.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAY,CAAC,EAAE,MAAM,wBAAwB,CAAC;AAGrD,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;6BAyElC,CAAC"}
|
|
@@ -21,7 +21,8 @@ export const eurostatDatasetResource = resource('eurostat://dataset/{dataset_cod
|
|
|
21
21
|
label: z.string().describe('Dimension name.'),
|
|
22
22
|
valuesCount: z
|
|
23
23
|
.number()
|
|
24
|
-
.
|
|
24
|
+
.optional()
|
|
25
|
+
.describe('Number of distinct values — the dataset\'s full period count for "time", the most recent period\'s codelist otherwise. Omitted when the value set could not be measured — only "time" can be, and an omitted count is unknown, not one.'),
|
|
25
26
|
sampleValues: z
|
|
26
27
|
.array(z
|
|
27
28
|
.object({
|
|
@@ -29,7 +30,8 @@ export const eurostatDatasetResource = resource('eurostat://dataset/{dataset_cod
|
|
|
29
30
|
label: z.string().describe('Value label.'),
|
|
30
31
|
})
|
|
31
32
|
.describe('A dimension value code and label pair.'))
|
|
32
|
-
.
|
|
33
|
+
.optional()
|
|
34
|
+
.describe('First 10 values for orientation. Omitted alongside valuesCount when the value set could not be measured.'),
|
|
33
35
|
})
|
|
34
36
|
.describe('A dataset dimension with its valid values.'))
|
|
35
37
|
.describe('Dataset dimensions.'),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"eurostat-dataset.resource.js","sourceRoot":"","sources":["../../../../src/mcp-server/resources/definitions/eurostat-dataset.resource.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,QAAQ,EAAE,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACrD,OAAO,EAAE,sBAAsB,EAAE,MAAM,mDAAmD,CAAC;AAE3F,MAAM,CAAC,MAAM,uBAAuB,GAAG,QAAQ,CAAC,mCAAmC,EAAE;IACnF,IAAI,EAAE,uBAAuB;IAC7B,WAAW,EACT,oNAAoN;IACtN,QAAQ,EAAE,kBAAkB;IAC5B,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC;QACf,YAAY,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,qCAAqC,CAAC;KACzE,CAAC;IACF,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC;QACf,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,eAAe,CAAC;QAC1C,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,+BAA+B,CAAC;QAC3D,UAAU,EAAE,CAAC;aACV,KAAK,CACJ,CAAC;aACE,MAAM,CAAC;YACN,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,iBAAiB,CAAC;YAC5C,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,iBAAiB,CAAC;YAC7C,WAAW,EAAE,CAAC;iBACX,MAAM,EAAE;iBACR,QAAQ,CACP,
|
|
1
|
+
{"version":3,"file":"eurostat-dataset.resource.js","sourceRoot":"","sources":["../../../../src/mcp-server/resources/definitions/eurostat-dataset.resource.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,QAAQ,EAAE,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACrD,OAAO,EAAE,sBAAsB,EAAE,MAAM,mDAAmD,CAAC;AAE3F,MAAM,CAAC,MAAM,uBAAuB,GAAG,QAAQ,CAAC,mCAAmC,EAAE;IACnF,IAAI,EAAE,uBAAuB;IAC7B,WAAW,EACT,oNAAoN;IACtN,QAAQ,EAAE,kBAAkB;IAC5B,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC;QACf,YAAY,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,qCAAqC,CAAC;KACzE,CAAC;IACF,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC;QACf,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,eAAe,CAAC;QAC1C,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,+BAA+B,CAAC;QAC3D,UAAU,EAAE,CAAC;aACV,KAAK,CACJ,CAAC;aACE,MAAM,CAAC;YACN,IAAI,EAAE,CA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B,MAAM,GAAG,GAAG,sBAAsB,EAAE,CAAC;QACrC,OAAO,GAAG,CAAC,cAAc,CAAC,MAAM,CAAC,YAAY,EAAE,GAAG,CAAC,CAAC;IACtD,CAAC;CACF,CAAC,CAAC"}
|
|
@@ -21,6 +21,7 @@ export declare const eurostatBrowseThemes: import("@cyanheads/mcp-ts-core").Tool
|
|
|
21
21
|
obsCount: z.ZodOptional<z.ZodNumber>;
|
|
22
22
|
}, z.core.$strip>>;
|
|
23
23
|
parentPath: z.ZodArray<z.ZodString>;
|
|
24
|
+
otherPlacements: z.ZodOptional<z.ZodArray<z.ZodArray<z.ZodString>>>;
|
|
24
25
|
nextStep: z.ZodOptional<z.ZodString>;
|
|
25
26
|
}, z.core.$strip>, readonly [{
|
|
26
27
|
readonly reason: "not_found";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"eurostat-browse-themes.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/eurostat-browse-themes.tool.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAiB,MAAM,+BAA+B,CAAC;AAGhF,eAAO,MAAM,oBAAoB
|
|
1
|
+
{"version":3,"file":"eurostat-browse-themes.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/eurostat-browse-themes.tool.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAiB,MAAM,+BAA+B,CAAC;AAGhF,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;EAkJ/B,CAAC"}
|
|
@@ -47,6 +47,12 @@ export const eurostatBrowseThemes = tool('eurostat_browse_themes', {
|
|
|
47
47
|
parentPath: z
|
|
48
48
|
.array(z.string())
|
|
49
49
|
.describe('Breadcrumb from root to the requested theme (e.g., ["Database by themes", "Economy and finance"]). Empty when browsing root.'),
|
|
50
|
+
otherPlacements: z
|
|
51
|
+
.array(z
|
|
52
|
+
.array(z.string())
|
|
53
|
+
.describe('Breadcrumb from root to one other folder carrying the requested code.'))
|
|
54
|
+
.optional()
|
|
55
|
+
.describe('Breadcrumbs of the other branches that file this same theme_code. Eurostat lists a few folder codes in more than one branch; the items above come from the first one the catalogue lists, which never has fewer children than the branches named here but can list different ones. theme_code takes a bare code, so those branches cannot be addressed directly — browse down to them from the root instead. Omitted when the code has a single placement — the normal case.'),
|
|
50
56
|
nextStep: z
|
|
51
57
|
.string()
|
|
52
58
|
.optional()
|
|
@@ -106,6 +112,9 @@ export const eurostatBrowseThemes = tool('eurostat_browse_themes', {
|
|
|
106
112
|
if (item.obsCount != null)
|
|
107
113
|
lines.push(` **Observations:** ${item.obsCount.toLocaleString()}`);
|
|
108
114
|
}
|
|
115
|
+
if (result.otherPlacements && result.otherPlacements.length > 0) {
|
|
116
|
+
lines.push(`\n**Also filed under:** this code appears in ${result.otherPlacements.length} other branch${result.otherPlacements.length !== 1 ? 'es' : ''} — ${result.otherPlacements.map((p) => p.join(' › ')).join('; ')}. The items above are from the branch listed first in the catalogue.`);
|
|
117
|
+
}
|
|
109
118
|
if (result.nextStep)
|
|
110
119
|
lines.push(`\n**Next step:** ${result.nextStep}`);
|
|
111
120
|
return [{ type: 'text', text: lines.join('\n') }];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"eurostat-browse-themes.tool.js","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/eurostat-browse-themes.tool.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAiB,MAAM,+BAA+B,CAAC;AAChF,OAAO,EAAE,2BAA2B,EAAE,MAAM,6DAA6D,CAAC;AAE1G,MAAM,CAAC,MAAM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IAAI,CAAC,IAAI,gBAAgB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,iBAAiB,CAAC,CAAC,CAAC,gBAAgB,EAAE,CAC9G,CAAC;YACF,IAAI,IAAI,CAAC,SAAS,IAAI,IAAI,CAAC,OAAO,EAAE,CAAC;gBACnC,KAAK,CAAC,IAAI,CAAC,iBAAiB,IAAI,CAAC,SAAS,IAAI,GAAG,MAAM,IAAI,CAAC,OAAO,IAAI,GAAG,EAAE,CAAC,CAAC;YAChF,CAAC;YACD,IAAI,IAAI,CAAC,QAAQ,IAAI,IAAI;gBACvB,KAAK,CAAC,IAAI,CAAC,uBAAuB,IAAI,CAAC,QAAQ,CAAC,cAAc,EAAE,EAAE,CAAC,CAAC;QACxE,CAAC;QACD,IAAI,MAAM,CAAC,QAAQ;YAAE,KAAK,CAAC,IAAI,CAAC,oBAAoB,MAAM,CAAC,QAAQ,EAAE,CAAC,CAAC;QACvE,OAAO,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACpD,CAAC;CACF,CAAC,CAAC"}
|
|
1
|
+
{"version":3,"file":"eurostat-browse-themes.tool.js","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/eurostat-browse-themes.tool.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAiB,MAAM,+BAA+B,CAAC;AAChF,OAAO,EAAE,2BAA2B,EAAE,MAAM,6DAA6D,CAAC;AAE1G,MAAM,CAAC,MAAM,oBAAoB,GAAG,IAAI,CAAC,wBAAwB,EAAE;IACjE,KAAK,EAAE,iCAAiC;IACxC,WAAW,EACT,kdAAkd;IACpd,WAAW,EAAE,EAAE,YAAY,EAAE,IAAI,EAAE,cAAc,EAAE,IAAI,EAAE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**
|
|
2
|
+
* @fileoverview Tool for listing the tables staged on a Eurostat DataCanvas.
|
|
3
|
+
* @module mcp-server/tools/definitions/eurostat-dataframe-describe.tool
|
|
4
|
+
*/
|
|
5
|
+
import { z } from '@cyanheads/mcp-ts-core';
|
|
6
|
+
import { JsonRpcErrorCode } from '@cyanheads/mcp-ts-core/errors';
|
|
7
|
+
export declare const eurostatDataframeDescribe: import("@cyanheads/mcp-ts-core").ToolDefinition<z.ZodObject<{
|
|
8
|
+
canvas_id: z.ZodString;
|
|
9
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
10
|
+
canvasId: z.ZodString;
|
|
11
|
+
expiresAt: z.ZodString;
|
|
12
|
+
tables: z.ZodArray<z.ZodObject<{
|
|
13
|
+
name: z.ZodString;
|
|
14
|
+
kind: z.ZodEnum<{
|
|
15
|
+
table: "table";
|
|
16
|
+
view: "view";
|
|
17
|
+
}>;
|
|
18
|
+
rowCount: z.ZodNumber;
|
|
19
|
+
expiresAt: z.ZodOptional<z.ZodString>;
|
|
20
|
+
columns: z.ZodArray<z.ZodObject<{
|
|
21
|
+
name: z.ZodString;
|
|
22
|
+
type: z.ZodString;
|
|
23
|
+
nullable: z.ZodBoolean;
|
|
24
|
+
}, z.core.$strip>>;
|
|
25
|
+
}, z.core.$strip>>;
|
|
26
|
+
}, z.core.$strip>, readonly [{
|
|
27
|
+
readonly reason: "canvas_disabled";
|
|
28
|
+
readonly code: JsonRpcErrorCode.ServiceUnavailable;
|
|
29
|
+
readonly when: "This deployment runs without a dataframe canvas, so there is nothing to describe.";
|
|
30
|
+
readonly retryable: false;
|
|
31
|
+
readonly recovery: "Query the data inline with eurostat_query_dataset, narrowing dimension filters until the result fits.";
|
|
32
|
+
}, {
|
|
33
|
+
readonly reason: "canvas_not_found";
|
|
34
|
+
readonly code: JsonRpcErrorCode.NotFound;
|
|
35
|
+
readonly when: "The canvas_id is unknown or its lifetime has elapsed.";
|
|
36
|
+
readonly recovery: "Re-run eurostat_query_dataset to stage the data again and use the canvasId it returns.";
|
|
37
|
+
}], {
|
|
38
|
+
readonly notice: z.ZodOptional<z.ZodString>;
|
|
39
|
+
}>;
|
|
40
|
+
//# sourceMappingURL=eurostat-dataframe-describe.tool.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"eurostat-dataframe-describe.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/eurostat-dataframe-describe.tool.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAGjE,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAgIpC,CAAC"}
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Tool for listing the tables staged on a Eurostat DataCanvas.
|
|
3
|
+
* @module mcp-server/tools/definitions/eurostat-dataframe-describe.tool
|
|
4
|
+
*/
|
|
5
|
+
import { tool, z } from '@cyanheads/mcp-ts-core';
|
|
6
|
+
import { JsonRpcErrorCode } from '@cyanheads/mcp-ts-core/errors';
|
|
7
|
+
import { acquireCanvas, getCanvas } from '../../../services/canvas-accessor.js';
|
|
8
|
+
export const eurostatDataframeDescribe = tool('eurostat_dataframe_describe', {
|
|
9
|
+
title: 'Describe Eurostat Dataframes',
|
|
10
|
+
description: 'List the tables staged on a Eurostat dataframe canvas, with their row counts and column names and types. Call this before eurostat_dataframe_query to learn the table and column names to write SQL against. The canvas_id comes from a eurostat_query_dataset response that reported a staged table. Every observation column is flat: each dimension contributes a code column named after the dimension (e.g. "geo") and a label column beside it (e.g. "geo_label"), alongside obs_value, obs_flag, and obs_flag_label.',
|
|
11
|
+
annotations: { readOnlyHint: true, idempotentHint: true, openWorldHint: false },
|
|
12
|
+
input: z.object({
|
|
13
|
+
canvas_id: z
|
|
14
|
+
.string()
|
|
15
|
+
.min(1)
|
|
16
|
+
.describe('Canvas identifier returned by eurostat_query_dataset as canvasId. Identifies the workspace holding the staged tables.'),
|
|
17
|
+
}),
|
|
18
|
+
output: z.object({
|
|
19
|
+
canvasId: z.string().describe('Canvas identifier the tables were read from.'),
|
|
20
|
+
expiresAt: z
|
|
21
|
+
.string()
|
|
22
|
+
.describe('ISO 8601 timestamp when the canvas expires. Every call on it slides this forward.'),
|
|
23
|
+
tables: z
|
|
24
|
+
.array(z
|
|
25
|
+
.object({
|
|
26
|
+
name: z.string().describe('Table name to reference in SQL.'),
|
|
27
|
+
kind: z
|
|
28
|
+
.enum(['table', 'view'])
|
|
29
|
+
.describe('Whether the entry is a base table or a view.'),
|
|
30
|
+
rowCount: z.number().describe('Rows the table holds.'),
|
|
31
|
+
expiresAt: z
|
|
32
|
+
.string()
|
|
33
|
+
.optional()
|
|
34
|
+
.describe('ISO 8601 expiry of this table specifically. Omitted when the table ages with the canvas rather than on its own clock.'),
|
|
35
|
+
columns: z
|
|
36
|
+
.array(z
|
|
37
|
+
.object({
|
|
38
|
+
name: z.string().describe('Column name.'),
|
|
39
|
+
type: z.string().describe('SQL column type (e.g. "VARCHAR", "DOUBLE").'),
|
|
40
|
+
nullable: z.boolean().describe('Whether the column admits NULL.'),
|
|
41
|
+
})
|
|
42
|
+
.describe('One column of the table.'))
|
|
43
|
+
.describe('Columns in declaration order.'),
|
|
44
|
+
})
|
|
45
|
+
.describe('One table or view staged on the canvas.'))
|
|
46
|
+
.describe('Tables staged on this canvas. Empty when nothing has been staged yet, or when every staged table has expired.'),
|
|
47
|
+
}),
|
|
48
|
+
enrichment: {
|
|
49
|
+
notice: z
|
|
50
|
+
.string()
|
|
51
|
+
.optional()
|
|
52
|
+
.describe('Guidance when the canvas holds no tables. Omitted when it holds at least one.'),
|
|
53
|
+
},
|
|
54
|
+
errors: [
|
|
55
|
+
{
|
|
56
|
+
reason: 'canvas_disabled',
|
|
57
|
+
code: JsonRpcErrorCode.ServiceUnavailable,
|
|
58
|
+
when: 'This deployment runs without a dataframe canvas, so there is nothing to describe.',
|
|
59
|
+
retryable: false,
|
|
60
|
+
recovery: 'Query the data inline with eurostat_query_dataset, narrowing dimension filters until the result fits.',
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
reason: 'canvas_not_found',
|
|
64
|
+
code: JsonRpcErrorCode.NotFound,
|
|
65
|
+
when: 'The canvas_id is unknown or its lifetime has elapsed.',
|
|
66
|
+
recovery: 'Re-run eurostat_query_dataset to stage the data again and use the canvasId it returns.',
|
|
67
|
+
},
|
|
68
|
+
],
|
|
69
|
+
async handler(input, ctx) {
|
|
70
|
+
const canvas = getCanvas();
|
|
71
|
+
if (!canvas) {
|
|
72
|
+
throw ctx.fail('canvas_disabled', undefined, ctx.recoveryFor('canvas_disabled'));
|
|
73
|
+
}
|
|
74
|
+
const instance = await acquireCanvas(canvas, input.canvas_id, ctx);
|
|
75
|
+
const tables = await instance.describe();
|
|
76
|
+
ctx.log.info('Described canvas', { canvasId: instance.canvasId, tableCount: tables.length });
|
|
77
|
+
if (tables.length === 0) {
|
|
78
|
+
ctx.enrich.notice(`Canvas ${instance.canvasId} holds no tables. Staged tables expire on their own schedule — re-run eurostat_query_dataset to stage the data again.`);
|
|
79
|
+
}
|
|
80
|
+
return {
|
|
81
|
+
canvasId: instance.canvasId,
|
|
82
|
+
expiresAt: instance.expiresAt,
|
|
83
|
+
tables: tables.map((t) => ({
|
|
84
|
+
name: t.name,
|
|
85
|
+
kind: t.kind,
|
|
86
|
+
rowCount: t.rowCount,
|
|
87
|
+
...(t.expiresAt !== undefined && { expiresAt: t.expiresAt }),
|
|
88
|
+
columns: t.columns.map((c) => ({
|
|
89
|
+
name: c.name,
|
|
90
|
+
type: c.type,
|
|
91
|
+
nullable: c.nullable ?? true,
|
|
92
|
+
})),
|
|
93
|
+
})),
|
|
94
|
+
};
|
|
95
|
+
},
|
|
96
|
+
format: (result) => {
|
|
97
|
+
const lines = [
|
|
98
|
+
`# Canvas \`${result.canvasId}\``,
|
|
99
|
+
`**Expires:** ${result.expiresAt} | **Tables:** ${result.tables.length}\n`,
|
|
100
|
+
];
|
|
101
|
+
for (const table of result.tables) {
|
|
102
|
+
const expiry = table.expiresAt === undefined ? '' : ` | **expiresAt:** ${table.expiresAt}`;
|
|
103
|
+
lines.push(`## \`${table.name}\` (${table.kind})`);
|
|
104
|
+
lines.push(`**Rows:** ${table.rowCount}${expiry}`);
|
|
105
|
+
for (const col of table.columns) {
|
|
106
|
+
lines.push(`- \`${col.name}\` ${col.type} (nullable: ${col.nullable})`);
|
|
107
|
+
}
|
|
108
|
+
lines.push('');
|
|
109
|
+
}
|
|
110
|
+
return [{ type: 'text', text: lines.join('\n') }];
|
|
111
|
+
},
|
|
112
|
+
});
|
|
113
|
+
//# sourceMappingURL=eurostat-dataframe-describe.tool.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"eurostat-dataframe-describe.tool.js","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/eurostat-dataframe-describe.tool.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,+BAA+B,CAAC;AAEzE,MAAM,CAAC,MAAM,yBAAyB,GAAG,IAAI,CAAC,6BAA6B,EAAE;IAC3E,KAAK,EAAE,8BAA8B;IACrC,WAAW,EACT,6fAA6f;IAC/f,WAAW,EAAE,EAAE,YAAY,EAAE,IAAI,EAAE,cAAc,EAAE,IAAI,EAAE,aAAa,EAAE,KAAK,EAAE;IAC/E,KAAK,EAAE,CAAC,CAAC,MAAM,CAAC;QACd,SAAS,EAAE,CAAC;aACT,MAAM,EAAE;aACR,GAAG,CAAC,CAAC,CAAC;aACN,QAAQ,CACP,uHAAuH,CACxH;KACJ,CAAC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EAAE,CAAC,CAAC;QACjB,CAAC;QACD,OAAO,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACpD,CAAC;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Tool for running read-only SQL against tables staged on a
|
|
3
|
+
* Eurostat DataCanvas.
|
|
4
|
+
* @module mcp-server/tools/definitions/eurostat-dataframe-query.tool
|
|
5
|
+
*/
|
|
6
|
+
import { z } from '@cyanheads/mcp-ts-core';
|
|
7
|
+
import { JsonRpcErrorCode } from '@cyanheads/mcp-ts-core/errors';
|
|
8
|
+
export declare const eurostatDataframeQuery: import("@cyanheads/mcp-ts-core").ToolDefinition<z.ZodObject<{
|
|
9
|
+
canvas_id: z.ZodString;
|
|
10
|
+
sql: z.ZodString;
|
|
11
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
12
|
+
canvasId: z.ZodString;
|
|
13
|
+
columns: z.ZodArray<z.ZodString>;
|
|
14
|
+
rows: z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
15
|
+
rowCount: z.ZodNumber;
|
|
16
|
+
truncated: z.ZodBoolean;
|
|
17
|
+
}, z.core.$strip>, readonly [{
|
|
18
|
+
readonly reason: "canvas_disabled";
|
|
19
|
+
readonly code: JsonRpcErrorCode.ServiceUnavailable;
|
|
20
|
+
readonly when: "This deployment runs without a dataframe canvas, so there is nothing to query.";
|
|
21
|
+
readonly retryable: false;
|
|
22
|
+
readonly recovery: "Query the data inline with eurostat_query_dataset, narrowing dimension filters until the result fits.";
|
|
23
|
+
}, {
|
|
24
|
+
readonly reason: "canvas_not_found";
|
|
25
|
+
readonly code: JsonRpcErrorCode.NotFound;
|
|
26
|
+
readonly when: "The canvas_id is unknown or its lifetime has elapsed.";
|
|
27
|
+
readonly recovery: "Re-run eurostat_query_dataset to stage the data again and use the canvasId it returns.";
|
|
28
|
+
}, {
|
|
29
|
+
readonly reason: "missing_table";
|
|
30
|
+
readonly code: JsonRpcErrorCode.NotFound;
|
|
31
|
+
readonly when: "The SQL names a table that is not staged on this canvas, or that has expired.";
|
|
32
|
+
readonly recovery: "Call eurostat_dataframe_describe for the staged table names, or re-run eurostat_query_dataset to stage them again.";
|
|
33
|
+
}], undefined>;
|
|
34
|
+
//# sourceMappingURL=eurostat-dataframe-query.tool.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"eurostat-dataframe-query.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/eurostat-dataframe-query.tool.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAGjE,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;cAiHjC,CAAC"}
|