usa_spending_trends

Pack: usaspending · Endpoint: https://gateway.pipeworx.io/usaspending/mcp

“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.

Parameters

NameTypeRequiredDescription
keywordsarraynoKeywords to track spending for (e.g., [“artificial intelligence”])
itemsstringno
agencystringnoAwarding agency name. Use instead of, or alongside, keywords.
start_datestringnoStart date YYYY-MM-DD. Optional — defaults to five years ago; the window actually used comes back under period.
end_datestringnoEnd date YYYY-MM-DD. Optional — defaults to today.
groupstringnoTime grouping: fiscal_year, quarter, or month (default fiscal_year)

Example call

Arguments

{
  "keywords": [
    "artificial intelligence"
  ],
  "start_date": "2020-01-01",
  "end_date": "2024-12-31",
  "group": "fiscal_year"
}

curl

curl -X POST https://gateway.pipeworx.io/usaspending/mcp \
  -H 'Content-Type: application/json' \
  -d '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"usa_spending_trends","arguments":{"keywords":["artificial intelligence"],"start_date":"2020-01-01","end_date":"2024-12-31","group":"fiscal_year"}}}'

TypeScript (@pipeworx/sdk)

import { Pipeworx } from '@pipeworx/sdk';
const pipeworx = new Pipeworx();

const result = await pipeworx.call('usa_spending_trends', {
  "keywords": [
    "artificial intelligence"
  ],
  "start_date": "2020-01-01",
  "end_date": "2024-12-31",
  "group": "fiscal_year"
});

More examples

{
  "keywords": [
    "renewable energy"
  ],
  "agency": "Department of Energy",
  "start_date": "2023-01-01",
  "end_date": "2024-12-31",
  "group": "quarter"
}

Response shape

Always returns: group, data_points

FieldTypeDescription
groupstringTime grouping used (fiscal_year, quarter, or month)
data_pointsarraySpending data points over time
Full JSON Schema
{
  "type": "object",
  "properties": {
    "group": {
      "type": "string",
      "description": "Time grouping used (fiscal_year, quarter, or month)"
    },
    "data_points": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "fiscal_year": {
            "type": "string",
            "description": "Fiscal year for this data point"
          },
          "quarter": {
            "type": [
              "string",
              "null"
            ],
            "description": "Fiscal quarter if grouped by quarter"
          },
          "month": {
            "type": [
              "string",
              "null"
            ],
            "description": "Month if grouped by month"
          },
          "amount": {
            "type": "number",
            "description": "Aggregated spending amount for this period"
          }
        },
        "required": [
          "fiscal_year",
          "quarter",
          "month",
          "amount"
        ]
      },
      "description": "Spending data points over time"
    }
  },
  "required": [
    "group",
    "data_points"
  ]
}

Connect

Add this to your MCP client config, or use one-click install buttons:

{
  "mcpServers": {
    "usaspending": {
      "url": "https://gateway.pipeworx.io/usaspending/mcp"
    }
  }
}

See Getting Started for client-specific install steps.

Regenerated from source · build August 8, 2026