Skip to main content
Glama

treasury-fiscaldata-mcp-server

Get National Debt

treasury_get_debt
Read-onlyIdempotent

Fetch national debt (Debt to the Penny) — total public debt outstanding broken into publicly-held debt and intragovernmental holdings. Three modes: "latest" returns the most recent business day's record; "date" returns the record for a specific date (must be a business day — the API only records debt on days markets are open); "series" returns a date range, staging the full result as a DataCanvas table when canvas_id is set or the range matches more than 500 rows — read the table's column schema with treasury_dataframe_describe, then run SQL over it with treasury_dataframe_query. Records go back to 1993-04-01.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
dateNoISO 8601 date (YYYY-MM-DD) for mode=date. Must be a business day; the API only records debt on days the market is open.
modeNo"latest" returns the most recent day's record. "date" returns the record for a specific date. "series" returns a date range — use with start_date and end_date.latest
end_dateNoISO 8601 end date for mode=series (inclusive). Defaults to today.
canvas_idNoSet any non-empty value to stage mode=series results as a DataCanvas table for SQL analysis — the value only requests staging; the server picks the table name. Staging also happens on its own when the range matches more than 500 rows. The assigned name (df_XXXXX_XXXXX) comes back in the output canvas_id; pass it to treasury_dataframe_describe, then treasury_dataframe_query. Requires CANVAS_PROVIDER_TYPE=duckdb.
start_dateNoISO 8601 start date for mode=series (inclusive). Fiscal Data has daily debt records back to 1993-04-01.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
capNoThe preview cap applied to the inline series array.
errorNoPresent when the call failed. Absent on success.
shownNoSeries rows returned inline.
noticeNoGuidance when the inline series is a preview, when the series was staged as a DataCanvas table, or when paging stopped before the full matched set.
seriesNoInline preview of the mode=series records — at most 20 rows, newest first. Compare series.length against retrieved_records to detect the cap; the full retrieved set is reachable through canvas_id when one is returned.
canvas_idNoDuckDB table name (df_XXXXX_XXXXX) holding the full retrieved series. 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.
truncatedNoTrue when the inline series array holds fewer rows than were retrieved.
total_debtNoTotal public debt outstanding in USD, as a plain decimal string — no separators, no currency symbol, two decimal places. Convert as needed.
record_dateNoDate of this debt record (YYYY-MM-DD). For series mode, the most recent date.
total_recordsNoRecords matching the date range upstream. Exceeds retrieved_records when the match is larger than the series row bound.
debt_held_publicNoDebt held by the public (external creditors, Fed, foreign governments) in USD.
canvas_expires_atNoISO 8601 expiry for the canvas dataframe.
retrieved_recordsNoRecords actually fetched for mode=series across every page, and the row count of the canvas table when one was registered. Never larger than total_records.
intragovernmental_holdingsNoIntragovernmental holdings (debt owed to federal trust funds, Social Security, etc.) in USD.

TDQS

A4.9/5.0
Behavior5/5

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

Beyond the annotations (readOnlyHint=true, idempotentHint=true), the description discloses meaningful behavioral details: the automatic staging of large series results into DataCanvas tables, the requirement for CANVAS_PROVIDER_TYPE=duckdb, the server-side table naming, and the fact that only business days are recorded. None of these contradict the annotations, and they substantially enrich the agent's understanding of side effects and constraints.

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?

The description is long but every clause earns its place given the tool's complexity. It front-loads the core purpose and mode summary before diving into staging details, and it uses clear punctuation to separate ideas. The only minor quibble is that the staging explanation could be tightened, but it remains tightly structured and not verbose.

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?

With an output schema available, the description doesn't need to cover return values. It provides all necessary context for correct invocation: mode semantics, date constraints, default behavior for missing start/end dates, automatic staging rules, and pointers to related tools. An agent can confidently call this tool without additional information.

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?

Although the schema provides 100% parameter coverage, the description adds significant operational meaning: it explains the interplay of mode with start_date/end_date, clarifies that canvas_id only requests staging ('the server picks the table name'), and highlights the default for end_date and the historical depth (1993-04-01). This goes well beyond the schema's individual field 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?

The description states a specific verb-resource pair ('Fetch national debt') and immediately differentiates the tool from siblings by naming the exact data source ('Debt to the Penny') and the breakdown into publicly-held debt and intragovernmental holdings. It also enumerates three distinct modes, making the tool's purpose unambiguous and distinct from other treasury tools.

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?

The description gives explicit, actionable guidance for each mode: 'latest' for the most recent business day, 'date' for a specific business day, and 'series' for a range. It also explains when to use the DataCanvas staging (canvas_id or >500 rows) and routes the agent to treasury_dataframe_describe and treasury_dataframe_query for further analysis. It even notes the business-day constraint and date range origin, leaving no ambiguity about when the tool is appropriate.

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.