Skip to main content
Glama

Fetch bounded rows for a dataflow

fetch
Read-onlyIdempotent

Return bounded rows for a dataflow — the completion path for hosted clients.

Use this when the client cannot execute a client-download plan locally (no shell/filesystem — e.g. a hosted store app or connector) but still needs actual values. fetch server-side downloads the exact GET/fan-out plan build_url would produce, concatenates it, runs one bounded literal-equality query, and releases the artifact — the raw dataset never enters model context. Clients that CAN execute locally should keep using ask/build_url and run the plan themselves; fetch is the affinity-free hosted shortcut, not the power path.

POST-only selections have no hosted download path: fetch raises fetch_shape_unsupported and the caller must execute the build_url plan client-side. A rejected/over-length selection raises the same reason build_url would report; narrow the selection and retry.

fetch does not page, deliberately. It holds no dataset between calls: every call rebuilds the plan, re-downloads every part from the provider, and releases the artifact. An offset over that would be unsound as well as wasteful — there is no snapshot behind the cursor, so rows shifting upstream between calls would silently skip or duplicate observations, and N pages would mean N full downloads of the same dataflow from an agency that may rate-limit. When a result is truncated, narrow it (select, where, time_range) or switch to stage_url + query_dataset, which pages with offset over ONE immutable staged artifact and downloads once.

Rows are ordered by series key, then period, before limit applies. A series with a period that cannot be placed unambiguously keeps the provider's order.

no_records_for_selection is TERMINAL, not a fault: the request was well-formed and the source holds no observations for it. Widen the selection or state that no data exists — do not retry the same selection. Only upstream_origin_error (an origin fault) and upstream_rate_limited are worth retrying.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitNoOptional max rows to return (a safe default applies when omitted)
whereNoOptional {column: value | [values]} literal-equality row filters
selectNoOptional list of columns to return (defaults to all columns)
agency_idYesSDMX agency code, e.g. "ABS", "ESTAT", "OECD"
max_bytesNoOptional smaller byte budget for this response; it can only lower the server ceiling, never raise it
precisionNoURL breadth — "point", "series" (default), or "cube"series
selectionsNoOptional {dimension_id: [code or name, ...]} to anchor the query
time_rangeNoOptional time filter (e.g. "2020-2024", "since 2015", "2024")
dataflow_idYesSDMX dataflow identifier, e.g. "ERP_Q"
availabilityNo"confirmed" (default) or "best_effort"confirmed
response_formatNoHow the rows are sent. "auto" (default) means no preference and lets the server decide; "text" sends them as CSV only — in the text content, and in structuredContent as a "csv" string in place of typed rows. "structured" sends typed rows only, "both" the CSV and the typed rows. If you got a summary but no rows, call again with response_format="text".auto

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
csvNo
rowsNo
columnsNo
agency_idYes
truncatedYes
dataflow_idYes
limit_sourceYes
matched_rowsYes
applied_limitYes
returned_rowsYes
period_calendarYes
max_bytes_ceilingNo
min_bytes_requiredNo
source_request_countYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changed
    • addedOutput schema / properties / period_calendar
      Added value: +{
      +  "enum": [
      +    "gregorian",
      +    "buddhist"
      +  ],
      +  "type": "string"
      +}
    • changedOutput schema / required
      Previous value: -[
      -  "agency_id",
      -  "dataflow_id",
      -  "source_request_count",
      -  "matched_rows",
      -  "returned_rows",
      -  "truncated",
      -  "applied_limit",
      -  "limit_source"
      -]New value: +[
      +  "agency_id",
      +  "dataflow_id",
      +  "source_request_count",
      +  "period_calendar",
      +  "matched_rows",
      +  "returned_rows",
      +  "truncated",
      +  "applied_limit",
      +  "limit_source"
      +]
  2. Changed2 schema fields changed
    • changedInput schema / properties / response_format / description
      Previous value: -"Which channel carries the rows. \"auto\" (default) means\nno preference and lets the server decide; \"text\" sends them as CSV\nin the text channel only, \"structured\" as typed rows only, \"both\"\nin both. If you got a summary but no rows, call again with\nresponse_format=\"text\"."New value: +"How the rows are sent. \"auto\" (default) means no\npreference and lets the server decide; \"text\" sends them as CSV\nonly — in the text content, and in structuredContent as a \"csv\"\nstring in place of typed rows. \"structured\" sends typed rows only,\n\"both\" the CSV and the typed rows. If you got a summary but no\nrows, call again with response_format=\"text\"."
    • addedOutput schema / properties / csv
      Added value: +{
      +  "type": "string"
      +}
  3. Changed11 schema fields changed
    • addedInput schema / properties / agency_id / description
      Added value: +"SDMX agency code, e.g. \"ABS\", \"ESTAT\", \"OECD\""
    • addedInput schema / properties / availability / description
      Added value: +"\"confirmed\" (default) or \"best_effort\""
    • addedInput schema / properties / dataflow_id / description
      Added value: +"SDMX dataflow identifier, e.g. \"ERP_Q\""
    • addedInput schema / properties / limit / description
      Added value: +"Optional max rows to return (a safe default applies when omitted)"
    • addedInput schema / properties / max_bytes / description
      Added value: +"Optional smaller byte budget for this response; it can only\nlower the server ceiling, never raise it"
    • addedInput schema / properties / precision / description
      Added value: +"URL breadth — \"point\", \"series\" (default), or \"cube\""
    • addedInput schema / properties / response_format / description
      Added value: +"Which channel carries the rows. \"auto\" (default) means\nno preference and lets the server decide; \"text\" sends them as CSV\nin the text channel only, \"structured\" as typed rows only, \"both\"\nin both. If you got a summary but no rows, call again with\nresponse_format=\"text\"."
    • addedInput schema / properties / select / description
      Added value: +"Optional list of columns to return (defaults to all columns)"
    • addedInput schema / properties / selections / description
      Added value: +"Optional {dimension_id: [code or name, ...]} to anchor the query"
    • addedInput schema / properties / time_range / description
      Added value: +"Optional time filter (e.g. \"2020-2024\", \"since 2015\", \"2024\")"
    • addedInput schema / properties / where / description
      Added value: +"Optional {column: value | [values]} literal-equality row filters"
  4. First observed

TDQS

A4.6/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already declare readOnlyHint, idempotentHint, and openWorldHint, but the description adds substantial non-obvious behavior: it rejects POST-only selections with fetch_shape_unsupported, deliberately does not page (rebuilding and re-downloading on every call), never surfaces the raw dataset into model context, and classifies which error reasons are terminal vs retryable. The only gap is it doesn't describe the shape of the returned rows, though an output schema exists.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Front-loaded with the core purpose, then layered detail in tight paragraphs. It is long, but nearly every sentence carries actionable information (error taxonomy, paging rationale, ordering). The paging rationale paragraph is slightly verbose but justified given the tempting-but-unsound pagination alternative.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For an 11-parameter, open-world, network-facing tool with an output schema and rich annotations, the description covers the critical gaps: error classification (terminal vs retryable), no-paging contract, ordering, and artifact lifecycle. Nothing an agent needs to call it correctly is missing.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The schema already documents all 11 parameters at 100% coverage, so baseline is 3. The description adds genuine meaning beyond the schema by explaining that narrowing happens via select/where/time_range and that rows are ordered by series key then period before limit applies — semantics the schema does not convey.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb and resource ('Return bounded rows for a dataflow') and immediately frames its role as 'the completion path for hosted clients.' This distinguishes it from ask and build_url, which the description names as the local-execution alternatives.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Explicitly states when to use it (client cannot execute a client-download plan locally — no shell/filesystem), when not to (clients that CAN execute locally should keep using ask/build_url), and names the alternative path for paging (stage_url + query_dataset). This is the strongest form of routing guidance.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources