# `treasury__treasury_list_datasets`

**List Treasury Fiscal Data Datasets**

Browse the curated catalog of US Treasury Fiscal Data API endpoints. Returns endpoint paths, field names, descriptions, and update cadence for each dataset. Use this tool before treasury_query_dataset to discover the correct endpoint path and field names — a typo in either causes a 400 error from the API. The catalog is a curated subset of the full API — pass any endpoint path directly to treasury_query_dataset to query datasets not listed here. The catalog covers debt, interest rates, exchange rates, revenue/spending, savings bonds, and securities datasets.

- Server: [US Treasury FiscalData](https://gateway.mcpharbor.dev/docs/servers/treasury) (`dev.mcpharbor.gateway/treasury`)
- Price per call: $0.0001 (100 micro-USD); only tools/call is charged
- Endpoint: `https://gateway.mcpharbor.dev/mcp` or `https://gateway.mcpharbor.dev/mcp/treasury`
- Upstream tool: exposed by the provider; called through this gateway as `treasury__treasury_list_datasets`
- Provider terms: <https://fiscaldata.treasury.gov/api-documentation/> (verified 2026-09-19)
- Upstream API documentation: <https://fiscaldata.treasury.gov/api-documentation/>
- Rate limit: 300 requests per minute
- Attribution required: Not stated as required

## Parameters

- `category` (string, optional): Filter by category. Omit to list all datasets. Options: debt, interest_rates, exchange_rates, revenue_spending, savings_bonds, securities, other. One of: `debt`, `interest_rates`, `exchange_rates`, `revenue_spending`, `savings_bonds`, `securities`, `other`.
- `search` (string, optional): Keyword filter against dataset name and description (case-insensitive substring match). Useful for narrowing results when the category is uncertain.

## Example call

Request headers and body:

```http
POST /mcp HTTP/1.1
Host: gateway.mcpharbor.dev
Authorization: Bearer <your gateway API key>
Content-Type: application/json
Accept: application/json, text/event-stream
MCP-Protocol-Version: 2026-07-28
Mcp-Method: tools/call
Mcp-Name: treasury__treasury_list_datasets
```

```json
{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "_meta": {
      "io.modelcontextprotocol/clientCapabilities": {},
      "io.modelcontextprotocol/clientInfo": {
        "name": "example-agent",
        "version": "1.0.0"
      },
      "io.modelcontextprotocol/protocolVersion": "2026-07-28"
    },
    "arguments": {
      "category": "debt"
    },
    "name": "treasury__treasury_list_datasets"
  }
}
```

A successful response:

```json
{
  "id": 1,
  "jsonrpc": "2.0",
  "result": {
    "_meta": {
      "dev.mcpharbor.gateway/call": {
        "chargedMicroUsd": 100,
        "id": "<the id of this charge>"
      }
    },
    "content": [
      {
        "text": "<whatever the upstream tool returned>",
        "type": "text"
      }
    ],
    "resultType": "complete"
  }
}
```

This call costs $0.0001 (100 micro-USD). Reading this page and listing the tool cost nothing.
The `dev.mcpharbor.gateway/call` record in the result is the receipt for that charge. Each
POST is metered separately, so sending the same call again buys another one: see
[agent.txt](https://gateway.mcpharbor.dev/agent.txt), section 7, before retrying.

## Attribution

This provider requires the attribution below wherever you use results from its tools.
Reproduce it verbatim:

> Not stated as required

## Tool definition

Exactly as `tools/list` returns it (free):

```json
{
  "_meta": {
    "dev.mcpharbor.gateway/pricing": {
      "currency": "USD",
      "pricePerCallMicroUsd": 100
    }
  },
  "annotations": {
    "idempotentHint": true,
    "readOnlyHint": true
  },
  "description": "Browse the curated catalog of US Treasury Fiscal Data API endpoints. Returns endpoint paths, field names, descriptions, and update cadence for each dataset. Use this tool before treasury_query_dataset to discover the correct endpoint path and field names — a typo in either causes a 400 error from the API. The catalog is a curated subset of the full API — pass any endpoint path directly to treasury_query_dataset to query datasets not listed here. The catalog covers debt, interest rates, exchange rates, revenue/spending, savings bonds, and securities datasets.",
  "inputSchema": {
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "additionalProperties": false,
    "properties": {
      "category": {
        "description": "Filter by category. Omit to list all datasets. Options: debt, interest_rates, exchange_rates, revenue_spending, savings_bonds, securities, other.",
        "enum": [
          "debt",
          "interest_rates",
          "exchange_rates",
          "revenue_spending",
          "savings_bonds",
          "securities",
          "other"
        ],
        "type": "string"
      },
      "search": {
        "description": "Keyword filter against dataset name and description (case-insensitive substring match). Useful for narrowing results when the category is uncertain.",
        "type": "string"
      }
    },
    "type": "object"
  },
  "name": "treasury__treasury_list_datasets",
  "outputSchema": {
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "additionalProperties": false,
    "anyOf": [
      {
        "not": {
          "required": [
            "error"
          ]
        },
        "required": [
          "datasets",
          "total"
        ]
      },
      {
        "required": [
          "error"
        ]
      }
    ],
    "properties": {
      "datasets": {
        "description": "Matching datasets.",
        "items": {
          "additionalProperties": false,
          "description": "One dataset entry.",
          "properties": {
            "category": {
              "description": "Broad category: debt, interest_rates, exchange_rates, revenue_spending, savings_bonds, securities, other.",
              "type": "string"
            },
            "description": {
              "description": "What this dataset contains and when it is updated.",
              "type": "string"
            },
            "endpoint": {
              "description": "Endpoint path to pass to treasury_query_dataset (e.g., \"/v2/accounting/od/debt_to_penny\"). Include the leading slash.",
              "type": "string"
            },
            "fields": {
              "description": "Fields available on this endpoint.",
              "items": {
                "additionalProperties": false,
                "description": "One field available on this endpoint.",
                "properties": {
                  "label": {
                    "description": "Human-readable label.",
                    "type": "string"
                  },
                  "name": {
                    "description": "Field name as used in fields= and filter= parameters.",
                    "type": "string"
                  },
                  "type": {
                    "description": "Data type (DATE, CURRENCY, PERCENTAGE, STRING, INTEGER, NUMBER, etc.).",
                    "type": "string"
                  }
                },
                "required": [
                  "name",
                  "label",
                  "type"
                ],
                "type": "object"
              },
              "type": "array"
            },
            "name": {
              "description": "Human-readable dataset name.",
              "type": "string"
            },
            "update_cadence": {
              "description": "How often the data is updated (e.g., \"Daily\", \"Monthly\", \"Quarterly\").",
              "type": "string"
            }
          },
          "required": [
            "endpoint",
            "name",
            "description",
            "category",
            "fields",
            "update_cadence"
          ],
          "type": "object"
        },
        "type": "array"
      },
      "error": {
        "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.",
                "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"
      },
      "total": {
        "description": "Total matching datasets.",
        "type": "number"
      }
    },
    "type": "object"
  },
  "title": "List Treasury Fiscal Data Datasets"
}
```
