Economics
Data source: USASpending.gov
MCP Protocol
Endpoint
https://context.gnist.ai/mcp/usaspending/
claude_desktop_config.json
{
"mcpServers": {
"gnist-usaspending": {
"url": "https://context.gnist.ai/mcp/usaspending/",
"headers": {
"Gnist-API-Key": "YOUR_API_KEY"
}
}
}
}
Shell
curl -X POST "https://context.gnist.ai/mcp/usaspending/" \
-H "Content-Type: application/json" \
-H "Accept: application/json, text/event-stream" \
-H "Gnist-API-Key: YOUR_API_KEY" \
-d '{"jsonrpc": "2.0", "method": "tools/call", "id": 1, "params": {"name": "search_awards", "arguments": {"query": "example"}}}'
REST API
API Root
https://context.gnist.ai/rest/usaspending/
6 endpoints available:
GET /rest/usaspending/search_awardsGET /rest/usaspending/get_awardGET /rest/usaspending/get_recipientGET /rest/usaspending/get_agency_spendingGET /rest/usaspending/spending_by_geographyGET /rest/usaspending/report_feedback
Shell
curl "https://context.gnist.ai/rest/usaspending/search_awards?query=example" \ -H "Gnist-API-Key: YOUR_API_KEY"
Python
import httpx
resp = httpx.get(
"https://context.gnist.ai/rest/usaspending/search_awards",
headers={"Gnist-API-Key": "YOUR_API_KEY"},
params={
"query": "example"
},
)
print(resp.json())
Command Line
Command
gc usaspending
CLI documentation will be available when the GnistAI SDK is published.
Install
pip install gnistai
Available Tools (6)
search_awardsSearch USASpending.gov for federal awards (contracts, grants, loans, direct payments).
| Parameter | Type | Required | Description |
|---|---|---|---|
query | string | required | Keywords to search for (e.g. "Lockheed Martin", "cybersecurity", "COVID-19 relief"). |
award_type | any | optional | Filter by award category. Values: "contracts" (default), "grants", "loans", "direct_payments". |
agency | any | optional | Filter by awarding agency name (e.g. "Department of Defense", "Department of Health and Human Services"). |
date_from | any | optional | Only include awards starting on or after this date (YYYY-MM-DD). |
date_to | any | optional | Only include awards starting on or before this date (YYYY-MM-DD). |
limit | integer | optional | Number of results to return (1–50, default 10). Sorted by award amount descending. (default: 10) |
get_awardFetch detailed information for a specific federal award.
| Parameter | Type | Required | Description |
|---|---|---|---|
award_id | string | required | The generated_unique_award_id or generated_internal_id from search results. |
get_recipientSearch for or fetch a federal award recipient (contractor, grantee, etc.).
| Parameter | Type | Required | Description |
|---|---|---|---|
keyword | any | optional | Recipient name or keyword to search (e.g. "Raytheon", "Johns Hopkins"). |
recipient_id | any | optional | Specific recipient hash ID for full profile lookup (e.g. "6cf5fb1b-4988-d087-5dc1-70939d8fc6c4-C"). |
limit | integer | optional | Number of search results (1–50, default 10). Ignored when using recipient_id. (default: 10) |
get_agency_spendingFetch budgetary resources for a US federal agency.
| Parameter | Type | Required | Description |
|---|---|---|---|
agency_code | string | required | Three-digit toptier agency code (e.g. "097" for DoD). |
fiscal_year | any | optional | Federal fiscal year (Oct–Sep). Omit for most recent available. |
spending_by_geographyAggregate federal spending by geographic area (state, county, or congressional district).
| Parameter | Type | Required | Description |
|---|---|---|---|
keywords | list[string] | required | Search terms to filter spending (e.g. ["cybersecurity"], ["COVID-19", "relief"]). |
geo_layer | string | optional | Geographic granularity. Values: "state", "county", "district" (congressional district). Default "state". (default: "state") |
scope | string | optional | What location to aggregate by. Values: "place_of_performance" (where work happens), "recipient_location" (where recipient is based). Default "place_of_performance". (default: "place_of_performance") |
award_type | any | optional | Filter by category: "contracts", "grants", "loans", "direct_payments". Omit for all types. |
date_from | any | optional | Start date filter (YYYY-MM-DD). |
date_to | any | optional | End date filter (YYYY-MM-DD). |
report_feedbackReport a bug, feature request, or general feedback for this data source.
| Parameter | Type | Required | Description |
|---|---|---|---|
feedback | string | required | |
feedback_type | string | optional | (default: "general") |