@cyanheads/eurostat-mcp-server 0.9.0 → 0.10.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.
Files changed (68) hide show
  1. package/AGENTS.md +5 -5
  2. package/CLAUDE.md +5 -5
  3. package/Dockerfile +5 -4
  4. package/README.md +17 -12
  5. package/changelog/0.10.x/0.10.0.md +40 -0
  6. package/dist/index.js +1 -1
  7. package/dist/mcp-server/tools/definitions/eurostat-browse-themes.tool.d.ts +10 -2
  8. package/dist/mcp-server/tools/definitions/eurostat-browse-themes.tool.d.ts.map +1 -1
  9. package/dist/mcp-server/tools/definitions/eurostat-browse-themes.tool.js +63 -10
  10. package/dist/mcp-server/tools/definitions/eurostat-browse-themes.tool.js.map +1 -1
  11. package/dist/mcp-server/tools/definitions/eurostat-dataframe-describe.tool.d.ts +0 -1
  12. package/dist/mcp-server/tools/definitions/eurostat-dataframe-describe.tool.d.ts.map +1 -1
  13. package/dist/mcp-server/tools/definitions/eurostat-dataframe-describe.tool.js +14 -4
  14. package/dist/mcp-server/tools/definitions/eurostat-dataframe-describe.tool.js.map +1 -1
  15. package/dist/mcp-server/tools/definitions/eurostat-dataframe-query.tool.d.ts +0 -2
  16. package/dist/mcp-server/tools/definitions/eurostat-dataframe-query.tool.d.ts.map +1 -1
  17. package/dist/mcp-server/tools/definitions/eurostat-dataframe-query.tool.js +17 -5
  18. package/dist/mcp-server/tools/definitions/eurostat-dataframe-query.tool.js.map +1 -1
  19. package/dist/mcp-server/tools/definitions/eurostat-download-dataset.tool.d.ts +1 -2
  20. package/dist/mcp-server/tools/definitions/eurostat-download-dataset.tool.d.ts.map +1 -1
  21. package/dist/mcp-server/tools/definitions/eurostat-download-dataset.tool.js +38 -13
  22. package/dist/mcp-server/tools/definitions/eurostat-download-dataset.tool.js.map +1 -1
  23. package/dist/mcp-server/tools/definitions/eurostat-get-dataset-info.tool.d.ts +1 -1
  24. package/dist/mcp-server/tools/definitions/eurostat-get-dataset-info.tool.d.ts.map +1 -1
  25. package/dist/mcp-server/tools/definitions/eurostat-get-dataset-info.tool.js +10 -1
  26. package/dist/mcp-server/tools/definitions/eurostat-get-dataset-info.tool.js.map +1 -1
  27. package/dist/mcp-server/tools/definitions/eurostat-get-dimension-values.tool.d.ts +13 -6
  28. package/dist/mcp-server/tools/definitions/eurostat-get-dimension-values.tool.d.ts.map +1 -1
  29. package/dist/mcp-server/tools/definitions/eurostat-get-dimension-values.tool.js +235 -53
  30. package/dist/mcp-server/tools/definitions/eurostat-get-dimension-values.tool.js.map +1 -1
  31. package/dist/mcp-server/tools/definitions/eurostat-query-dataset.tool.d.ts +9 -5
  32. package/dist/mcp-server/tools/definitions/eurostat-query-dataset.tool.d.ts.map +1 -1
  33. package/dist/mcp-server/tools/definitions/eurostat-query-dataset.tool.js +43 -17
  34. package/dist/mcp-server/tools/definitions/eurostat-query-dataset.tool.js.map +1 -1
  35. package/dist/mcp-server/tools/definitions/eurostat-search-datasets.tool.d.ts +10 -2
  36. package/dist/mcp-server/tools/definitions/eurostat-search-datasets.tool.d.ts.map +1 -1
  37. package/dist/mcp-server/tools/definitions/eurostat-search-datasets.tool.js +79 -14
  38. package/dist/mcp-server/tools/definitions/eurostat-search-datasets.tool.js.map +1 -1
  39. package/dist/mcp-server/tools/value-list-paging.d.ts +49 -0
  40. package/dist/mcp-server/tools/value-list-paging.d.ts.map +1 -0
  41. package/dist/mcp-server/tools/value-list-paging.js +73 -0
  42. package/dist/mcp-server/tools/value-list-paging.js.map +1 -0
  43. package/dist/services/canvas-accessor.d.ts +11 -1
  44. package/dist/services/canvas-accessor.d.ts.map +1 -1
  45. package/dist/services/canvas-accessor.js +13 -2
  46. package/dist/services/canvas-accessor.js.map +1 -1
  47. package/dist/services/eurostat-bulk/eurostat-bulk-service.d.ts +8 -4
  48. package/dist/services/eurostat-bulk/eurostat-bulk-service.d.ts.map +1 -1
  49. package/dist/services/eurostat-bulk/eurostat-bulk-service.js +62 -25
  50. package/dist/services/eurostat-bulk/eurostat-bulk-service.js.map +1 -1
  51. package/dist/services/eurostat-catalogue/eurostat-catalogue-service.d.ts +46 -4
  52. package/dist/services/eurostat-catalogue/eurostat-catalogue-service.d.ts.map +1 -1
  53. package/dist/services/eurostat-catalogue/eurostat-catalogue-service.js +134 -33
  54. package/dist/services/eurostat-catalogue/eurostat-catalogue-service.js.map +1 -1
  55. package/dist/services/eurostat-data/eurostat-data-service.d.ts +5 -0
  56. package/dist/services/eurostat-data/eurostat-data-service.d.ts.map +1 -1
  57. package/dist/services/eurostat-data/eurostat-data-service.js +133 -24
  58. package/dist/services/eurostat-data/eurostat-data-service.js.map +1 -1
  59. package/dist/services/eurostat-filters.d.ts +13 -0
  60. package/dist/services/eurostat-filters.d.ts.map +1 -0
  61. package/dist/services/eurostat-filters.js +21 -0
  62. package/dist/services/eurostat-filters.js.map +1 -0
  63. package/dist/services/eurostat-outage.d.ts +27 -0
  64. package/dist/services/eurostat-outage.d.ts.map +1 -0
  65. package/dist/services/eurostat-outage.js +44 -0
  66. package/dist/services/eurostat-outage.js.map +1 -0
  67. package/package.json +7 -7
  68. package/server.json +3 -3
@@ -5,9 +5,12 @@
5
5
  import { tool, z } from '@cyanheads/mcp-ts-core';
6
6
  import { CanvasIdSchema } from '@cyanheads/mcp-ts-core/canvas';
7
7
  import { JsonRpcErrorCode } from '@cyanheads/mcp-ts-core/errors';
8
- import { acquireCanvas, getCanvas, newTableName } from '../../../services/canvas-accessor.js';
8
+ import { decodeCursor, encodeCursor } from '@cyanheads/mcp-ts-core/utils';
9
+ import { filterTokens, fitPage, INLINE_BUDGET_BYTES, matchValues, utf8Bytes, } from '../value-list-paging.js';
10
+ import { acquireCanvas, getCanvas, isCanvasFailure, newTableName, } from '../../../services/canvas-accessor.js';
9
11
  import { getEurostatDataService } from '../../../services/eurostat-data/eurostat-data-service.js';
10
12
  import { GEO_LEVEL_VALUES } from '../../../services/eurostat-data/types.js';
13
+ import { outageAnswer } from '../../../services/eurostat-outage.js';
11
14
  /**
12
15
  * The staged value list: the same `{code, label}` pairs as the inline `values`,
13
16
  * declared rather than sniffed. The service falls back to the code when Eurostat
@@ -17,17 +20,78 @@ const VALUE_TABLE_SCHEMA = [
17
20
  { name: 'code', type: 'VARCHAR', nullable: false },
18
21
  { name: 'label', type: 'VARCHAR', nullable: false },
19
22
  ];
23
+ /** Longest filter accepted: room for many words, while its echo and cursor stay small. */
24
+ const FILTER_MAX_CHARS = 500;
25
+ /** Page length when no limit was given: the byte budget alone ends the page. */
26
+ const NO_LIMIT = Number.MAX_SAFE_INTEGER;
27
+ /** A blank or whitespace-only string from a form client is "unset", never a value to validate. */
28
+ const blankAsUnset = (schema) => z.preprocess((value) => (typeof value === 'string' && value.trim() === '' ? undefined : value), schema);
29
+ const formatCount = (n) => n.toLocaleString('en-US');
30
+ /** The `content[]` text of the payload — `format()`'s body, shared with the byte measure. */
31
+ function renderText(result) {
32
+ const listed = result.values.length;
33
+ const partial = (of) => (listed < of ? ` — ${listed} listed below` : '');
34
+ const lines = [
35
+ `**Dimension:** ${result.dimensionLabel} (\`${result.dimensionCode}\`)`,
36
+ ...(result.geoLevel ? [`**Geo level:** \`${result.geoLevel}\``] : []),
37
+ `**Total values:** ${result.totalCount}${result.matchCount === undefined ? partial(result.totalCount) : ''}`,
38
+ ...(result.matchCount === undefined
39
+ ? []
40
+ : [`**Matching filter:** ${result.matchCount}${partial(result.matchCount)}`]),
41
+ ...(result.tableName
42
+ ? [
43
+ `**Staged:** table \`${result.tableName}\` on canvas \`${result.canvasId}\` (stagedRowCount ${result.stagedRowCount}), columns code and label — inspect it with eurostat_dataframe_describe first, then join it in eurostat_dataframe_query`,
44
+ ]
45
+ : []),
46
+ '',
47
+ ];
48
+ for (const v of result.values) {
49
+ lines.push(`- \`${v.code}\` — ${v.label}`);
50
+ }
51
+ return lines.join('\n');
52
+ }
20
53
  /**
21
- * Most values returned inline. Every NUTS level and classification list measured on
22
- * the main host fits (the largest, NUTS-3 geo, is 1,621); daily time lists (13,900 on
23
- * ert_bil_eur_d), the largest airport-pair lists (2,383 on avia_par_uk) and the Comext
24
- * product lists (37,069 CN8 codes on DS-045409, an 11 MB response uncapped) do not.
25
- * A staged table always holds the whole list.
54
+ * The framework's `content[]` trailer for one page's enrichment: generic
55
+ * `**key:** value` lines, then the notice as a block quote, newline-joined. It
56
+ * is mirrored here so a page is measured as the caller receives it; a paging
57
+ * test pins the trailer the framework composes to this exact text, so the two
58
+ * cannot drift apart unnoticed.
26
59
  */
27
- const INLINE_VALUE_CAP = 2_000;
60
+ function renderTrailer(enrichment) {
61
+ const fields = [
62
+ ...(enrichment.truncated ? ['**truncated:** true'] : []),
63
+ ...(enrichment.nextCursor ? [`**nextCursor:** ${enrichment.nextCursor}`] : []),
64
+ ...(enrichment.notice ? [`> ${enrichment.notice}`] : []),
65
+ ];
66
+ return fields.length > 0 ? `\n\n${fields.join('\n')}` : '';
67
+ }
68
+ /**
69
+ * Decode a cursor and confirm it belongs to this call in every binding the input
70
+ * alone settles; `undefined` when it does not. Malformed and mismatched cursors
71
+ * are refused alike: the recovery is the same, and the cursor is opaque. The
72
+ * effective geo level is left to the caller, which knows it only once the
73
+ * dimension's values are loaded.
74
+ */
75
+ function readCursor(cursor, binding, ctx) {
76
+ try {
77
+ const state = decodeCursor(cursor, ctx);
78
+ if (typeof state.after === 'string' &&
79
+ state.dataset === binding.dataset &&
80
+ state.dimension === binding.dimension &&
81
+ state.filter === binding.filter) {
82
+ return { after: state.after, geoLevel: state.geoLevel, limit: state.limit };
83
+ }
84
+ }
85
+ catch {
86
+ // Undecodable — the same refusal as one that decodes but belongs to another call.
87
+ }
88
+ return;
89
+ }
90
+ /** The refusal of a cursor that is malformed or belongs to another call. */
91
+ const UNUSABLE_CURSOR = 'Unusable cursor: it is malformed, or was issued for a different dataset_code, dimension, geo_level or filter.';
28
92
  export const eurostatGetDimensionValues = tool('eurostat_get_dimension_values', {
29
93
  title: 'Get Eurostat Dimension Values',
30
- description: `List the valid values for a specific dimension in a Eurostat dataset (e.g., all unit codes for nama_10_gdp, all geo codes for a regional dataset). Use this when eurostat_get_dataset_info returns more values than the 10-item sample, or to confirm exact codes before querying. For the "geo" dimension, use geo_level to filter by NUTS hierarchy (country, nuts1, nuts2, nuts3). An invalid code matches nothing: eurostat_query_dataset names it in unmatchedValues, or in its no_results error when the query matched nothing at all, and Eurostat rejects it as a fault on eurostat_download_dataset; use this tool to verify codes first. At most ${INLINE_VALUE_CAP.toLocaleString('en-US')} values come back inline — a longer list, such as the 37,069 CN8 product codes of DS-045409 or a daily time dimension, is cut there and says so. Pass canvas_id to also stage the whole list, whatever its length, as a two-column code/label table on that dataframe canvas: search it with SQL, or join it to a eurostat_download_dataset table, whose columns carry dimension codes only.`,
94
+ description: `List the valid values for a specific dimension in a Eurostat dataset (e.g., all unit codes for nama_10_gdp, all geo codes for a regional dataset). Use this when eurostat_get_dataset_info returns more values than the 10-item sample, or to confirm exact codes before querying. For the "geo" dimension, use geo_level to filter by NUTS hierarchy (country, nuts1, nuts2, nuts3). An invalid code matches nothing: eurostat_query_dataset names it in unmatchedValues, or in its no_results error when the query matched nothing at all, and Eurostat rejects it as a fault on eurostat_download_dataset; use this tool to verify codes first. To find one code in a long list, such as the 37,069 CN8 product codes of DS-045409, pass filter: words its code or label contains. A long list comes back a page at a time, each response held to ${formatCount(INLINE_BUDGET_BYTES)} bytes; a page with more after it carries nextCursor — pass it back as cursor for the next page. Pass canvas_id to also stage the whole list, whatever its length, as a two-column code/label table on that dataframe canvas: search it with SQL, or join it to a eurostat_download_dataset table, whose columns carry dimension codes only.`,
31
95
  annotations: { readOnlyHint: true, idempotentHint: true, openWorldHint: true },
32
96
  input: z.object({
33
97
  dataset_code: z
@@ -42,7 +106,15 @@ export const eurostatGetDimensionValues = tool('eurostat_get_dimension_values',
42
106
  .enum(GEO_LEVEL_VALUES)
43
107
  .optional()
44
108
  .describe('NUTS hierarchy level filter — applies only when dimension is "geo"; passing it with any other dimension is rejected. Options: "aggregate" (EU/EA codes), "country" (2-letter codes, default), "nuts1" (3-char), "nuts2" (4-char), "nuts3" (5-char).'),
45
- canvas_id: CanvasIdSchema.optional().describe('Also stage the values on this dataframe canvas as a table with two columns, code and label, holding every value the dimension lists — past the inline cap too — at the geo_level requested, country when it is omitted. Pass the canvasId a eurostat_download_dataset or eurostat_query_dataset response returned, then search the staged table with SQL or join it to a download on the dimension column (e.g., d.geo = g.code). Omit to return the values inline only: this tool never starts a canvas. Ignored on deployments without a dataframe canvas.'),
109
+ filter: blankAsUnset(z.string().max(FILTER_MAX_CHARS).optional()).describe(`Words to find, up to ${FILTER_MAX_CHARS} characters: keeps only values whose code and label, joined by a space, contain every whitespace-separated word as a substring — in any order, ignoring case and accents ("palma frankfurt" finds DE_EDDF_ES_LEPA, "zurich" finds Zürich). Punctuation is part of a word, and spellings are not transliterated ("münchen" does not find MUENCHEN). Runs over the whole list at the effective geo_level before paging and keeps Eurostat's order, with no ranking; matchCount counts the matches.`),
110
+ limit: z
111
+ .number()
112
+ .int()
113
+ .min(1)
114
+ .optional()
115
+ .describe(`Most values per page. No default and no maximum: without it a page holds as many whole values as fit ${formatCount(INLINE_BUDGET_BYTES)} bytes, and with it the page ends at whichever comes first. Fixed by the first call: on a call with cursor, the cursor carries that first limit and this field is ignored.`),
116
+ cursor: blankAsUnset(z.string().optional()).describe("Opaque nextCursor from the previous page; omit for the first page. It resumes after that page's last code and is bound to dataset_code, dimension, geo_level and filter, so send those unchanged. Cannot be combined with canvas_id on a deployment with a dataframe canvas."),
117
+ canvas_id: CanvasIdSchema.optional().describe('Also stage the values on this dataframe canvas as a table with two columns, code and label, holding every value the dimension lists at the geo_level requested (country when it is omitted), whatever filter and limit are. Pass the canvasId a eurostat_download_dataset or eurostat_query_dataset response returned, then search the staged table with SQL or join it to a download on the dimension column (e.g., d.geo = g.code). Only on a call without cursor; omit to return the values inline only: this tool never starts a canvas. Ignored on deployments without a dataframe canvas.'),
46
118
  }),
47
119
  output: z.object({
48
120
  dimensionCode: z.string().describe('The dimension code that was queried.'),
@@ -60,10 +132,14 @@ export const eurostatGetDimensionValues = tool('eurostat_get_dimension_values',
60
132
  label: z.string().describe('Human-readable label for this value.'),
61
133
  })
62
134
  .describe('A dimension value code and label pair.'))
63
- .describe(`Dataset-available values for this dimension, in Eurostat's order — for geo, the subset at geoLevel. Holds every value up to ${INLINE_VALUE_CAP.toLocaleString('en-US')}; past that, the first ${INLINE_VALUE_CAP.toLocaleString('en-US')}, with truncated set and the whole list on the canvas table when canvas_id was passed.`),
135
+ .describe(`This page of the dataset-available values, in Eurostat's order — for geo, the subset at geoLevel; with filter, only the matches. A page ends between whole values, at limit or at ${formatCount(INLINE_BUDGET_BYTES)} bytes per response surface, whichever comes first, and holds at least one value; truncated and nextCursor are set when more follow.`),
64
136
  totalCount: z
65
137
  .number()
66
- .describe('Number of distinct values the dimension lists, after geoLevel filtering for geo — all of them, including any past the inline cap.'),
138
+ .describe('Number of distinct values the dimension lists, after geoLevel filtering for geo — every one, whatever filter and paging apply.'),
139
+ matchCount: z
140
+ .number()
141
+ .optional()
142
+ .describe('Values matching filter across the whole list, before paging. Present only when filter was passed.'),
67
143
  canvasId: z
68
144
  .string()
69
145
  .optional()
@@ -81,13 +157,15 @@ export const eurostatGetDimensionValues = tool('eurostat_get_dimension_values',
81
157
  truncated: z
82
158
  .boolean()
83
159
  .optional()
84
- .describe('True when the dimension lists more values than the inline cap and values holds only the first of them. Omitted when values holds every one.'),
85
- shown: z.number().optional().describe('Values returned inline. Present alongside truncated.'),
86
- cap: z.number().optional().describe('The inline cap applied. Present alongside truncated.'),
160
+ .describe('True when more values follow this page — pass nextCursor as cursor to fetch them. Omitted on the last page.'),
161
+ nextCursor: z
162
+ .string()
163
+ .optional()
164
+ .describe("Opaque cursor for the next page. Pass it back as cursor with dataset_code, dimension, geo_level and filter unchanged; it resumes after this page's last code. Omitted on the last page."),
87
165
  notice: z
88
166
  .string()
89
167
  .optional()
90
- .describe('Where the values past the inline cap are: the staged table when canvas_id was passed, or how to stage them. Present alongside truncated.'),
168
+ .describe('On a page with more after it: whether limit or the response budget ended it, and the routes to the rest — nextCursor, filter, and canvas_id. Also explains a filter that matched nothing.'),
91
169
  },
92
170
  errors: [
93
171
  {
@@ -105,13 +183,19 @@ export const eurostatGetDimensionValues = tool('eurostat_get_dimension_values',
105
183
  {
106
184
  reason: 'conflicting_params',
107
185
  code: JsonRpcErrorCode.ValidationError,
108
- when: 'geo_level was combined with a dimension other than "geo", where it has no effect.',
109
- recovery: 'Drop geo_level to list that dimension, or set dimension to "geo" to filter by NUTS level.',
186
+ when: 'geo_level was combined with a dimension other than "geo", where it has no effect; or, on a deployment with a dataframe canvas, canvas_id was combined with cursor, which would stage the list again on every page.',
187
+ recovery: 'Drop geo_level for a dimension other than "geo"; when paging with cursor, drop canvas_id — a first call that carried canvas_id staged every value.',
188
+ },
189
+ {
190
+ reason: 'invalid_cursor',
191
+ code: JsonRpcErrorCode.InvalidParams,
192
+ when: 'The cursor is malformed, was issued for a different dataset_code, dimension, geo_level or filter, or resumes after a code the list no longer holds.',
193
+ recovery: 'Call again without cursor, keeping dataset_code, dimension, geo_level and filter, then page with the nextCursor that call returns.',
110
194
  },
111
195
  {
112
196
  reason: 'upstream_fault',
113
197
  code: JsonRpcErrorCode.ServiceUnavailable,
114
- when: "Eurostat returned a dataset structure or content constraint this server cannot read: malformed, truncated, not XML, or missing the requested dataset's dataflow.",
198
+ when: "Eurostat returned a dataset structure or content constraint this server cannot read — malformed, truncated, not XML, or missing the requested dataset's dataflow — or the structure endpoint answered HTTP 5xx or could not be reached on every retry, which the error marks retryable.",
115
199
  recovery: 'Retry in a few minutes, since a failed structure read is not cached. If it fails the same way, filter eurostat_query_dataset on the code in question: a code the dataset lacks comes back in unmatchedValues.',
116
200
  },
117
201
  {
@@ -119,10 +203,35 @@ export const eurostatGetDimensionValues = tool('eurostat_get_dimension_values',
119
203
  code: JsonRpcErrorCode.NotFound,
120
204
  when: 'A canvas_id was supplied for staging but is unknown or its lifetime has elapsed.',
121
205
  recovery: 'Pass the canvasId a recent eurostat_download_dataset or eurostat_query_dataset response returned, or omit canvas_id to list the values inline only.',
122
- thrownBy: 'service',
123
206
  },
124
207
  ],
125
208
  async handler(input, ctx) {
209
+ /**
210
+ * Without a dataframe canvas canvas_id is ignored, so it cannot re-stage the
211
+ * list on every page and there is nothing to refuse.
212
+ */
213
+ if (input.cursor && input.canvas_id && getCanvas()) {
214
+ throw ctx.fail('conflicting_params', 'canvas_id stages the whole list, so it belongs on the first call; sent with cursor it would stage the list again for every page.', {
215
+ recovery: {
216
+ hint: 'Drop canvas_id to keep paging with cursor; a first call that carried canvas_id has already staged every value. To stage the list now, call again with canvas_id and without cursor.',
217
+ },
218
+ });
219
+ }
220
+ /**
221
+ * A cursor is checked against everything the input settles before the
222
+ * dimension's values are loaded, so a cursor replayed for another dataset
223
+ * fails without downloading that dataset's structure.
224
+ */
225
+ const tokens = input.filter ? filterTokens(input.filter) : [];
226
+ const filtered = tokens.length > 0;
227
+ const binding = {
228
+ dataset: input.dataset_code.toLowerCase(),
229
+ dimension: input.dimension,
230
+ filter: [...tokens].sort().join(' '),
231
+ };
232
+ const resume = input.cursor ? readCursor(input.cursor, binding, ctx) : undefined;
233
+ if (input.cursor && !resume)
234
+ throw ctx.fail('invalid_cursor', UNUSABLE_CURSOR);
126
235
  const svc = getEurostatDataService();
127
236
  let result;
128
237
  try {
@@ -152,6 +261,14 @@ export const eurostatGetDimensionValues = tool('eurostat_get_dimension_values',
152
261
  },
153
262
  });
154
263
  }
264
+ if (reason === 'upstream_fault' && err.data?.retryable === true) {
265
+ throw ctx.fail('upstream_fault', err.message, {
266
+ retryable: true,
267
+ recovery: {
268
+ hint: `Eurostat's SDMX structure endpoint ${outageAnswer(err.data?.status)} on every attempt, so the "${input.dimension}" values of "${input.dataset_code}" cannot be listed — an upstream outage, not a fault in the request. A failed read is not cached, so retry in a few minutes.`,
269
+ },
270
+ });
271
+ }
155
272
  if (reason === 'upstream_fault') {
156
273
  throw ctx.fail('upstream_fault', err.message, {
157
274
  recovery: {
@@ -170,7 +287,13 @@ export const eurostatGetDimensionValues = tool('eurostat_get_dimension_values',
170
287
  const canvas = input.canvas_id ? getCanvas() : undefined;
171
288
  let staged;
172
289
  if (canvas && result.values.length > 0) {
173
- const instance = await acquireCanvas(canvas, input.canvas_id, ctx);
290
+ // Re-thrown so the declared recovery replaces the canvas service's generic one.
291
+ const instance = await acquireCanvas(canvas, input.canvas_id, ctx).catch((err) => {
292
+ if (isCanvasFailure(err, 'canvas_not_found')) {
293
+ throw ctx.fail('canvas_not_found', err.message, { canvasId: input.canvas_id }, { cause: err });
294
+ }
295
+ throw err;
296
+ });
174
297
  const handle = await instance.registerTable(newTableName(), result.values, {
175
298
  schema: VALUE_TABLE_SCHEMA,
176
299
  signal: ctx.signal,
@@ -181,46 +304,105 @@ export const eurostatGetDimensionValues = tool('eurostat_get_dimension_values',
181
304
  tableName: handle.tableName,
182
305
  };
183
306
  }
184
- const values = result.values.slice(0, INLINE_VALUE_CAP);
185
- if (values.length < result.totalCount) {
186
- const shown = `The first ${values.length.toLocaleString('en-US')} of ${result.totalCount.toLocaleString('en-US')} "${input.dimension}" values of "${input.dataset_code}" are inline, in Eurostat's order.`;
187
- ctx.enrich.truncated({
188
- shown: values.length,
189
- cap: INLINE_VALUE_CAP,
190
- guidance: staged
191
- ? `${shown} All ${staged.stagedRowCount.toLocaleString('en-US')} are staged as table "${staged.tableName}" on canvas "${staged.canvasId}" — search them with eurostat_dataframe_query (e.g. SELECT code, label FROM ${staged.tableName} WHERE label ILIKE '%term%').`
192
- : getCanvas()
193
- ? `${shown} To reach the rest, call again with canvas_id set to the canvasId of a eurostat_query_dataset or eurostat_download_dataset response: all ${result.totalCount.toLocaleString('en-US')} are then staged as a code/label table to search with eurostat_dataframe_query.`
194
- : `${shown} This deployment runs without a dataframe canvas, so the other ${(result.totalCount - values.length).toLocaleString('en-US')} cannot be listed; to check one code, filter eurostat_query_dataset on it — a code the dataset does not have comes back in unmatchedValues.`,
195
- });
307
+ const matched = filtered ? matchValues(result.values, tokens) : result.values;
308
+ const geoLevel = result.geoLevel ?? null;
309
+ /**
310
+ * Where this page starts: after the code the cursor names, wherever that code
311
+ * now sits, so a list that grew between calls still resumes after the right
312
+ * value. The codec's `offset` is recorded but never trusted for position.
313
+ */
314
+ let start = 0;
315
+ let pageLimit = input.limit ?? NO_LIMIT;
316
+ if (resume) {
317
+ if (resume.geoLevel !== geoLevel)
318
+ throw ctx.fail('invalid_cursor', UNUSABLE_CURSOR);
319
+ const anchor = matched.findIndex(({ code }) => code === resume.after);
320
+ if (anchor < 0) {
321
+ throw ctx.fail('invalid_cursor', `Unusable cursor: it resumes after "${resume.after}", which the "${input.dimension}" values of "${input.dataset_code}" no longer list${filtered ? ' under this filter' : ''}.`);
322
+ }
323
+ start = anchor + 1;
324
+ pageLimit = resume.limit;
196
325
  }
326
+ const filterEcho = input.filter?.trim().replace(/\s+/g, ' ');
327
+ const pool = filtered
328
+ ? `${formatCount(matched.length)} values matching filter "${filterEcho}"`
329
+ : `${formatCount(matched.length)} "${input.dimension}" values`;
330
+ const canvasRoute = staged
331
+ ? ` Every one of the ${formatCount(staged.stagedRowCount)} values is staged as table "${staged.tableName}" on canvas "${staged.canvasId}" — search it with eurostat_dataframe_query (e.g. SELECT code, label FROM ${staged.tableName} WHERE label ILIKE '%term%').`
332
+ : getCanvas()
333
+ ? ` Or, on a call without cursor, pass canvas_id — the canvasId of a eurostat_query_dataset or eurostat_download_dataset response — to stage all ${formatCount(result.totalCount)} as a code/label table to search with eurostat_dataframe_query.`
334
+ : '';
335
+ const page = (k) => {
336
+ const values = matched.slice(start, start + k);
337
+ const output = {
338
+ ...result,
339
+ values,
340
+ ...(filtered && { matchCount: matched.length }),
341
+ ...staged,
342
+ };
343
+ if (start + k < matched.length) {
344
+ const endedBy = k === pageLimit
345
+ ? `limit ${formatCount(pageLimit)}`
346
+ : `the ${formatCount(INLINE_BUDGET_BYTES)}-byte response budget`;
347
+ return {
348
+ output,
349
+ enrichment: {
350
+ truncated: true,
351
+ nextCursor: encodeCursor({
352
+ offset: start + k,
353
+ limit: pageLimit,
354
+ after: values[k - 1]?.code,
355
+ ...binding,
356
+ geoLevel,
357
+ }),
358
+ notice: `Values ${formatCount(start + 1)}–${formatCount(start + k)} of ${pool}, in Eurostat's order; ${endedBy} ended this page. Pass nextCursor as cursor for the next page, or ${filtered ? 'add words to filter' : 'pass filter (words of the code or label)'} to narrow the list.${canvasRoute}`,
359
+ },
360
+ };
361
+ }
362
+ // An empty page needs saying only when a cursor or filter emptied it.
363
+ if (values.length > 0 || !(input.cursor || filtered))
364
+ return { output, enrichment: {} };
365
+ return {
366
+ output,
367
+ enrichment: {
368
+ notice: input.cursor
369
+ ? `No "${input.dimension}" values of "${input.dataset_code}" follow the code this cursor resumes after: the list ends there.`
370
+ : `No "${input.dimension}" value${result.geoLevel ? ` at geo_level "${result.geoLevel}"` : ''} of "${input.dataset_code}" matched filter "${filterEcho}": every word must appear in a value's code or label, in any order, ignoring case and accents. Drop or shorten a word, or ${staged
371
+ ? `search all ${formatCount(staged.stagedRowCount)} values, staged as table "${staged.tableName}" on canvas "${staged.canvasId}", with eurostat_dataframe_query (e.g. SELECT code, label FROM ${staged.tableName} WHERE label ILIKE '%term%').`
372
+ : `call without filter to page through all ${formatCount(result.totalCount)}.`}`,
373
+ },
374
+ };
375
+ };
376
+ const measure = (k) => {
377
+ const { output, enrichment } = page(k);
378
+ return {
379
+ structured: utf8Bytes(JSON.stringify({ ...output, ...enrichment })),
380
+ text: utf8Bytes(renderText(output) + renderTrailer(enrichment)),
381
+ };
382
+ };
383
+ const costOf = (index) => {
384
+ const value = matched[start + index];
385
+ return {
386
+ structured: utf8Bytes(JSON.stringify(value)) + 1,
387
+ text: utf8Bytes(`- \`${value.code}\` — ${value.label}`) + 1,
388
+ };
389
+ };
390
+ const { output, enrichment } = page(fitPage(Math.min(pageLimit, matched.length - start), measure, costOf));
391
+ const { notice, ...fields } = enrichment;
392
+ ctx.enrich(fields);
393
+ if (notice)
394
+ ctx.enrich.notice(notice);
197
395
  ctx.log.info('Dimension values fetched', {
198
396
  datasetCode: input.dataset_code,
199
397
  dimension: input.dimension,
200
398
  totalCount: result.totalCount,
201
- shown: values.length,
399
+ ...(filtered && { matchCount: matched.length }),
400
+ shown: output.values.length,
401
+ hasMore: enrichment.truncated === true,
202
402
  ...(staged && { canvasId: staged.canvasId, tableName: staged.tableName }),
203
403
  });
204
- return { ...result, values, ...staged };
205
- },
206
- format: (result) => {
207
- const lines = [
208
- `**Dimension:** ${result.dimensionLabel} (\`${result.dimensionCode}\`)`,
209
- ...(result.geoLevel ? [`**Geo level:** \`${result.geoLevel}\``] : []),
210
- `**Total values:** ${result.totalCount}${result.values.length < result.totalCount
211
- ? ` — the first ${result.values.length} are listed below`
212
- : ''}`,
213
- ...(result.tableName
214
- ? [
215
- `**Staged:** table \`${result.tableName}\` on canvas \`${result.canvasId}\` (stagedRowCount ${result.stagedRowCount}), columns code and label — inspect it with eurostat_dataframe_describe first, then join it in eurostat_dataframe_query`,
216
- ]
217
- : []),
218
- '',
219
- ];
220
- for (const v of result.values) {
221
- lines.push(`- \`${v.code}\` — ${v.label}`);
222
- }
223
- return [{ type: 'text', text: lines.join('\n') }];
404
+ return output;
224
405
  },
406
+ format: (result) => [{ type: 'text', text: renderText(result) }],
225
407
  });
226
408
  //# sourceMappingURL=eurostat-get-dimension-values.tool.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"eurostat-get-dimension-values.tool.js","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/eurostat-get-dimension-values.tool.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,cAAc,EAAqB,MAAM,+BAA+B,CAAC;AAClF,OAAO,EAAE,gBAAgB,EAAiB,MAAM,+BAA+B,CAAC;AAChF,OAAO,EAAE,aAAa,E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AE;SACH,CAAC;QACF,KAAK,MAAM,CAAC,IAAI,MAAM,CAAC,MAAM,EAAE,CAAC;YAC9B,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,IAAI,QAAQ,CAAC,CAAC,KAAK,EAAE,CAAC,CAAC;QAC7C,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"}
1
+ {"version":3,"file":"eurostat-get-dimension-values.tool.js","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/eurostat-get-dimension-values.tool.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAgB,IAAI,EAAE,CAAC,EAAE,MAAM,wBAAwB,CAAC;AAC/D,OAAO,EAAE,cAAc,EAAqB,MAAM,+BAA+B,CAAC;AAClF,OAAO,EAAE,gBAAgB,EAAiB,MAAM,+BAA+B,CAAC;AAChF,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAC1E,OAAO,EACL,YAAY,EACZ,OAAO,EACP,mBAAmB,EACnB,WAAW,EACX,SAAS,GACV,MAAM,yCAAyC,CAAC;AACjD,OAAO,EACL,aAAa,EACb,SAAS,EACT,eAAe,EACf,YAAY,GACb,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAE,sBAAsB,EAAE,MAAM,mDAAmD,CAAC;AAC3F,OAAO,EAAE,gBAAgB,EAAE,MAAM,mCAAmC,CAAC;AACrE,OAAO,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAE7D;;;;GAIG;AACH,MAAM,kBAAkB,GAAmB;IACzC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,SAAS,EAAE,QAAQ,EAAE,KAAK,EAAE;IAClD,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,QAAQ,EAAE,KA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G,CAAC,QAAQ,IAAI,EAAE,UAAU,EAAE,OAAO,CAAC,MAAM,EAAE,CAAC;YAC/C,KAAK,EAAE,MAAM,CAAC,MAAM,CAAC,MAAM;YAC3B,OAAO,EAAE,UAAU,CAAC,SAAS,KAAK,IAAI;YACtC,GAAG,CAAC,MAAM,IAAI,EAAE,QAAQ,EAAE,MAAM,CAAC,QAAQ,EAAE,SAAS,EAAE,MAAM,CAAC,SAAS,EAAE,CAAC;SAC1E,CAAC,CAAC;QACH,OAAO,MAAM,CAAC;IAChB,CAAC;IAED,MAAM,EAAE,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,UAAU,CAAC,MAAM,CAAC,EAAE,CAAC;CACjE,CAAC,CAAC"}
@@ -76,19 +76,23 @@ export declare const eurostatQueryDataset: import("@cyanheads/mcp-ts-core").Tool
76
76
  }, {
77
77
  readonly reason: "invalid_dimension";
78
78
  readonly code: JsonRpcErrorCode.ValidationError;
79
- readonly when: "A dimension code in filters does not exist in this dataset (HTTP 400, Eurostat error id 150).";
80
- readonly recovery: "Use eurostat_get_dataset_info to see valid dimension codes for this dataset.";
79
+ readonly when: "A dimension code in filters does not exist in this dataset (HTTP 400, Eurostat error id 150), or a filter key names a request control (lang, format, geoLevel, sinceTimePeriod, untilTimePeriod, lastTimePeriod, in any case) rather than a dimension — rejected before any request, naming the input that sets it.";
80
+ readonly recovery: "Use eurostat_get_dataset_info to see valid dimension codes for this dataset; set a control through its own input (lang, geo_level, since_period, until_period, last_n_periods), not filters.";
81
81
  }, {
82
82
  readonly reason: "conflicting_params";
83
83
  readonly code: JsonRpcErrorCode.ValidationError;
84
- readonly when: "Mutually exclusive parameters were combined: \"geo\" filter + geo_level, or since_period/until_period + last_n_periods.";
85
- readonly recovery: "Use \"geo\" or geo_level (not both); use since_period/until_period or last_n_periods (not both).";
84
+ readonly when: "Mutually exclusive parameters were combined: \"geo\" filter + geo_level, since_period/until_period + last_n_periods, or a \"time\"/\"time_period\" filter + since_period, until_period or last_n_periods. Checked before any request; Eurostat's own refusal of two time selections maps here too.";
85
+ readonly recovery: "Keep one of each pair: filters.geo or geo_level; since_period/until_period or last_n_periods; filters.time or a period input.";
86
86
  }, {
87
87
  readonly reason: "canvas_not_found";
88
88
  readonly code: JsonRpcErrorCode.NotFound;
89
89
  readonly when: "A canvas_id was supplied for staging but is unknown or its lifetime has elapsed.";
90
90
  readonly recovery: "Omit canvas_id so the response starts a fresh canvas and returns its canvasId.";
91
- readonly thrownBy: "service";
91
+ }, {
92
+ readonly reason: "upstream_fault";
93
+ readonly code: JsonRpcErrorCode.ServiceUnavailable;
94
+ readonly when: "The Statistics API answered HTTP 5xx or could not be reached on every attempt of the retry loop. The error is marked retryable, except for HTTP 501, which is marked not retryable.";
95
+ readonly recovery: "The failure is on Eurostat's side, not in the request: when the error is marked retryable, call again in a few minutes.";
92
96
  }], {
93
97
  readonly appliedFilters: z.ZodObject<{
94
98
  filters: z.ZodRecord<z.ZodString, z.ZodArray<z.ZodString>>;
@@ -1 +1 @@
1
- {"version":3,"file":"eurostat-query-dataset.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/eurostat-query-dataset.tool.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;AAEjD,OAAO,EAAE,gBAAgB,EAAiB,MAAM,+BAA+B,CAAC;AA0BhF,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAue/B,CAAC"}
1
+ {"version":3,"file":"eurostat-query-dataset.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/eurostat-query-dataset.tool.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;AAEjD,OAAO,EAAE,gBAAgB,EAAiB,MAAM,+BAA+B,CAAC;AAiChF,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA0gB/B,CAAC"}