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.

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.

Args: agency_id: SDMX agency code, e.g. "ABS", "ESTAT", "OECD" dataflow_id: SDMX dataflow identifier, e.g. "ERP_Q" selections: Optional {dimension_id: [code or name, ...]} to anchor the query time_range: Optional time filter (e.g. "2020-2024", "since 2015", "2024") precision: URL breadth — "point", "series" (default), or "cube" availability: "confirmed" (default) or "best_effort" select: Optional list of columns to return (defaults to all columns) where: Optional {column: value | [values]} literal-equality row filters limit: Optional max rows to return (a safe default applies when omitted) max_bytes: Optional smaller byte budget for this response; it can only lower the server ceiling, never raise it response_format: Which channel carries the rows. "auto" (default) means no preference and lets the server decide; "text" sends them as CSV in the text channel only, "structured" as typed rows only, "both" in both. If you got a summary but no rows, call again with response_format="text".

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitNo
whereNo
selectNo
agency_idYes
max_bytesNo
precisionNoseries
selectionsNo
time_rangeNo
dataflow_idYes
availabilityNoconfirmed
response_formatNoauto

Output Schema

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

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A5/5.0
Behavior5/5

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

Annotations already declare readOnlyHint, idempotentHint, and openWorldHint; the description adds substantial behavior beyond those: server-side download/concatenation, one bounded literal-equality query, artifact release, no pagination because there is no snapshot, terminal 'no_records_for_selection' semantics, and which errors are retryable. There is no contradiction with the annotations.

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

Conciseness5/5

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

The description is long but tightly structured: a scoped opening, bolded warnings for key behavioral facts, and an Args block mapping cleanly to the schema. Each paragraph adds distinct operational guidance—use case, non-paging behavior, error handling, parameter meanings—without redundant filler.

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?

Given an 11-parameter surface and an output schema, the description covers use cases, failure modes, retry policy, pagination behavior, and routing to alternatives. Nothing an agent needs to invoke this tool correctly is missing.

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

Parameters5/5

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

Schema description coverage is 0%, so the description must carry the full parameter burden, and it does. The Args block explains all 11 parameters with examples, defaults, and constraints such as 'max_bytes can only lower the server ceiling', 'where' being literal-equality filters, and the response_format channel behavior. This fully compensates for the sparse schema.

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?

The opening sentence states a specific verb and resource ('Return bounded rows for a dataflow') and immediately positions it as the completion path for hosted clients. It then contrasts this tool with 'ask'/'build_url' and names the 'stage_url' + 'query_dataset' paging path, so an agent can distinguish it from siblings without inspecting schemas.

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 says use this when the client cannot execute a client-download plan locally, and that clients that CAN execute locally should keep using 'ask'/'build_url'. It also gives concrete alternatives for POST-only selections and for paging ('stage_url' + 'query_dataset'), making the when-to-use and when-not-to-use boundaries unambiguous.

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