# USAspending (Federal Spending) MCP

> USAspending (Federal Spending) analyzes US federal spending data, letting you query agency budgets, track contract awards, and map financial flows across any geography directly via your agent. This server gives you deep visibility into how the U.S. government allocates its budget—from high-level department overviews to specific sub-agency obligations and transaction records. You can filter millions of federal grants and contracts using advanced criteria based on recipients, locations, or time periods.

## Overview
- **Category:** industry-titans
- **Price:** Free
- **Tags:** federal-spending, budget-analysis, transparency, financial-data, public-sector, award-tracking

## Description

**USAspending MCP Server - Federal Spending Analysis**

Listen up. This server connects you directly to the official USAspending database. Your agent uses it to pull real-time financial data showing exactly how the U.S. government spends its cash. You're not just looking at totals; you're tracking every single dollar, from major department budgets down to a specific transaction record. It gives you deep visibility into federal money flows.

**Agency Deep Dives and Budget Status**
You wanna know what an entire department's up to? You pull a general summary page for any major agency using `get_agency_overview`. For the full picture, your agent can retrieve detailed budgetary resources and current obligation amounts across multiple fiscal years via `get_agency_budgetary_resources`, or it can summarize all transactions tied to one specific federal group with `get_agency_awards`. If you're looking at a 'top tier' department, `get_toptier_agencies` gives you the key metrics for all designated government giants. To drill down further, you can use `get_agency_sub_agencies` to list every internal office or sub-agency under that big department and see exactly how much money they've obligated. You also get a count of different award types an agency managed in a given year using `get_agency_awards_count`. For agencies handling emergency situations, you can run dedicated checks: `get_disaster_overview` gives broad insights into general disaster funding, and `get_disaster_agency_spending` focuses on specific spending related to those emergencies. You'll also get the aggregated obligation and outlay amounts for awards issued after a crisis using `get_disaster_award_amount`.

**Tracking Specific Awards and Money Flows**
You can track everything that happens with any single contract or grant. Use `get_award` to pull all the detailed info on one federal award record, including its original funding source via `get_award_funding`. You wanna see what kind of money it is? `get_award_types` maps out different categories of awards for you. If an award has sub-contracts, you use `get_subawards` to list those details that fall under the main parent agreement. To get the granular breakdown, your agent lists specific financial transactions against a parent award using `get_transactions`. You can also check how many new awards came in over time by running `search_new_awards_over_time`, or you can find out which agency awarded an amount of money at a glance with `get_agency_awards`.

**Filtering Data Across Scope, Location, and Time**
The data is massive, so you gotta filter it down. You don't wanna look at everything; you want to know where the cash went. Use `search_spending_by_geography` to find and filter spending amounts specifically by state, county, or congressional district—it pinpoints exactly where money landed. For a historical view, run `search_spending_over_time` to aggregate dollar amounts across different years. You can also search for federal awards using multiple criteria with `search_spending_by_award`, or group all spending data by category, agency type, or recipient type for visualization purposes via `search_spending_by_category`. When you need to narrow down the recipients, your agent uses `autocomplete_recipient` and then pulls basic details about them with `get_recipient`, or gets deep info on their corporate structure using `get_recipient_children`.

**Data Utility and Downloads**
If you're working with millions of records, you gotta get the data out. Your agent can generate a single ZIP file download covering awards, subawards, and transactions for any search query via `download_search`. If you just need one type of record, you can make a big package containing all selected award data—including subawards—and zip it up in CSV format using `bulk_download_awards`. You can also check on those large downloads anytime with `get_download_status`. Need to autocomplete something? Use `autocomplete_awarding_agency` for agency names, or `autocomplete_location` when searching by geography. For definitions, the server gives you `get_glossary` and `autocomplete_glossary` to make sure you're using the right terminology; it also lists all available glossary terms via `get_data_dictionary`. Finally, if you just wanna see who's in the system, `list_recipients` returns the full list of every entity recorded as a recipient.

## Tools

### autocomplete_awarding_agency
Suggests full names for federal agencies matching a search text.

### autocomplete_glossary
Provides definitions and suggestions based on glossary terms you type in.

### autocomplete_location
Suggests specific states, counties, or districts when searching for geography.

### autocomplete_recipient
Provides names and Unique Entity Identifiers (UEI) for recipients based on search text.

### bulk_download_awards
Creates a ZIP file containing all selected award data, including subawards, in CSV format.

### download_search
Generates a single ZIP file download covering awards, subawards, and transactions for a search query.

### get_agency_awards_count
Counts the number of different award types for an agency within a specified fiscal year.

### get_agency_awards
Summarizes all transactions and obligations related to a specific federal agency.

### get_agency_budgetary_resources
Retrieves detailed budgetary resources and obligations totals for an agency by fiscal year.

### get_agency_overview
Pulls a general summary page of data for any major federal agency.

### get_agency_sub_agencies
Lists all offices and sub-agencies under an agency, showing how much money they've obligated.

### get_award_funding
Shows the specific federal account and agency funding details for an award.

### get_award
Retrieves detailed information about a single federal award record.

### get_award_types
Maps out different types of awards by grouping them into categories.

### get_data_dictionary
Outputs the JSON structure used for the Rosetta Crosswalk Data Dictionary, defining data fields.

### get_disaster_agency_spending
Provides spending insights specifically for agencies receiving disaster funding.

### get_disaster_award_amount
Aggregates the obligation and outlay amounts for awards issued in response to disasters.

### get_disaster_overview
Gives a broad overview of spending related to general disaster or emergency funding.

### get_download_status
Checks the current status of any large data download job you requested.

### get_glossary
Lists all available glossary terms and their official definitions used in the database.

### get_recipient_children
Gets detailed recipient information based on a provided identifier key.

### get_recipient_state
Provides basic geographic information for a specified state.

### get_recipient
Retrieves basic details about an individual recipient listed in the database.

### get_subawards
Lists all sub-award details that fall under a single, main parent award.

### get_toptier_agencies
Retrieves data for all designated 'top tier' government agencies and their key metrics.

### get_transactions
Lists specific financial transactions that occurred against a parent award.

### list_recipients
Returns the full list of all entities recorded as recipients in the database.

### search_new_awards_over_time
Lists time periods and counts how many new awards were issued during those specific times.

### search_spending_by_award
Allows you to search and filter for federal awards using multiple criteria.

### search_spending_by_category
Groups spending data by category, agency, or recipient type for visualization purposes.

### search_spending_by_geography
Finds and filters spending amounts specifically by state, county, or congressional district.

### search_spending_over_time
Aggregates transaction dollar amounts over different historical time periods.

## Prompt Examples

**Prompt:** 
```
Get the agency overview for the Department of Energy using toptier code 089.
```

**Response:** 
```
I've retrieved the overview for the Department of Energy (089). For the current fiscal year, they have total budgetary resources of $X billion and have obligated $Y billion across various programs.
```

**Prompt:** 
```
List all sub-agencies and their obligated amounts for the Department of Justice (toptier code 015).
```

**Response:** 
```
The Department of Justice (015) has several sub-agencies. The Federal Bureau of Investigation (FBI) has obligated $A, while the Drug Enforcement Administration (DEA) has obligated $B. Would you like a full breakdown?
```

**Prompt:** 
```
Search for spending by geography for the state of Texas in fiscal year 2023.
```

**Response:** 
```
In fiscal year 2023, federal spending in Texas was distributed across various counties. Harris County received the highest amount at $C, followed by Dallas County at $D. Most of this was categorized under 'Contracts'.
```

## Capabilities

### Get Agency Budgetary Status
Retrieves an agency's total available budget and current obligation amounts across specified fiscal years.

### Map Spending by Location
Filters and aggregates spending data based on specific states, counties, or congressional districts.

### Track Specific Awards
Retrieves full details for a single federal award, including its funding source and associated sub-awards.

### List Agency Components
Identifies all internal offices or sub-agencies within a department and reports their obligated spending amounts.

### Bulk Export Data Sets
Generates ZIP files containing large data sets of awards, transactions, or subawards in CSV format for external analysis.

### Analyze Disaster Funding
Provides dedicated insights into emergency and disaster-related spending across government agencies.

## Use Cases

### Investigating State-Level Spending Discrepancies
A policy researcher wants to know if a certain state, like Florida, is getting its fair share of disaster funds. They start with `get_disaster_overview` to see the national picture, then run `search_spending_by_geography` specifically for their state and compare it against historical spending found via `search_spending_over_time`. The agent compiles a report showing the exact percentage increase or decrease.

### Tracing Contract Funding Chains
A journalist finds an award number. To write a story, they use `get_award` to get basic details. They then run `get_award_funding` to pinpoint the source account and agency funding. Finally, running `get_subawards` reveals all the smaller contractors involved in that single mega-contract.

### Comparing Department Budgets
A consultant needs to compare two major departments—say, Homeland Security and Defense—for budgetary health. They run `get_agency_budgetary_resources` for both using different fiscal years and then use `get_agency_sub_agencies` on each one to see which department's internal components are spending the most.

### Analyzing Small Business Grant Recipients
A small business advocate wants a list of who received grants. They run `list_recipients` and filter by recipient type, then use `autocomplete_recipient` to check for specific company names. To verify the spending, they might run `search_spending_by_award` against those recipients.

## Benefits

- You can calculate spending patterns by category grouping using `search_spending_by_category`. This moves beyond simple totals and shows where the funds are allocated conceptually.
- Tracking geographic distribution is easy. Use `search_spending_by_geography` to instantly see how federal money broke down across counties or states, eliminating manual map cross-referencing.
- Need a detailed financial history? The tools let you pull both total budgets (`get_agency_budgetary_resources`) and the specific transactions that make up those numbers (`get_transactions`).
- When investigating major contracts, use `get_award` combined with `get_subawards`. This shows not only the main grant amount but also every small project funded beneath it.
- You don't have to download everything. If you just need a summary of an agency’s overall health and obligations, run `get_agency_overview`; it gives you the top line in seconds.

## How It Works

The bottom line is, you don't have to manually click through agency sites or download massive files; your AI client handles the complex data retrieval chain for you.

1. Subscribe to the USAspending server. If you hit rate limits, provide your API key.
2. Prompt your agent with a research question (e.g., 'How much did Texas receive in 2023?').
3. The agent executes multiple tools—like `search_spending_by_geography` and then `get_award`—and synthesizes the final answer.

## Frequently Asked Questions

**How do I see all funding sources for a specific contract using get_award_funding?**
Run `get_award_funding` and provide the award ID. This function returns the exact federal account code, agency responsible, and the source of the money used for that particular award.

**Can I track spending by state or county using search_spending_by_geography?**
Yes. Use `search_spending_by_geography` and specify the desired state, county, or congressional district. The tool aggregates all relevant transactions for that exact region.

**What is the difference between get_agency_awards and search_spending_by_award?**
`get_agency_awards` gives a summary of obligations and transactions for an entire agency. `search_spending_by_award` lets you narrow down the focus using specific criteria like recipient names or award types.

**How do I see what sub-offices are spending money under one department? Use get_agency_sub_agencies.**
Run `get_agency_sub_agencies` and specify the parent agency ID. This lists every internal office, along with the specific obligated dollar amounts for each.

**I need to see what new contracts were issued over time. Use search_new_awards_over_time.**
The `search_new_awards_over_time` tool lists periods and counts the number of awards that were newly created in those specific time frames.

**What should I do if I get an error when running `get_agency_overview`?**
First, verify your USAspending API Key is active and correctly configured. If the key works but you hit an error, it usually means you've reached a rate limit. You need to use the provided API Key for high-volume querying to keep the connection stable.

**How do I understand all the field codes before running complex searches like `search_spending_by_category`?**
`get_data_dictionary` provides the full JSON structure of the Rosetta Crosswalk Data Dictionary. This tool lets your agent map specific fields and data types correctly, which prevents inaccurate queries and improves search results.

**For processing huge datasets, should I use `bulk_download_awards` or run many individual searches?**
You should use `bulk_download_awards`. It generates a single ZIP file containing all requested award data in CSV format. This is significantly faster for offline analysis than making dozens of iterative API calls.

**How do I get an overview of a specific agency's spending?**
Use the `get_agency_overview` tool by providing the agency's toptier code. The agent will return high-level data including total obligations and budgetary resources.

**Can I see which sub-agencies are spending the most within a department?**
Yes! The `get_agency_sub_agencies` tool lists all sub-agencies and offices associated with a toptier agency, along with their respective obligated amounts.

**Is it possible to filter federal awards by geographic location?**
Absolutely. Use `search_spending_by_geography` to aggregate spending data by state, county, or district, or use `search_spending_by_award` with geographic filters.