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 (CANVAS_PROVIDER_TYPE=duckdb) — without it this tool is not listed at all and fx_get_timeseries returns every range inline.

Input Schema

TableJSON 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 fx_usd_eur WHERE date > '2024-01-01' ORDER BY date
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 (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.

Output Schema

TableJSON 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.
noticeNoPresent when truncated is true: how many rows came back and the ORDER BY … LIMIT … OFFSET query shape that fetches the next page.
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. Changed1 schema field changed
    • addedInput schema / properties / canvas_id / pattern
      Added value: +"^[A-Za-z0-9_-]{10}$"
  2. 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."
  3. 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"
      -]
  4. 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"
      +]
  5. First observed

TDQS

A4.2/5.0
Behavior4/5

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

Aligns with annotations: 'read-only SQL SELECT' matches readOnlyHint=true and idempotentHint=true, with no contradiction. The description adds genuinely useful context beyond annotations by disclosing that without DataCanvas the tool is not listed at all and fx_get_timeseries degrades to inline ranges — valuable behavioral information the agent couldn't get from the schema or annotations.

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?

Three sentences, each earning its place: core purpose first, then workflow, then environment prerequisite. The SQL feature list (aggregations, GROUP BY, window functions, JOINs) is packed efficiently. No filler or redundancy.

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?

An output schema exists, so return-value details are handled elsewhere. The description covers supported SQL constructs, the required discovery step, the environment prerequisite, and the degradation behavior — nothing an agent needs to invoke it correctly is missing. The row_limit parameter's pagination advice in the schema completes the picture.

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% so all three parameters are already documented, giving a baseline of 3. The description adds modest value by tying the query parameter to the discoverable table names from fx_dataframe_describe, but the heavy lifting is done by the schema's thorough parameter descriptions.

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.' The tool is clearly distinguishable from its siblings (fx_get_rate, fx_get_rates, fx_get_timeseries) because it offers arbitrary SQL with aggregations, window functions, and JOINs rather than fixed lookups. The listed SQL capabilities make its purpose unambiguous.

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?

Provides explicit sequencing guidance: 'Run fx_dataframe_describe first to discover table names and column schemas.' It also names the staging prerequisite (fx_get_timeseries) and the environment requirement (DataCanvas). It doesn't explicitly say when to prefer a simpler sibling like fx_get_rate, but the context for when to call it is 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.