Skip to main content
Glama

Imf Dataframe Query

imf_dataframe_query
Read-onlyIdempotent

Run a read-only SQL SELECT against a DataCanvas table staged by imf_query_dataset. Supports multi-country comparisons, time-series aggregation, and cross-indicator joins. Requires imf_dataframe_describe first to discover table and column names. One SELECT statement per call; a leading WITH … SELECT (CTE) is accepted. DML and DDL are rejected.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sqlYesRead-only SQL SELECT statement — exactly one statement, starting with SELECT or with a WITH … SELECT common table expression. Reference tables by the names returned by imf_dataframe_describe. Example: SELECT time_period, value FROM spilled_abc123 WHERE time_period >= '2010' ORDER BY time_period.
canvas_idYesCanvas ID returned by imf_query_dataset whenever staged=true. Call imf_dataframe_describe with it before writing SQL.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
rowsNoLargest result-row prefix whose complete structured and formatted response fits the 100,000-character response budget, after the canvas row limit (default 10,000) is applied.
errorNoPresent when the call failed. Absent on success.
row_countNoNumber of materialized rows returned in rows. Always equals rows.length and never claims a pre-cap total.
truncatedNoTrue when DataCanvas capped the query at its row limit or the server omitted materialized rows to fit the response-size budget. Page the remainder with a stable ORDER BY plus LIMIT/OFFSET, or narrow the query with WHERE or aggregation.

TDQS

A4.3/5.0
Behavior4/5

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

Annotations already indicate read-only and idempotent behavior. The description adds valuable constraints beyond annotations: one statement per call, CTE acceptance, rejection of DML/DDL, and the prerequisite to call imf_dataframe_describe first. There is no contradiction with 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?

Four sentences, each carrying distinct information: operation scope, supported analysis types, prerequisite, and statement constraints. The most important behavioral rule (read-only SELECT) is front-loaded, with no 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?

The description covers the prerequisite workflow, call constraints, accepted SQL shapes, and rejected statement types. With a provided output schema and read-only/idempotent annotations, an agent has enough context to invoke this tool correctly.

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

Parameters3/5

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

Schema description coverage is 100%, and the schema already provides detailed parameter semantics for both sql and canvas_id. The description reinforces the prerequisite relationship but does not add much parameter meaning beyond what the schema already supplies, so baseline 3 is appropriate.

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 states a specific verb ('Run'), resource ('a DataCanvas table staged by imf_query_dataset'), and operation type ('read-only SQL SELECT'). It distinguishes itself from siblings by positioning itself as the query layer over staged tables, while imf_dataframe_describe handles discovery.

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

Usage Guidelines4/5

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

The description gives explicit usage context: it must follow imf_dataframe_describe, applies to staged tables, and accepts one SELECT or WITH...SELECT. It doesn't explicitly contrast with sibling query tools like imf_get_database or imf_query_dataset, but the staged-table prerequisite makes the intended workflow clear.

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.

TDQS

A4.6/5.0
Disambiguation5/5

Each tool has a clearly distinct role: discovering dataflows, inspecting dimensions/codelists, querying SDMX data, and analyzing staged DataCanvas tables. The two query-like tools are separated by their data source (live SDMX vs. staged results), and the descriptions reinforce the required sequencing.

Naming Consistency4/5

The imf_ prefix and snake_case convention are consistent, and most tools follow verb_noun naming (list_databases, get_database, query_dataset). However, imf_dataframe_describe and imf_dataframe_query place the object before the verb, deviating slightly from the otherwise predictable pattern.

Tool Count5/5

Five tools is well-scoped for a read-only IMF data access server. Each tool covers a necessary stage in the workflow without redundancy or bloat.

Completeness5/5

The tool set covers the full read-only lifecycle: discover dataflows, inspect required dimension codes, query series, and analyze large result sets via SQL. No obvious gaps exist for the stated purpose, and write operations are not relevant to this domain.