Skip to main content
Glama

usaspending-mcp-server

Spending by Geography

usaspending_spending_by_geography
Read-onlyIdempotent

Aggregate federal spending by state, county, or congressional district. Useful for per-capita analysis, regional comparisons, and mapping federal investment patterns. Geographic filters accept FIPS codes and 2-letter state abbreviations — NOT place names. Resolve place names to FIPS codes using a geocoding server (Census or OpenStreetMap) before applying location filters. Chain per-capita results with Census population data for meaningful comparisons.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitNoMaximum geographic areas to return, ranked by aggregated_amount descending (1–500). The upstream endpoint is not paginated — it returns every matching area in one response — so this caps client-side. A nationwide county query matches over 3,000 areas.
scopeYesWhich location to aggregate by: place_of_performance (where work is done) or recipient_location (where the recipient is based)
filtersNoOptional filters to scope the spending aggregation
geo_layerYesGeographic granularity: state (50 states), county (county-level), or district (congressional district)
subawardsNoInclude subaward data instead of prime award data

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
capNoThe limit that was applied.
errorNoPresent when the call failed. Absent on success.
scopeNoLocation scope used for aggregation
shownNoNumber of geographic areas returned.
totalNoNumber of geographic areas returned
noticeNoRecovery hint when results are empty — suggests how to broaden filters. Absent when results are present.
resultsNoSpending totals by geographic area
geo_layerNoGeographic granularity used
truncatedNoTrue when the area list was capped at limit.
area_countNoNumber of geographic areas returned
applied_scopeNoLocation scope applied: place_of_performance or recipient_location
applied_keywordsNoKeyword filters applied (comma-separated)
applied_geo_layerNoGeographic granularity applied: state, county, or district
truncationCeilingNoObligation amount of the lowest-ranked area shown — an upper bound on omitted ones.
applied_agency_nameNoAwarding agency name filter applied
applied_naics_codesNoNAICS code filters applied (comma-separated)
total_areas_availableNoNumber of geographic areas the filters matched, before limit was applied
applied_time_period_endNoEnd date filter applied (YYYY-MM-DD)
applied_time_period_startNoStart date filter applied (YYYY-MM-DD)
applied_award_type_defaultNoDisclosure that no filters were supplied, so award_type_codes defaulted to the complete set. Absent when the caller supplied at least one filter.

TDQS

A4.4/5.0
Behavior4/5

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

Annotations declare readOnlyHint, openWorldHint, and idempotentHint, covering safety and idempotency. The description adds non-obvious behavior: 'The upstream endpoint is not paginated — it returns every matching area in one response — so this caps client-side. A nationwide county query matches over 3,000 areas.' This alerts the agent to response size and limit semantics, which is value beyond the annotations. No contradiction exists.

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 four sentences with no redundant phrasing. The main purpose is front-loaded, followed by use cases, a critical input format warning, and a usage tip. Every sentence earns its place, and the structure is easy to scan.

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?

The tool has 5 parameters, a nested filters object, and an output schema (not shown but indicated). The description covers typical applications, the non-pagination behavior, and the prerequisite of FIPS resolution. It does not describe return value shape, but the output schema covers that. For a moderately complex aggregation tool, this is complete enough; a 4 reflects minor gaps like missing explicit notes on combining filters.

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 compensates further by explaining the FIPS/abbreviation constraint for geographic filters and pointing out the limit's client-side capping behavior with a concrete scale example. This adds practical meaning beyond the schema's per-field descriptions, particularly for the filters object.

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 opens with a specific verb and resource: 'Aggregate federal spending by state, county, or congressional district.' This clearly distinguishes it from sibling tools like spending_by_category (categories) and spending_over_time (time series). The resource and granularity are explicit, leaving no ambiguity about what the tool does.

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 use case guidance ('per-capita analysis, regional comparisons, and mapping federal investment patterns') and instructs on prerequisite steps ('Resolve place names to FIPS codes using a geocoding server'). It does not explicitly name alternative tools or state when not to use it, but the context is strong enough to guide an agent. A 4 is appropriate because it offers actionable usage conditions without explicit exclusions.

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.

TDQS

A4.3/5.0
Disambiguation5/5

Each tool targets a distinct entity or operation: agency, award, subaward, transaction, federal account, recipient, and various spending breakdowns. Even similar-sounding tools like get_award_federal_accounts vs get_federal_account are clearly separated by their core purpose (award funding sources vs account budget details).

Naming Consistency4/5

Almost all tools follow the usaspending_<verb>_<object> pattern (e.g., get_award, search_recipients). The spending_* series breaks the verb-noun convention but is internally consistent. Minor deviation lowers the score slightly.

Tool Count4/5

At 18 tools, this is on the higher end of reasonable but each tool maps to a distinct USAspending API endpoint and covers a different aspect of federal spending. The count is justified by the breadth of the domain, though it feels slightly heavy.

Completeness5/5

The surface covers award search/detail, agency navigation, federal accounts, recipients, subawards, transactions, IDVs, and multiple spending aggregations (category, geography, time, disaster). No obvious dead ends: all ID-producing tools have corresponding lookup tools, and common workflows like award→federal account→breakdown are fully supported.