Skip to main content
Glama

usaspending-mcp-server

Get Agency Overview

usaspending_get_agency
Read-onlyIdempotent

Fetch an agency's fiscal-year overview including mission, budgetary resources, obligation and outlay totals (for the most recent fiscal year), sub-agency count, and DEF codes for disaster/emergency funding. Also returns a paginated sub-agency breakdown with obligation and transaction counts. Accepts either a 3-digit toptier_code (e.g., 097 for DoD, 012 for Agriculture) or an agency_slug (e.g., department-of-defense) — both appear in usaspending_list_agencies results and award search results.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pageNoSub-agency breakdown page (1-based, 10 per page). Use with sub_agency_page_metadata.has_next to page through the full list.
agency_slugNoURL-friendly agency slug (e.g., department-of-defense) — from usaspending_list_agencies or award search results. Use either toptier_code or agency_slug, not both.
toptier_codeNo3-digit toptier agency code (e.g., 097, 012) — from usaspending_list_agencies. Use either toptier_code or agency_slug, not both.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameNoAgency full name
errorNoPresent when the call failed. Absent on success.
noticeNoGuidance when the sub-agency breakdown is truncated — how to page for the rest. Absent when the last page is shown.
missionNoAgency mission statement
websiteNoAgency website URL
agency_idNoInternal agency ID
def_codesNoDisaster/Emergency Funding (DEF) codes applicable to this agency
fiscal_yearNoFiscal year the budgetary totals below reflect (most recent available)
abbreviationNoAgency abbreviation
sub_agenciesNoSub-agency breakdown within this toptier agency (one page)
toptier_codeNo3-digit toptier agency code
outlay_amountNoTotal outlays in USD for the fiscal year
sub_agency_pageNoCurrent sub-agency page returned
obligated_amountNoTotal amount obligated in USD for the fiscal year
sub_agency_totalNoTotal sub-agencies across all pages (when available)
subtier_agency_countNoNumber of sub-agencies within this toptier agency
has_more_sub_agenciesNoWhether more sub-agency pages are available
sub_agency_page_metadataNoPagination metadata for the sub-agency breakdown
budgetary_resources_amountNoTotal budgetary resources in USD for the fiscal year

Schema Changelog

Changes observed during successful MCP inspections.

  1. 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": [
      +      "sub_agency_page",
      +      "has_more_sub_agencies"
      +    ]
      +  },
      +  {
      +    "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: `agency_not_found`: No agency found for the given toptier_code or agency_slug. `missing_input`: Neither toptier_code nor agency_slug was provided. `api_unavailable`: USAspending.gov API is unreachable or returns an error. `api_timeout`: USAspending.gov did not respond before the request deadline elapsed. Other values are possible when a failure originates below the handler.",
      +          "examples": [
      +            "agency_not_found",
      +            "missing_input",
      +            "api_unavailable",
      +            "api_timeout"
      +          ],
      +          "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: -[
      -  "sub_agency_page",
      -  "has_more_sub_agencies"
      -]
  2. Changed14 schema fields changed
    • addedInput schema / properties / page
      Added value: +{
      +  "default": 1,
      +  "description": "Sub-agency breakdown page (1-based, 10 per page). Use with sub_agency_page_metadata.has_next to page through the full list.",
      +  "maximum": 9007199254740991,
      +  "minimum": 1,
      +  "type": "integer"
      +}
    • removedOutput schema / properties / budget_authority_amount
      Removed value: -{
      -  "description": "Total budget authority amount in USD for current fiscal year",
      -  "type": "number"
      -}
    • addedOutput schema / properties / budgetary_resources_amount
      Added value: +{
      +  "description": "Total budgetary resources in USD for the fiscal year",
      +  "type": "number"
      +}
    • addedOutput schema / properties / fiscal_year
      Added value: +{
      +  "description": "Fiscal year the budgetary totals below reflect (most recent available)",
      +  "type": "number"
      +}
    • addedOutput schema / properties / has_more_sub_agencies
      Added value: +{
      +  "description": "Whether more sub-agency pages are available",
      +  "type": "boolean"
      +}
    • addedOutput schema / properties / notice
      Added value: +{
      +  "description": "Guidance when the sub-agency breakdown is truncated — how to page for the rest. Absent when the last page is shown.",
      +  "type": "string"
      +}
    • changedOutput schema / properties / obligated_amount / description
      Previous value: -"Total obligated amount in USD for current fiscal year"New value: +"Total amount obligated in USD for the fiscal year"
    • addedOutput schema / properties / outlay_amount
      Added value: +{
      +  "description": "Total outlays in USD for the fiscal year",
      +  "type": "number"
      +}
    • changedOutput schema / properties / sub_agencies / description
      Previous value: -"Sub-agency breakdown within this toptier agency"New value: +"Sub-agency breakdown within this toptier agency (one page)"
    • addedOutput schema / properties / sub_agency_page
      Added value: +{
      +  "description": "Current sub-agency page returned",
      +  "type": "number"
      +}
    • addedOutput schema / properties / sub_agency_page_metadata
      Added value: +{
      +  "additionalProperties": false,
      +  "description": "Pagination metadata for the sub-agency breakdown",
      +  "properties": {
      +    "has_next": {
      +      "description": "Whether more sub-agency pages are available",
      +      "type": "boolean"
      +    },
      +    "limit": {
      +      "description": "Sub-agencies per page",
      +      "type": "number"
      +    },
      +    "page": {
      +      "description": "Current sub-agency page number",
      +      "type": "number"
      +    },
      +    "total": {
      +      "description": "Total sub-agencies across all pages",
      +      "type": "number"
      +    }
      +  },
      +  "required": [
      +    "page",
      +    "has_next",
      +    "limit"
      +  ],
      +  "type": "object"
      +}
    • addedOutput schema / properties / sub_agency_total
      Added value: +{
      +  "description": "Total sub-agencies across all pages (when available)",
      +  "type": "number"
      +}
    • removedOutput schema / properties / transactions_count
      Removed value: -{
      -  "description": "Total transaction count",
      -  "type": "number"
      -}
    • addedOutput schema / required
      Added value: +[
      +  "sub_agency_page",
      +  "has_more_sub_agencies"
      +]
  3. First observed

TDQS

A4.4/5.0
Behavior4/5

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

Annotations already convey readOnlyHint=true and idempotentHint=true, so the agent knows this is safe. The description adds behavioral context by specifying that it returns a paginated breakdown, includes DEF codes for disaster/emergency funding, and provides example codes/slugs. It does not contradict annotations and adds helpful detail about the data scope without over-explaining.

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 two sentences but packs substantial detail: the first sentence lists the core data returned, the second explains the identifier options and sources. It is front-loaded with the main purpose and uses examples efficiently. It is appropriately sized for a moderately complex tool, though it could be slightly trimmed without loss.

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 that an output schema exists, return values are already specified, so the description need not restate them. It covers how to obtain the identifiers (from usaspending_list_agencies or award results), the mutual exclusivity rule, and the pagination behavior via sub_agency_page_metadata. The description is sufficient for an agent to call this tool correctly without additional introspection.

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% (every parameter has a description), but the tool description adds crucial semantics beyond the schema: it explains that toptier_code and agency_slug are mutually exclusive alternatives and provides concrete examples (097, 012; department-of-defense). It also clarifies that the page parameter is for sub-agency pagination. This extra guidance helps the agent select and format parameters correctly.

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 uses a specific verb ('Fetch') and a precise resource ('an agency's fiscal-year overview') and enumerates the returned data (mission, budgetary resources, obligation/outlay totals, DEF codes, sub-agency breakdown). It clearly differentiates itself from sibling tools like usaspending_list_agencies, which lists agencies, while this fetches details for one agency.

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?

The description states that it accepts either toptier_code or agency_slug and explicitly says 'both appear in usaspending_list_agencies results and award search results,' guiding the agent on where to obtain inputs. It also instructs 'Use either toptier_code or agency_slug, not both,' which is a clear constraint. However, it does not explicitly describe scenarios where a sibling tool (e.g., usaspending_get_federal_account) would be more appropriate, but the purpose is clear enough that this is minimal.

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.