Skip to main content
Glama

Usa Spending Trends

usa_spending_trends
Read-onlyIdempotent

"How has [agency] contract spending trended over the last N fiscal years?" / "is [agency] spending on X growing?" / "federal spending history for [topic]", US FEDERAL contract/award spending over time from USAspending.gov, grouped by fiscal year, quarter, or month. Filter by keywords or by federal agency (DHS/Homeland Security, DOD/Defense, HHS, VA, DOE, NASA, State, Treasury). Returns the historical dollar amount per period for trend and budget-forecasting questions. Federal only, for state & county award data use gov_contracts_search.

Example tool call

This call uses example arguments supplied in the tool’s input schema.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "group": "fiscal_year",
      "end_date": "2024-12-31",
      "keywords": [
        "artificial intelligence"
      ],
      "start_date": "2020-01-01"
    },
    "name": "usa_spending_trends"
  }
}

Input Schema

NameRequiredDescriptionDefault
groupNoTime grouping: fiscal_year, quarter, or month (default fiscal_year)
agencyNoAwarding agency name. Use instead of, or alongside, keywords.
end_dateNoEnd date YYYY-MM-DD. Optional, defaults to today.
keywordsNoKeywords to track spending for (e.g., ["artificial intelligence"])
start_dateNoStart date YYYY-MM-DD. Optional, defaults to five years ago; the window actually used comes back under `period`.

Output Schema

NameRequiredDescriptionDefault
groupYesTime grouping used (fiscal_year, quarter, or month)
data_pointsYesSpending data points over time

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changed
    • changedInput schema / properties / end_date / description
      Previous value: -"End date YYYY-MM-DD. Optional — defaults to today."New value: +"End date YYYY-MM-DD. Optional, defaults to today."
    • changedInput schema / properties / start_date / description
      Previous value: -"Start date YYYY-MM-DD. Optional — defaults to five years ago; the window actually used comes back under `period`."New value: +"Start date YYYY-MM-DD. Optional, defaults to five years ago; the window actually used comes back under `period`."
  2. Changed4 schema fields changed
    • changedInput schema / properties / agency / description
      Previous value: -"Optional awarding agency name"New value: +"Awarding agency name. Use instead of, or alongside, keywords."
    • changedInput schema / properties / end_date / description
      Previous value: -"End date in YYYY-MM-DD format"New value: +"End date YYYY-MM-DD. Optional — defaults to today."
    • changedInput schema / properties / start_date / description
      Previous value: -"Start date in YYYY-MM-DD format"New value: +"Start date YYYY-MM-DD. Optional — defaults to five years ago; the window actually used comes back under `period`."
    • changedInput schema / required
      Previous value: -[
      -  "keywords",
      -  "start_date",
      -  "end_date"
      -]New value: +[]
  3. Changed1 schema field changed
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "properties": {
      +    "data_points": {
      +      "description": "Spending data points over time",
      +      "items": {
      +        "properties": {
      +          "amount": {
      +            "description": "Aggregated spending amount for this period",
      +            "type": "number"
      +          },
      +          "fiscal_year": {
      +            "description": "Fiscal year for this data point",
      +            "type": "string"
      +          },
      +          "month": {
      +            "description": "Month if grouped by month",
      +            "type": [
      +              "string",
      +              "null"
      +            ]
      +          },
      +          "quarter": {
      +            "description": "Fiscal quarter if grouped by quarter",
      +            "type": [
      +              "string",
      +              "null"
      +            ]
      +          }
      +        },
      +        "required": [
      +          "fiscal_year",
      +          "quarter",
      +          "month",
      +          "amount"
      +        ],
      +        "type": "object"
      +      },
      +      "type": "array"
      +    },
      +    "group": {
      +      "description": "Time grouping used (fiscal_year, quarter, or month)",
      +      "type": "string"
      +    }
      +  },
      +  "required": [
      +    "group",
      +    "data_points"
      +  ],
      +  "type": "object"
      +}
  4. Changed1 schema field changed
    • addedInput schema / examples
      Added value: +[
      +  {
      +    "end_date": "2024-12-31",
      +    "group": "fiscal_year",
      +    "keywords": [
      +      "artificial intelligence"
      +    ],
      +    "start_date": "2020-01-01"
      +  },
      +  {
      +    "agency": "Department of Energy",
      +    "end_date": "2024-12-31",
      +    "group": "quarter",
      +    "keywords": [
      +      "renewable energy"
      +    ],
      +    "start_date": "2023-01-01"
      +  }
      +]
  5. First observed

TDQS

A4.6/5.0
Behavior4/5

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

Annotations already declare readOnly, idempotent, openWorld, and non-destructive, so the safety profile is covered. The description adds useful behavior beyond that: it returns historical dollar amounts per period, defaults the window to five years ago through today, and notes the actual window comes back under `period`. It does not discuss rate limits or result-size limits, keeping it short of a 5.

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?

Front-loads example questions, then the core capability, then filters, return shape, and the federal-only exclusion. Dense but every clause carries information; the quoted example questions are slightly verbose but serve as routing cues.

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?

For a 5-parameter, all-optional trend tool with an output schema and full annotation coverage, the description supplies purpose, grouping options, filter semantics, defaults, and the sibling alternative. Nothing an agent needs to call it correctly is missing.

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. The description adds meaning beyond the schema by enumerating concrete agency names and their abbreviations (DHS/Homeland Security, DOD/Defense, HHS, VA, DOE, NASA, State, Treasury), which helps the agent populate the free-text `agency` field 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?

States a specific verb and resource ('US FEDERAL contract/award spending over time from USAspending.gov, grouped by fiscal year, quarter, or month') and explicitly scopes it to federal data, naming gov_contracts_search as the state/county alternative. An agent can distinguish it from usa_spending_by_agency and usa_spending_by_category by the time-series grouping.

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?

Opens with three concrete example questions that map directly to invocation, then gives an explicit exclusion ('Federal only, for state & county award data use gov_contracts_search'). Both when-to-use and when-not-to-use are covered.

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.