Skip to main content
Glama

Usa Spending By Agency

usa_spending_by_agency
Read-onlyIdempotent

Break down US federal contract spending by agency for a given fiscal year (default: current year) and optional quarter (1-4). Returns agency names, abbreviations, and dollar amounts from USAspending.gov.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
quarterNoFiscal quarter (1-4). Omit for full year.
fiscal_yearNoFour-digit fiscal year (e.g., "2025"). Defaults to current year.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
totalNoTotal federal spending for the period
quarterNoFiscal quarter if specified, otherwise null
agenciesNoBreakdown of spending by agency
fiscal_yearNoFiscal year used for the query

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed5 schema fields changed
    • changedOutput schema / properties / agencies / items / properties / abbreviation / type
      Previous value: -[
      -  "string",
      -  "null"
      -]New value: +"null"
    • removedOutput schema / properties / agencies / items / required
      Removed value: -[
      -  "name",
      -  "amount",
      -  "abbreviation"
      -]
    • changedOutput schema / properties / quarter / type
      Previous value: -[
      -  "number",
      -  "null"
      -]New value: +"string"
    • changedOutput schema / properties / total / type
      Previous value: -[
      -  "number",
      -  "null"
      -]New value: +"number"
    • removedOutput schema / required
      Removed value: -[
      -  "fiscal_year",
      -  "quarter",
      -  "total",
      -  "agencies"
      -]
  2. Changed1 schema field changed
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "properties": {
      +    "agencies": {
      +      "description": "Breakdown of spending by agency",
      +      "items": {
      +        "properties": {
      +          "abbreviation": {
      +            "description": "Agency abbreviation if available",
      +            "type": [
      +              "string",
      +              "null"
      +            ]
      +          },
      +          "amount": {
      +            "description": "Spending amount for this agency",
      +            "type": "number"
      +          },
      +          "name": {
      +            "description": "Agency name",
      +            "type": "string"
      +          }
      +        },
      +        "required": [
      +          "name",
      +          "amount",
      +          "abbreviation"
      +        ],
      +        "type": "object"
      +      },
      +      "type": "array"
      +    },
      +    "fiscal_year": {
      +      "description": "Fiscal year used for the query",
      +      "type": "string"
      +    },
      +    "quarter": {
      +      "description": "Fiscal quarter if specified, otherwise null",
      +      "type": [
      +        "number",
      +        "null"
      +      ]
      +    },
      +    "total": {
      +      "description": "Total federal spending for the period",
      +      "type": [
      +        "number",
      +        "null"
      +      ]
      +    }
      +  },
      +  "required": [
      +    "fiscal_year",
      +    "quarter",
      +    "total",
      +    "agencies"
      +  ],
      +  "type": "object"
      +}
  3. Changed1 schema field changed
    • addedInput schema / examples
      Added value: +[
      +  {
      +    "fiscal_year": "2024"
      +  },
      +  {
      +    "fiscal_year": "2023",
      +    "quarter": 2
      +  }
      +]
  4. First observed

TDQS

A4.2/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=true, idempotentHint=true, and destructiveHint=false, so the agent knows it is a safe, non-destructive, and idempotent read operation. The description adds value by specifying the return data structure (agency names, abbreviations, dollar amounts), which is helpful beyond the annotations.

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 a single, front-loaded sentence that efficiently communicates the purpose, parameters, and return values. No wasted words, and every element earns its place.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the presence of an output schema and comprehensive annotations, the description is adequate for a simple query tool. It explains the core functionality and return fields. However, it could be slightly enhanced by mentioning that it only covers US federal contracts or noting any limitations, but overall it is sufficiently complete.

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

Parameters3/5

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

Schema description coverage is 100%, so the baseline is 3. The description mentions the parameters (fiscal year and quarter) and their defaults/optionality, but this does not add significant meaning beyond what the input schema already provides. The schema examples also illustrate usage.

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 clearly states the tool breaks down US federal contract spending by agency, with parameters for fiscal year and optional quarter. It specifies the return values (agency names, abbreviations, dollar amounts), which is specific and distinguishes it from sibling tools like usa_spending_by_category.

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 provides clear context on when to use the tool (querying spending by agency for a specific fiscal year and quarter) and includes default behavior (current year) and optional quarter. However, it does not explicitly exclude usage scenarios or contrast with similar sibling tools like usa_spending_by_category or usa_spending_trends.

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.