Skip to main content
Glama

treasury-fiscaldata-mcp-server

Query Treasury Fiscal Data Dataset

treasury_query_dataset
Read-onlyIdempotent

Query any Treasury Fiscal Data endpoint by path, field list, filters, sort, and page. Call treasury_list_datasets first to get the correct endpoint path and exact field names — a typo in either causes a 400. Filter syntax: each condition is { field, operator, value } where operator is eq/gt/gte/lt/lte/in (e.g., record_date:gte:2024-01-01). Multiple conditions are ANDed together. All response values are strings per the API contract, including numbers and dates; "null" (string) means no value. Supply canvas_id to stage the page result as a DataCanvas table — read its column schema with treasury_dataframe_describe, then run SQL over it with treasury_dataframe_query (requires CANVAS_PROVIDER_TYPE=duckdb on the server).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sortNoSort expression: field name optionally prefixed with "-" for descending (e.g., "-record_date" for newest-first).
fieldsNoFields to return. Omit to return all fields. Specify field names exactly as listed by treasury_list_datasets — a typo causes a 400.
filtersNoFilter conditions (ANDed together). Multiple filters on different fields are combined in one filter= parameter.
endpointYesEndpoint path returned by treasury_list_datasets (e.g., "/v2/accounting/od/debt_to_penny"). Include the leading slash.
canvas_idNoSet any non-empty value to stage this page as a DataCanvas table for SQL analysis — the value only requests staging; the server picks the table name. The assigned name (df_XXXXX_XXXXX) comes back in the output canvas_id; pass it to treasury_dataframe_describe, then treasury_dataframe_query. Omit to receive results inline only. Requires CANVAS_PROVIDER_TYPE=duckdb on the server.
page_sizeNoRows per page. Default 100. Raise to 10000 to minimize round trips for small datasets. For large time-series pulls, use canvas_id with treasury_dataframe_query instead.
page_numberNoPage to fetch (1-indexed). Check total_pages in the response to know if more pages exist.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
dataNoRows returned. All values are strings per API contract — including numeric and date fields. Convert in the calling context. Null values appear as the string "null".
errorNoPresent when the call failed. Absent on success.
noticeNoGuidance when results are empty, a field typo is suspected, the endpoint was not found in the catalog, or staging was requested.
endpointNoEndpoint that was queried.
canvas_idNoDuckDB table name (df_XXXXX_XXXXX) holding this page. Pass it to treasury_dataframe_describe for the column schema, then use it as the FROM target in treasury_dataframe_query SQL. Absent when nothing was staged.
page_sizeNoRows per page.
totalCountNoTotal rows matching the query across all pages — discloses that this page is a subset.
page_numberNoCurrent page (1-indexed).
total_countNoTotal rows matching the query (across all pages).
total_pagesNoTotal pages at the current page_size.
field_labelsNoHuman-readable label for each returned field.
applied_filtersNoFilter expression sent to the API, for verification.
canvas_expires_atNoISO 8601 expiry for the canvas dataframe.

TDQS

A5/5.0
Behavior5/5

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

Annotations already mark readOnlyHint and idempotentHint, so the description needn't repeat safety. It goes beyond by revealing that 'All response values are strings per the API contract, including numbers and dates; "null" (string) means no value,' a crucial behavioral detail. It also discloses a 400 on typos and the CANVAS_PROVIDER_TYPE=duckdb prerequisite, enriching the agent's mental model.

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?

Though long, every sentence serves a purpose: core function, prerequisite, syntax, response behavior, and workflow. It is front-loaded with the primary action and dependency, then details. No fluff or repetition of schema defaults; structure is logical and scannable.

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 the tool's complexity (7 parameters, multiple modes), the description covers endpoint discovery, field precision, filter grammar, sorting, pagination via page_number/total_pages, and the canvas staging path. The output schema handles return structure, so nothing an agent needs to call correctly is missing; the required duckdb context and string-typed responses are supplied.

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 coverage is 100% so baseline is 3, but the description elevates it by explaining the filter syntax as '{ field, operator, value }' with operator enum and an example ('record_date:gte:2024-01-01'), stating conditions are ANDed. It also clarifies canvas_id's staging role and the flow to treasury_dataframe_describe/query, which the schema alone does not convey, adding genuine semantic value.

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 opens with 'Query any Treasury Fiscal Data endpoint by path, field list, filters, sort, and page,' clearly stating a specific action (query) on a defined resource (Treasury Fiscal Data endpoints) with explicit scope. It differentiates from siblings by naming treasury_list_datasets for endpoint discovery and treasury_dataframe_describe/query for downstream data canvas operations, leaving no ambiguity about what this tool is for.

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 instructs 'Call treasury_list_datasets first to get the correct endpoint path and exact field names — a typo in either causes a 400,' giving a hard dependency. It also advises on large pulls to 'use canvas_id with treasury_dataframe_query instead,' and explains the duckdb server requirement, so the agent knows when to use this tool versus alternatives and how to chain it.

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.7/5.0
Disambiguation4/5

The tools are mostly distinct: each specialized getter (debt, exchange rates, interest rates) targets a specific dataset, while the generic query tool and list tool serve discovery and ad-hoc queries. There is some overlap between the generic treasury_query_dataset and the specialized getters, but the descriptions clearly differentiate their intended use (specialized modes vs. raw endpoint queries).

Naming Consistency5/5

All tools follow a consistent treasury_verb_noun pattern with snake_case (e.g., treasury_get_debt, treasury_list_datasets, treasury_dataframe_query). The verbs (get, list, query, describe) are consistent in style and each noun is plural or singular appropriately, making the naming uniform and predictable.

Tool Count5/5

With 7 tools, the server is well-scoped for its purpose of accessing Treasury fiscal data. It offers dedicated tools for common datasets, a generic query tool for flexibility, and DataFrame staging/query utilities, with no redundancy or overwhelming number of tools.

Completeness5/5

The tool surface covers essential workflows: discovering available datasets (list_datasets), querying any endpoint (query_dataset), retrieving common datasets with convenience modes (debt, exchange rates, interest rates), and handling large result sets via DataCanvas staging (describe/query). No obvious gaps exist; even less common datasets are accessible through the generic query tool.