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.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • changedOutput schema / properties / error / properties / data / properties / reason / description
      Previous value: -"Machine-readable failure mode. Declared by this tool: `no_data_for_date`: No debt record exists for the requested date (API returns HTTP 200 with empty data[], not 404 — total-count is 0) Other values are possible when a failure originates below the handler."New value: +"Machine-readable failure mode. Declared by this tool: `no_data_for_date`: No debt record exists for the requested date (API returns HTTP 200 with empty data[], not 404 — total-count is 0). Other values are possible when a failure originates below the handler."
  2. 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": [
      +      "record_date",
      +      "total_debt",
      +      "debt_held_public",
      +      "intragovernmental_holdings"
      +    ]
      +  },
      +  {
      +    "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: `no_data_for_date`: No debt record exists for the requested date (API returns HTTP 200 with empty data[], not 404 — total-count is 0) Other values are possible when a failure originates below the handler.",
      +          "examples": [
      +            "no_data_for_date"
      +          ],
      +          "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: -[
      -  "record_date",
      -  "total_debt",
      -  "debt_held_public",
      -  "intragovernmental_holdings"
      -]
  3. Changed5 schema fields changed
    • changedInput schema / properties / canvas_id / description
      Previous value: -"DataCanvas table name (df_XXXXX_XXXXX) to register series results into for SQL analysis. When provided, or when the series exceeds 500 rows, the full result is registered and the name is returned in canvas_id. Use treasury_dataframe_query to run SQL against it. Requires CANVAS_PROVIDER_TYPE=duckdb."New value: +"Set 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."
    • changedInput schema / properties / start_date / description
      Previous value: -"ISO 8601 start date for mode=series (inclusive). Fiscal Data has daily debt records back to 1993-01-04."New value: +"ISO 8601 start date for mode=series (inclusive). Fiscal Data has daily debt records back to 1993-04-01."
    • changedOutput schema / properties / canvas_id / description
      Previous value: -"DataCanvas table name when series was spilled. Use treasury_dataframe_query to run SQL."New value: +"DuckDB 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."
    • changedOutput schema / properties / notice / description
      Previous value: -"Guidance when the inline series is a preview, or when paging stopped before the full matched set."New value: +"Guidance 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."
    • changedOutput schema / properties / total_debt / description
      Previous value: -"Total public debt outstanding in USD (string — convert as needed). Example: \"39176301795549.40\"."New value: +"Total public debt outstanding in USD, as a plain decimal string — no separators, no currency symbol, two decimal places. Convert as needed."
  4. Changed7 schema fields changed
    • addedOutput schema / properties / cap
      Added value: +{
      +  "description": "The preview cap applied to the inline series array.",
      +  "type": "number"
      +}
    • addedOutput schema / properties / notice
      Added value: +{
      +  "description": "Guidance when the inline series is a preview, or when paging stopped before the full matched set.",
      +  "type": "string"
      +}
    • addedOutput schema / properties / retrieved_records
      Added value: +{
      +  "description": "Records 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.",
      +  "type": "number"
      +}
    • changedOutput schema / properties / series / description
      Previous value: -"All records for mode=series (may be truncated when spilled to canvas)."New value: +"Inline 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."
    • addedOutput schema / properties / shown
      Added value: +{
      +  "description": "Series rows returned inline.",
      +  "type": "number"
      +}
    • changedOutput schema / properties / total_records / description
      Previous value: -"Total matching records for mode=series."New value: +"Records matching the date range upstream. Exceeds retrieved_records when the match is larger than the series row bound."
    • addedOutput schema / properties / truncated
      Added value: +{
      +  "description": "True when the inline series array holds fewer rows than were retrieved.",
      +  "type": "boolean"
      +}
  5. First observed

TDQS

A4.9/5.0
Behavior5/5

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

Annotations already declare readOnlyHint and idempotentHint, and the description adds meaningful behavioral context: records exist only on market-open business days, series results may be staged as a DataCanvas table, and that staging requires duckdb. No contradiction with the annotations; the staging side-effect is disclosed rather than hidden.

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?

The description is dense but every clause earns its place: it front-loads the core purpose, then expands into modes and the staging workflow in a logical progression. There is no filler and no repetition of what the schema already states.

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 output schema exists, return-value explanation is unnecessary. The description fully covers mode selection, staging behavior, downstream tools, and the date range of available records, providing everything an agent needs to invoke the tool correctly.

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

Parameters4/5

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

Schema coverage is 100%, so the baseline is 3, but the description adds value beyond the schema: 'latest' is clarified as the most recent business day, 'series' is tied to start/end date usage, canvas_id is explained as a staging request where the server chooses the name, and the historical availability from 1993-04-01 is stated.

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 a specific verb-resource pair ('Fetch national debt (Debt to the Penny)') and distinguishes the content breakdown (publicly-held debt vs intragovernmental holdings). The three modes are clearly enumerated, making it easy to tell this tool apart from the dataframe tools and other treasury getters.

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 explicitly explains when to use each mode, and it routes the series-staging workflow to treasury_dataframe_describe and treasury_dataframe_query. It also tells the agent when staging auto-triggers (range > 500 rows) and when it is requested via canvas_id, leaving no ambiguity about next steps.

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.