Skip to main content
Glama

exchange-rates-mcp-server

Fx Dataframe Query

fx_dataframe_query
Read-onlyIdempotent

Run a read-only SQL SELECT against DataCanvas tables staged by fx_get_timeseries. Supports aggregations, GROUP BY, window functions, and JOINs across multiple registered tables. Run fx_dataframe_describe first to discover table names and column schemas. Requires DataCanvas, which is on by default — a deployment that turns it off does not list this tool at all, and fx_get_timeseries returns every range inline there.

Input Schema

NameRequiredDescriptionDefault
queryYesRead-only SQL SELECT statement. Reference tables by the names returned by fx_dataframe_describe or the table_name field from fx_get_timeseries. Example: SELECT date, rate FROM <table_name> WHERE date > '2024-01-01' ORDER BY date; replace <table_name> with the returned name, including its unique suffix.
canvas_idYesCanvas ID returned by fx_get_timeseries. Re-run fx_get_timeseries to obtain a fresh canvas_id if this one has expired.
row_limitNoMost rows to return (positive integer, default 150; values above 10000 clamp to 10000 with a notice). When the query produces more, truncated is true — page with ORDER BY <column> LIMIT <n> OFFSET <m> in the SQL, or aggregate, rather than raising this toward the maximum.

Output Schema

NameRequiredDescriptionDefault
rowsNoResult rows, at most row_limit (default 150). Each key is a column name from the query.
errorNoPresent when the call failed. Absent on success.
noticeNoReports requested and effective row limits when clamped, and the ORDER BY … LIMIT … OFFSET query shape when the result is truncated.
canvas_idNoThe canvas ID used — pass to a subsequent fx_dataframe_query or fx_dataframe_describe call.
row_countNoRows returned — always the length of rows. When truncated is true this equals row_limit, not the full result size.
truncatedNoTrue when the query produced more rows than row_limit and rows holds only the first row_limit of them. Fetch the rest with ORDER BY <column> LIMIT <n> OFFSET <m> — ORDER BY is required for deterministic paging — or aggregate to shrink the result.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed4 schema fields changed
    • changedInput schema / properties / query / description
      Previous value: -"Read-only SQL SELECT statement. Reference tables by the names returned by fx_dataframe_describe or the table_name field from fx_get_timeseries. Example: SELECT date, rate FROM fx_usd_eur WHERE date > '2024-01-01' ORDER BY date"New value: +"Read-only SQL SELECT statement. Reference tables by the names returned by fx_dataframe_describe or the table_name field from fx_get_timeseries. Example: SELECT date, rate FROM <table_name> WHERE date > '2024-01-01' ORDER BY date; replace <table_name> with the returned name, including its unique suffix."
    • changedInput schema / properties / row_limit / description
      Previous value: -"Most rows to return (1–10000, default 150). When the query produces more, truncated is true — page with ORDER BY <column> LIMIT <n> OFFSET <m> in the SQL, or aggregate, rather than raising this toward the maximum."New value: +"Most rows to return (positive integer, default 150; values above 10000 clamp to 10000 with a notice). When the query produces more, truncated is true — page with ORDER BY <column> LIMIT <n> OFFSET <m> in the SQL, or aggregate, rather than raising this toward the maximum."
    • changedInput schema / properties / row_limit / maximum
      Previous value: -10000New value: +9007199254740991
    • changedOutput schema / properties / notice / description
      Previous value: -"Present when truncated is true: how many rows came back and the ORDER BY … LIMIT … OFFSET query shape that fetches the next page."New value: +"Reports requested and effective row limits when clamped, and the ORDER BY … LIMIT … OFFSET query shape when the result is truncated."
  2. Changed1 schema field changed
    • addedInput schema / properties / canvas_id / pattern
      Added value: +"^[A-Za-z0-9_-]{10}$"
  3. Changed5 schema fields changed
    • addedInput schema / properties / row_limit
      Added value: +{
      +  "default": 150,
      +  "description": "Most rows to return (1–10000, default 150). When the query produces more, truncated is true — page with ORDER BY <column> LIMIT <n> OFFSET <m> in the SQL, or aggregate, rather than raising this toward the maximum.",
      +  "maximum": 10000,
      +  "minimum": 1,
      +  "type": "integer"
      +}
    • addedOutput schema / properties / notice
      Added value: +{
      +  "description": "Present when truncated is true: how many rows came back and the ORDER BY … LIMIT … OFFSET query shape that fetches the next page.",
      +  "type": "string"
      +}
    • changedOutput schema / properties / row_count / description
      Previous value: -"Rows returned. Equals the materialized row count; when truncated is true this is the row cap, not the full result size. Narrow the SELECT (add WHERE/LIMIT or aggregate) to see all rows."New value: +"Rows returned — always the length of rows. When truncated is true this equals row_limit, not the full result size."
    • changedOutput schema / properties / rows / description
      Previous value: -"Result rows, capped at the canvas row limit (default 10 000). Each key is a column name from the query."New value: +"Result rows, at most row_limit (default 150). Each key is a column name from the query."
    • changedOutput schema / properties / truncated / description
      Previous value: -"True when the query produced more rows than the canvas row cap and the result was capped. Refine the query to materialize the complete result."New value: +"True when the query produced more rows than row_limit and rows holds only the first row_limit of them. Fetch the rest with ORDER BY <column> LIMIT <n> OFFSET <m> — ORDER BY is required for deterministic paging — or aggregate to shrink the result."
  4. Changed6 schema fields changed
    • changedInput schema / $schema
      Previous value: -"http://json-schema.org/draft-07/schema#"New value: +"https://json-schema.org/draft/2020-12/schema"
    • addedInput schema / additionalProperties
      Added value: +false
    • changedOutput schema / $schema
      Previous value: -"http://json-schema.org/draft-07/schema#"New value: +"https://json-schema.org/draft/2020-12/schema"
    • addedOutput schema / anyOf
      Added value: +[
      +  {
      +    "not": {
      +      "required": [
      +        "error"
      +      ]
      +    },
      +    "required": [
      +      "rows",
      +      "row_count",
      +      "truncated",
      +      "canvas_id"
      +    ]
      +  },
      +  {
      +    "required": [
      +      "error"
      +    ]
      +  }
      +]
    • addedOutput schema / properties / error
      Added value: +{
      +  "additionalProperties": {},
      +  "description": "Present when the call failed. Absent on success.",
      +  "properties": {
      +    "code": {
      +      "description": "JSON-RPC error code for this failure.",
      +      "maximum": 9007199254740991,
      +      "minimum": -9007199254740991,
      +      "type": "integer"
      +    },
      +    "data": {
      +      "additionalProperties": {},
      +      "properties": {
      +        "reason": {
      +          "description": "Machine-readable failure mode. Declared by this tool: `canvas_not_found`: canvas_id does not exist or has been evicted. `missing_table`: The SQL references a table that is not staged on this canvas, or whose TTL expired. `invalid_query`: SQL is not a SELECT, references unknown columns, or has a syntax error. Other values are possible when a failure originates below the handler.",
      +          "examples": [
      +            "canvas_not_found",
      +            "missing_table",
      +            "invalid_query"
      +          ],
      +          "type": "string"
      +        },
      +        "recovery": {
      +          "additionalProperties": {},
      +          "description": "Actionable next step for the caller.",
      +          "properties": {
      +            "hint": {
      +              "type": "string"
      +            }
      +          },
      +          "required": [
      +            "hint"
      +          ],
      +          "type": "object"
      +        },
      +        "retryable": {
      +          "description": "Whether retrying may succeed.",
      +          "type": "boolean"
      +        }
      +      },
      +      "type": "object"
      +    },
      +    "message": {
      +      "description": "Human-readable description of what went wrong.",
      +      "type": "string"
      +    }
      +  },
      +  "required": [
      +    "code",
      +    "message"
      +  ],
      +  "type": "object"
      +}
    • removedOutput schema / required
      Removed value: -[
      -  "rows",
      -  "row_count",
      -  "truncated",
      -  "canvas_id"
      -]
  5. Changed3 schema fields changed
    • changedOutput schema / properties / row_count / description
      Previous value: -"Total rows in the full result set before the row cap was applied."New value: +"Rows returned. Equals the materialized row count; when truncated is true this is the row cap, not the full result size. Narrow the SELECT (add WHERE/LIMIT or aggregate) to see all rows."
    • addedOutput schema / properties / truncated
      Added value: +{
      +  "description": "True when the query produced more rows than the canvas row cap and the result was capped. Refine the query to materialize the complete result.",
      +  "type": "boolean"
      +}
    • changedOutput schema / required
      Previous value: -[
      -  "rows",
      -  "row_count",
      -  "canvas_id"
      -]New value: +[
      +  "rows",
      +  "row_count",
      +  "truncated",
      +  "canvas_id"
      +]
  6. First observed

TDQS

A4.4/5.0
Behavior4/5

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

The annotations already declare readOnlyHint, idempotentHint, and openWorldHint=false, so the safety profile is covered; the description reinforces this with 'read-only SQL SELECT'. It adds genuinely useful deployment behavior that annotations cannot express: when DataCanvas is off, the tool is absent from the listing entirely. It does not mention query cost, timeouts, or how errors surface, which keeps it below top marks.

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?

Three sentences, front-loaded with the action and capability set, then prerequisites, then the deployment caveat. Nothing is repeated from the schema and every sentence carries distinct information.

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?

With an output schema present and full parameter documentation, the description only needs to cover the workflow and preconditions, which it does: staging source, prerequisite describe step, and the DataCanvas gating fallback. Minor gap: it doesn't say whether staged tables persist across calls or expire, though canvas_id expiry is hinted at in the schema.

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 coverage is 100% and each parameter already carries a detailed description, including the canvas_id pattern, expiry handling, row_limit truncation, and the <table_name> substitution example. The description adds only light framing (which sibling supplies table names) and no new syntax or format details, so the baseline 3 applies.

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 ('Run a read-only SQL SELECT against DataCanvas tables staged by fx_get_timeseries') and names the exact capability envelope (aggregations, GROUP BY, window functions, JOINs). A reader can immediately distinguish it from fx_get_timeseries, which produces the data, and fx_dataframe_describe, which provides 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?

Gives an explicit prerequisite order ('Run fx_dataframe_describe first to discover table names and column schemas') and names the ordinal alternative path ('fx_get_timeseries returns every range inline there') when DataCanvas is disabled. Both when-to-use and what-to-do-instead are stated.

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.