Skip to main content
Glama

Oecd Query Dataset

oecd_query_dataset
Read-onlyIdempotent

Fetch observations from an OECD dataflow filtered by a dimension key and optional time range. Returns decoded rows (one per observation) with dimension and attribute labels, and values already scaled by the observation unit multiplier. Large multi-country time-series spill to a DataCanvas table — inspect columns with oecd_dataframe_describe, then query the full table with SQL using oecd_dataframe_query; without DataCanvas every row still comes back, but the rendered table stops at a preview slice. Call oecd_get_dataset_info first to learn the dimension order for constructing the key.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "flow_ref": "<flow_ref>",
      "key": "<key>"
    },
    "name": "oecd_query_dataset"
  }
}

Input Schema

NameRequiredDescriptionDefault
keyYesDot-delimited dimension key matching the dimension order from oecd_get_dataset_info. Empty segments are wildcards; "+" separates multiple values per segment. Example: "A.USA+DEU.B1GQ.." — Annual, USA or Germany, GDP, all remaining dimensions.
flow_refYesFull flow reference — e.g. "OECD.SDD.NAD,DSD_NAAG@DF_NAAG_I", or the bare "OECD.TAD.ARP,DF_AEI2024_DASHBOARD" form for a dataflow published without a datastructure prefix. Obtain from oecd_search_datasets and pass it through unchanged.
canvas_idNoCanvas ID from a prior oecd_query_dataset call — exactly 10 characters of letters, digits, hyphens, and underscores — to stage this result alongside that one if it spills; a result that fits inline comes back inline and leaves that canvas unchanged. Omit to let the server mint a canvas if this result needs one; a canvas_id comes back only when the result was large enough to spill.
end_periodNoEnd of the time range — ISO period code such as "2023" or "2023-Q4". Omit to include up to the latest available period.
start_periodNoStart of the time range — ISO period code such as "2010", "2010-Q1", or "2010-01". Omit to include all history (may produce very large results).

Output Schema

NameRequiredDescriptionDefault
rowsNoObservation rows. Every row of the result when truncated is absent; the leading preview slice when truncated is true — query the canvas table for the rest.
errorNoPresent when the call failed. Absent on success.
noticeNoHow to inspect and query the staged result, including its canvas_id and table name; present only after a spill.
sourceNoData source attribution — always "OECD".
canvas_idNoCanvas handle for the staged result. Present only when DataCanvas is configured and the result exceeded the inline budget; absent when DataCanvas is off, and absent when it is on but the result fit inline. Pass to oecd_dataframe_query or oecd_dataframe_describe.
query_keyNoDimension key used in this query.
row_countNoTotal rows in the result (or on the canvas when truncated).
truncatedNoTrue when rows is a preview slice and the full result was staged on DataCanvas; omitted entirely (never false) when rows holds the complete result. Use oecd_dataframe_query with the canvas_id for analytics over the full set. A complete rows never means a complete rendered table — content_table_capped reports that separately.
table_nameNoCanvas table name holding the full result — present when canvas_id is set. Inspect columns with oecd_dataframe_describe, then query this table with SQL using oecd_dataframe_query.
query_flow_refNoFlow reference used in this query.
query_end_periodNoEnd period filter applied in this query, if any.
content_table_rowsNoRows the rendered table shows when content_table_capped is true.
query_start_periodNoStart period filter applied in this query, if any.
content_table_cappedNoTrue when the rendered table shows only the leading rows of the result. Distinct from truncated: nothing was staged anywhere, and structuredContent.rows still holds every row. To shrink the result itself, name fewer values per key segment or set a narrower start_period / end_period; to reach the full set as a queryable table instead, run with CANVAS_PROVIDER_TYPE=duckdb and follow up with oecd_dataframe_query.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changed
    • changedOutput schema / properties / error / properties / data / properties / reason / description
      Previous value: -"Machine-readable failure mode. Declared by this tool: `invalid_flow_ref`: The flow_ref parameter matches neither the {agencyID},{dsd_id}@{df_id} nor the {agencyID},{df_id} format. `dataflow_not_found`: The flow_ref does not correspond to a known OECD dataflow. `no_results`: The dataflow exists but no observations matched the key and time range. `invalid_key`: OECD rejected the dimension key — wrong number of segments, or an unsupported format. `invalid_period`: OECD could not parse start_period or end_period. `rate_limited`: OECD throttled the request rate and was still refusing after the retries. `download_limit`: OECD refused the query for exceeding its data-download or data-range limit. `upstream_timeout`: OECD did not finish responding before OECD_TIMEOUT_MS elapsed. `upstream_unavailable`: OECD returned a server fault or was unreachable once the retries ran out. `upstream_redirect`: The configured OECD host answered with a redirect, which this server never follows. `upstream_error`: OECD refused the request with a status this server does not model — an authorization challenge, a rejection from something sitting in front of the API, or a request read as malformed. Other values are possible when a failure originates below the handler."New value: +"Machine-readable failure mode. Declared by this tool: `invalid_flow_ref`: The flow_ref parameter matches neither the {agencyID},{dsd_id}@{df_id} nor the {agencyID},{df_id} format. `dataflow_not_found`: The flow_ref does not correspond to a known OECD dataflow. `no_results`: The dataflow exists but no observations matched the key and time range. `invalid_key`: OECD rejected the dimension key — wrong number of segments, or an unsupported format. `invalid_period`: OECD could not parse start_period or end_period. `rate_limited`: OECD throttled the request rate and was still refusing after the retries. `download_limit`: OECD refused the query for exceeding its data-download or data-range limit. `canvas_not_found`: The canvas_id has expired or was never created. It is checked before anything is fetched from OECD. `upstream_timeout`: OECD did not finish responding before OECD_TIMEOUT_MS elapsed. `upstream_unavailable`: OECD returned a server fault or was unreachable once the retries ran out. `upstream_redirect`: The configured OECD host answered with a redirect, which this server never follows. `upstream_error`: OECD refused the request with a status this server does not model — an authorization challenge, a rejection from something sitting in front of the API, or a request read as malformed. Other values are possible when a failure originates below the handler."
    • changedOutput schema / properties / error / properties / data / properties / reason / examples
      Previous value: -[
      -  "invalid_flow_ref",
      -  "dataflow_not_found",
      -  "no_results",
      -  "invalid_key",
      -  "invalid_period",
      -  "rate_limited",
      -  "download_limit",
      -  "upstream_timeout",
      -  "upstream_unavailable",
      -  "upstream_redirect",
      -  "upstream_error"
      -]New value: +[
      +  "invalid_flow_ref",
      +  "dataflow_not_found",
      +  "no_results",
      +  "invalid_key",
      +  "invalid_period",
      +  "rate_limited",
      +  "download_limit",
      +  "canvas_not_found",
      +  "upstream_timeout",
      +  "upstream_unavailable",
      +  "upstream_redirect",
      +  "upstream_error"
      +]
  2. Changed1 schema field changed
    • changedInput schema / properties / canvas_id / description
      Previous value: -"Canvas ID from a prior oecd_query_dataset call — exactly 10 characters of letters, digits, hyphens, and underscores — to stage this result alongside that one. Omit to let the server mint a canvas if this result needs one; a canvas_id comes back only when the result was large enough to spill, never on a result that fits inline."New value: +"Canvas ID from a prior oecd_query_dataset call — exactly 10 characters of letters, digits, hyphens, and underscores — to stage this result alongside that one if it spills; a result that fits inline comes back inline and leaves that canvas unchanged. Omit to let the server mint a canvas if this result needs one; a canvas_id comes back only when the result was large enough to spill."
  3. Changed2 schema fields changed
    • addedOutput schema / properties / notice
      Added value: +{
      +  "description": "How to inspect and query the staged result, including its canvas_id and table name; present only after a spill.",
      +  "type": "string"
      +}
    • changedOutput schema / properties / table_name / description
      Previous value: -"Canvas table name holding the full result — present when canvas_id is set."New value: +"Canvas table name holding the full result — present when canvas_id is set. Inspect columns with oecd_dataframe_describe, then query this table with SQL using oecd_dataframe_query."
  4. Changed2 schema fields changed
    • changedInput schema / properties / canvas_id / description
      Previous value: -"Canvas ID from a prior oecd_query_dataset call, to stage this result alongside that one. Omit to let the server mint a canvas if this result needs one — a canvas_id comes back only when the result was large enough to spill, never on a result that fits inline."New value: +"Canvas ID from a prior oecd_query_dataset call — exactly 10 characters of letters, digits, hyphens, and underscores — to stage this result alongside that one. Omit to let the server mint a canvas if this result needs one; a canvas_id comes back only when the result was large enough to spill, never on a result that fits inline."
    • addedInput schema / properties / canvas_id / pattern
      Added value: +"^[A-Za-z0-9_-]{10}$"
  5. First observed

TDQS

A4.4/5.0
Behavior3/5

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

Annotations already establish readOnly, idempotent, and openWorld, so the safety profile is covered. The description adds genuinely useful behavior: values are pre-scaled by the unit multiplier, large results spill to a DataCanvas table, and inline results are truncated to a preview slice without DataCanvas. However, the canvas_id reuse/staging semantics are largely restated from the schema rather than expanded, and no rate limits or error behavior are mentioned.

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?

Front-loaded with the core action, then progressive detail on output shape and the dependent-tool chain. Every sentence carries operational information — spill handling, scaling, and prerequisite lookup — with no filler.

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

Completeness4/5

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

For a 5-parameter tool with an output schema, the description covers the non-obvious paths: prerequisite lookup for key order, spill/describe/query workflow, and preview truncation. It is nearly complete, though it lacks guidance on error cases such as an invalid key or flow reference.

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?

Schema coverage is 100%, so the baseline is 3; the description goes slightly beyond by framing key construction as dependent on dimension order from oecd_get_dataset_info and time range as optional. It does not add syntax or format detail for start_period/end_period that the schema lacks, so it stays close to baseline.

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 description names a specific verb ('Fetch observations') and resource ('OECD dataflow'), plus the filtering mechanism (dimension key + optional time range). It is clearly distinct from siblings like oecd_search_datasets and oecd_get_dataset_info, which are referenced as upstream steps rather than substitutes.

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?

It gives explicit workflow ordering: call oecd_get_dataset_info first for dimension order, then this tool, then oecd_dataframe_describe/oecd_dataframe_query for spilled results. It also notes the fallback behavior when DataCanvas is unavailable, covering the when-and-how of use rather than leaving it to inference.

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.