Serveur MCP

usaspending-mcp-server

io.github.cyanheads/usaspending-mcp-server

Ce que fait ce MCP

Searches and analyzes US federal awards, recipients, agencies, accounts, transactions, subawards, geography, and spending trends from USAspending.gov.

usaspending_autocomplete_filters
Autocomplete Codes and Names
Look up valid code values for filter fields by searching free-text descriptions. Use the type parameter to select the lookup table: naics (NAICS industry codes), psc (product/service codes), cfda (CFDA/Assistance Listing program numbers), awarding_agency (agency names and IDs), or recipient (recipient names with UEI/DUNS). Call this before filtering awards when you know a description but not the exact code. Returns matching codes and names for use in other tool filters.
Lecture seule Accès externe Idempotent
Schéma d’entrée
{'type': 'object', '$schema': 'https://json-schema.org/draft/2020-12/schema', 'required': ['type', 'search_text'], 'properties': {'type': {'enum': ['naics', 'psc', 'cfda', 'awarding_agency', 'recipient'], 'type': 'string', 'description': 'Lookup table to search: naics (industry codes), psc (product/service codes), cfda (Assistance Listing program numbers, for usaspending_search_awards assistance_listings), awarding_agency (agency names), recipient (recipient names)'}, 'limit': {'type': 'integer', 'default': 10, 'maximum': 500, 'minimum': 1, 'description': 'Maximum number of results to return (1â\x80\x93500), enforced client-side. The recipient lookup unions three upstream match buckets (name, UEI, DUNS) and can return up to 3x this value, so its results are capped to this limit before returning â\x80\x94 the cap keeps them in bucket order, so name matches fill the page first and identifier matches appear only in whatever room is left. To resolve a specific UEI or DUNS, pass the identifier itself as search_text. naics/psc/cfda/awarding_agency honor this limit exactly.'}, 'search_text': {'type': 'string', 'minLength': 1, 'description': 'Free-text search string â\x80\x94 use a description, keyword, or partial code to find matches'}}, 'additionalProperties': False}
Schéma de sortie
{'type': 'object', 'anyOf': [{'not': {'required': ['error']}, 'required': ['type', 'search_text', 'results', 'total', 'lookup_type', 'query', 'result_count']}, {'required': ['error']}], '$schema': 'https://json-schema.org/draft/2020-12/schema', 'properties': {'cap': {'type': 'number', 'description': 'The limit that was applied.'}, 'type': {'type': 'string', 'description': 'Lookup table searched'}, 'error': {'type': 'object', 'required': ['code', 'message'], 'properties': {'code': {'type': 'integer', 'maximum': 9007199254740991, 'minimum': -9007199254740991, 'description': 'JSON-RPC error code for this failure.'}, 'data': {'type': 'object', 'properties': {'reason': {'type': 'string', 'examples': ['no_match', 'api_unavailable', 'api_timeout'], 'description': 'Machine-readable failure mode. Declared by this tool: `no_match`: No codes or names matched the search text. `api_unavailable`: USAspending.gov API is unreachable or returns an error. `api_timeout`: USAspending.gov did not respond before the request deadline elapsed. Other values are possible when a failure originates below the handler.'}, 'recovery': {'type': 'object', 'required': ['hint'], 'properties': {'hint': {'type': 'string'}}, 'description': 'Actionable next step for the caller.', 'additionalProperties': {}}, 'retryable': {'type': 'boolean', 'description': 'Whether retrying may succeed.'}}, 'additionalProperties': {}}, 'message': {'type': 'string', 'description': 'Human-readable description of what went wrong.'}}, 'description': 'Present when the call failed. Absent on success.', 'additionalProperties': {}}, 'query': {'type': 'string', 'description': 'Search text sent to the autocomplete API'}, 'shown': {'type': 'number', 'description': 'Number of results returned.'}, 'total': {'type': 'number', 'description': 'Number of results returned'}, 'results': {'type': 'array', 'items': {'type': 'object', 'properties': {'id': {'type': 'string', 'description': 'Numeric or string ID (for the awarding_agency type)'}, 'uei': {'type': 'string', 'description': 'Unique Entity Identifier (SAM.gov) â\x80\x94 recipient type only; populated when the search text matches a UEI'}, 'code': {'type': 'string', 'description': 'Code value (NAICS code, PSC code, Assistance Listing/CFDA number, or agency code); use this in filter parameters â\x80\x94 an Assistance Listing number goes in usaspending_search_awards assistance_listings'}, 'duns': {'type': 'string', 'description': 'DUNS number (legacy) â\x80\x94 recipient type only; populated when the search text matches a DUNS'}, 'name': {'type': 'string', 'description': 'Human-readable name or description'}}, 'description': 'Matched entry â\x80\x94 code/name for code lookups, name plus optional UEI/DUNS for recipients', 'additionalProperties': False}, 'description': 'Matching codes and names'}, 'truncated': {'type': 'boolean', 'description': 'True when results were capped at the limit.'}, 'lookup_type': {'type': 'string', 'description': 'Lookup table that was searched'}, 'search_text': {'type': 'string', 'description': 'Search text used'}, 'result_count': {'type': 'number', 'description': 'Number of matching results returned'}}, 'additionalProperties': False}
usaspending_disaster_spending
Disaster and Emergency Spending
Fetch disaster and emergency supplemental spending (COVID-19, hurricanes, infrastructure law, etc.) broken down by agency, CFDA assistance program, recipient, or geography. Use the dimension parameter to select the breakdown axis: overview (top-level totals), agency, cfda, recipient, or geography. Filter by DEF codes (Disaster/Emergency Funding codes) to isolate a specific emergency appropriation. DEF codes appear in usaspending_get_award account_obligations_by_defc and usaspending_get_agency def_codes fields.
Lecture seule Accès externe Idempotent
Schéma d’entrée
{'type': 'object', '$schema': 'https://json-schema.org/draft/2020-12/schema', 'required': ['dimension'], 'properties': {'page': {'type': 'integer', 'default': 1, 'maximum': 9007199254740991, 'minimum': 1, 'description': 'Page number (1-based)'}, 'limit': {'type': 'integer', 'default': 10, 'maximum': 100, 'minimum': 1, 'description': 'Maximum results per page (1â\x80\x93100). Applies to the agency, cfda, and recipient dimensions; ignored for overview and geography, which are not paginated.'}, 'filters': {'type': 'object', 'properties': {'def_codes': {'type': 'array', 'items': {'type': 'string'}, 'description': 'DEF codes to filter by (e.g., ["L", "M", "N", "O", "P"] for COVID-19). Required for all dimensions except overview â\x80\x94 the upstream API returns HTTP 422 when omitted for agency, cfda, recipient, and geography breakdowns. DEF codes appear in usaspending_get_agency def_codes fields.'}, 'geo_layer': {'enum': ['state', 'county'], 'type': 'string', 'description': 'Geographic layer for geography dimension (state or county)'}, 'award_type_codes': {'type': 'array', 'items': {'type': 'string'}, 'description': 'Award type code filters'}}, 'description': 'Filters â\x80\x94 def_codes is required for all non-overview dimensions (agency, cfda, recipient, geography)'}, 'dimension': {'enum': ['overview', 'agency', 'cfda', 'recipient', 'geography'], 'type': 'string', 'description': 'Breakdown axis: overview (top-level totals and DEF code funding), agency (by awarding agency), cfda (by assistance program), recipient (by recipient), geography (by state/county)'}, 'spending_type': {'enum': ['award', 'total'], 'type': 'string', 'default': 'award', 'description': 'Data type for the agency dimension: award (award-level obligations and outlays) or total (includes direct non-award spending, plus total budgetary resources). Ignored for cfda, recipient, and overview, which report award-level amounts either way; the geography dimension is not user-controllable and always reports obligation-based amounts.'}}, 'additionalProperties': False}
Schéma de sortie
{'type': 'object', 'anyOf': [{'not': {'required': ['error']}, 'required': ['dimension', 'spending_type', 'results', 'applied_dimension']}, {'required': ['error']}], '$schema': 'https://json-schema.org/draft/2020-12/schema', 'properties': {'cap': {'type': 'number', 'description': 'The result-set ceiling the upstream applied.'}, 'error': {'type': 'object', 'required': ['code', 'message'], 'properties': {'code': {'type': 'integer', 'maximum': 9007199254740991, 'minimum': -9007199254740991, 'description': 'JSON-RPC error code for this failure.'}, 'data': {'type': 'object', 'properties': {'reason': {'type': 'string', 'examples': ['api_unavailable', 'api_timeout'], 'description': 'Machine-readable failure mode. Declared by this tool: `api_unavailable`: USAspending.gov API is unreachable or returns an error. `api_timeout`: USAspending.gov did not respond before the request deadline elapsed. Other values are possible when a failure originates below the handler.'}, 'recovery': {'type': 'object', 'required': ['hint'], 'properties': {'hint': {'type': 'string'}}, 'description': 'Actionable next step for the caller.', 'additionalProperties': {}}, 'retryable': {'type': 'boolean', 'description': 'Whether retrying may succeed.'}}, 'additionalProperties': {}}, 'message': {'type': 'string', 'description': 'Human-readable description of what went wrong.'}}, 'description': 'Present when the call failed. Absent on success.', 'additionalProperties': {}}, 'shown': {'type': 'number', 'description': 'Number of results returned on this page.'}, 'notice': {'type': 'string', 'description': 'Caveat explaining a capped total and how to bring the set under the cap.'}, 'totals': {'type': 'object', 'properties': {'outlay': {'type': 'number', 'description': 'Outlays in USD across the whole matching result set'}, 'obligation': {'type': 'number', 'description': 'Obligations in USD across the whole matching result set'}, 'award_count': {'type': 'number', 'description': 'Number of awards across the result set (award-level breakdowns)'}, 'total_budgetary_resources': {'type': 'number', 'description': 'Total budgetary resources in USD across the result set (agency dimension with spending_type total)'}}, 'description': 'Totals across every matching row, as reported upstream â\x80\x94 not a sum of this page. Present for the agency, cfda, and recipient dimensions; the members depend on dimension and spending_type. Absent for overview and geography.', 'additionalProperties': False}, 'results': {'type': 'array', 'items': {'type': 'object', 'properties': {'id': {'type': 'string', 'description': 'Item ID. On the recipient dimension, a recipient hash ID for usaspending_get_recipient â\x80\x94 the recipient-level (-R) ID when the recipient has several.'}, 'code': {'type': 'string', 'description': 'Code (agency code, CFDA number, DEF code, etc.)'}, 'name': {'type': 'string', 'description': 'Item name or description'}, 'outlay': {'type': 'number', 'description': 'Outlay amount in USD'}, 'obligation': {'type': 'number', 'description': 'Obligation amount in USD'}, 'per_capita': {'type': 'number', 'description': 'Obligation-based spending per capita in USD (geography dimension)'}, 'population': {'type': 'number', 'description': 'Population of the geographic area (geography dimension)'}, 'shape_code': {'type': 'string', 'description': 'Geographic code (geography dimension)'}, 'award_count': {'type': 'number', 'description': 'Number of awards'}, 'display_name': {'type': 'string', 'description': 'Geographic display name (geography dimension)'}, 'aggregated_amount': {'type': 'number', 'description': 'Obligation-based spending amount in USD (geography dimension)'}, 'face_value_of_loan': {'type': 'number', 'description': 'Face value of loan guarantees in USD (loans spending_type)'}, 'total_budgetary_resources': {'type': 'number', 'description': 'Total budgetary resources in USD for this row (agency dimension with spending_type total)'}}, 'description': 'Disaster spending breakdown entry by dimension (agency, CFDA, recipient, or geography)', 'additionalProperties': False}, 'description': 'Breakdown results (empty for overview dimension)'}, 'overview': {'type': 'object', 'properties': {'award_outlays': {'type': 'number', 'description': 'Total award outlays in USD'}, 'total_outlays': {'type': 'number', 'description': 'Total outlays in USD'}, 'award_obligations': {'type': 'number', 'description': 'Total award obligations in USD'}, 'total_obligations': {'type': 'number', 'description': 'Total obligations in USD'}, 'face_value_of_loans': {'type': 'number', 'description': 'Face value of loan guarantees in USD'}, 'funding_by_def_code': {'type': 'array', 'items': {'type': 'object', 'properties': {'label': {'type': 'string', 'description': 'DEF code label or title'}, 'amount': {'type': 'number', 'description': 'Funding amount in USD for this DEF code'}, 'def_code': {'type': 'string', 'description': 'DEF code'}, 'public_law': {'type': 'string', 'description': 'Public law number'}}, 'description': 'DEF code funding entry with amount and public law reference', 'additionalProperties': False}, 'description': 'Funding amounts broken down by DEF code (emergency appropriation)'}, 'unobligated_balance': {'type': 'number', 'description': 'Unobligated balance in USD'}, 'total_budget_authority': {'type': 'number', 'description': 'Total budget authority in USD across all emergency supplementals'}}, 'description': 'Top-level overview totals (dimension=overview only)', 'additionalProperties': False}, 'dimension': {'type': 'string', 'description': 'Breakdown dimension returned'}, 'truncated': {'type': 'boolean', 'description': 'True when the upstream capped the reachable result set rather than counting it.'}, 'totalCount': {'type': 'number', 'description': 'Total items for paginated dimensions (when available)'}, 'current_page': {'type': 'number', 'description': 'Current page (non-overview dimensions)'}, 'has_next_page': {'type': 'boolean', 'description': 'Whether there are more pages'}, 'page_metadata': {'type': 'object', 'required': ['has_next', 'page', 'limit'], 'properties': {'page': {'type': 'number', 'description': 'Current page'}, 'limit': {'type': 'number', 'description': 'Items per page'}, 'total': {'type': 'number', 'description': 'Total items'}, 'has_next': {'type': 'boolean', 'description': 'Whether there are more pages'}}, 'description': 'Pagination metadata (non-overview dimensions)', 'additionalProperties': False}, 'spending_type': {'type': 'string', 'description': 'Data type returned â\x80\x94 award/total for agency; the requested value echoed for cfda and recipient, whose amounts do not vary with it; obligation for geography; spending for overview'}, 'applied_dimension': {'type': 'string', 'description': 'Breakdown dimension applied'}}, 'additionalProperties': False}
usaspending_get_agency
Get Agency Overview
Fetch an agency's fiscal-year overview including mission, budgetary resources, obligation and outlay totals (for the most recent fiscal year), sub-agency count, and DEF codes for disaster/emergency funding. Also returns a paginated sub-agency breakdown with obligation and transaction counts. Accepts either a 3-digit toptier_code (e.g., 097 for DoD, 012 for Agriculture) or an agency_slug (e.g., department-of-defense) — both appear in usaspending_list_agencies results and award search results.
Lecture seule Idempotent
Schéma d’entrée
{'type': 'object', '$schema': 'https://json-schema.org/draft/2020-12/schema', 'properties': {'page': {'type': 'integer', 'default': 1, 'maximum': 9007199254740991, 'minimum': 1, 'description': 'Sub-agency breakdown page (1-based, 10 per page). Use with sub_agency_page_metadata.has_next to page through the full list.'}, 'agency_slug': {'type': 'string', 'description': 'URL-friendly agency slug (e.g., department-of-defense) â\x80\x94 from usaspending_list_agencies or award search results. Use either toptier_code or agency_slug, not both.'}, 'toptier_code': {'type': 'string', 'description': '3-digit toptier agency code (e.g., 097, 012) â\x80\x94 from usaspending_list_agencies. Use either toptier_code or agency_slug, not both.'}}, 'additionalProperties': False}
Schéma de sortie
{'type': 'object', 'anyOf': [{'not': {'required': ['error']}, 'required': ['sub_agency_page', 'has_more_sub_agencies']}, {'required': ['error']}], '$schema': 'https://json-schema.org/draft/2020-12/schema', 'properties': {'name': {'type': 'string', 'description': 'Agency full name'}, 'error': {'type': 'object', 'required': ['code', 'message'], 'properties': {'code': {'type': 'integer', 'maximum': 9007199254740991, 'minimum': -9007199254740991, 'description': 'JSON-RPC error code for this failure.'}, 'data': {'type': 'object', 'properties': {'reason': {'type': 'string', 'examples': ['agency_not_found', 'missing_input', 'api_unavailable', 'api_timeout'], 'description': 'Machine-readable failure mode. Declared by this tool: `agency_not_found`: No agency found for the given toptier_code or agency_slug. `missing_input`: Neither toptier_code nor agency_slug was provided. `api_unavailable`: USAspending.gov API is unreachable or returns an error. `api_timeout`: USAspending.gov did not respond before the request deadline elapsed. Other values are possible when a failure originates below the handler.'}, 'recovery': {'type': 'object', 'required': ['hint'], 'properties': {'hint': {'type': 'string'}}, 'description': 'Actionable next step for the caller.', 'additionalProperties': {}}, 'retryable': {'type': 'boolean', 'description': 'Whether retrying may succeed.'}}, 'additionalProperties': {}}, 'message': {'type': 'string', 'description': 'Human-readable description of what went wrong.'}}, 'description': 'Present when the call failed. Absent on success.', 'additionalProperties': {}}, 'notice': {'type': 'string', 'description': 'Guidance when the sub-agency breakdown is truncated â\x80\x94 how to page for the rest. Absent when the last page is shown.'}, 'mission': {'type': 'string', 'description': 'Agency mission statement'}, 'website': {'type': 'string', 'description': 'Agency website URL'}, 'agency_id': {'type': 'number', 'description': 'Internal agency ID'}, 'def_codes': {'type': 'array', 'items': {'type': 'object', 'properties': {'code': {'type': 'string', 'description': 'DEF code identifying an emergency supplemental'}, 'title': {'type': 'string', 'description': 'Emergency or disaster title'}, 'public_law': {'type': 'string', 'description': 'Public law number'}}, 'description': 'DEF code entry with public law and title', 'additionalProperties': False}, 'description': 'Disaster/Emergency Funding (DEF) codes applicable to this agency'}, 'fiscal_year': {'type': 'number', 'description': 'Fiscal year the budgetary totals below reflect (most recent available)'}, 'abbreviation': {'type': 'string', 'description': 'Agency abbreviation'}, 'sub_agencies': {'type': 'array', 'items': {'type': 'object', 'properties': {'name': {'type': 'string', 'description': 'Sub-agency name'}, 'abbreviation': {'type': 'string', 'description': 'Sub-agency abbreviation'}, 'new_award_count': {'type': 'number', 'description': 'New awards count'}, 'total_obligations': {'type': 'number', 'description': 'Sub-agency obligation total in USD'}, 'transaction_count': {'type': 'number', 'description': 'Sub-agency transaction count'}}, 'description': 'Sub-agency entry with obligations and transaction counts', 'additionalProperties': False}, 'description': 'Sub-agency breakdown within this toptier agency (one page)'}, 'toptier_code': {'type': 'string', 'description': '3-digit toptier agency code'}, 'outlay_amount': {'type': 'number', 'description': 'Total outlays in USD for the fiscal year'}, 'sub_agency_page': {'type': 'number', 'description': 'Current sub-agency page returned'}, 'obligated_amount': {'type': 'number', 'description': 'Total amount obligated in USD for the fiscal year'}, 'sub_agency_total': {'type': 'number', 'description': 'Total sub-agencies across all pages (when available)'}, 'subtier_agency_count': {'type': 'number', 'description': 'Number of sub-agencies within this toptier agency'}, 'has_more_sub_agencies': {'type': 'boolean', 'description': 'Whether more sub-agency pages are available'}, 'sub_agency_page_metadata': {'type': 'object', 'required': ['page', 'has_next', 'limit'], 'properties': {'page': {'type': 'number', 'description': 'Current sub-agency page number'}, 'limit': {'type': 'number', 'description': 'Sub-agencies per page'}, 'total': {'type': 'number', 'description': 'Total sub-agencies across all pages'}, 'has_next': {'type': 'boolean', 'description': 'Whether more sub-agency pages are available'}}, 'description': 'Pagination metadata for the sub-agency breakdown', 'additionalProperties': False}, 'budgetary_resources_amount': {'type': 'number', 'description': 'Total budgetary resources in USD for the fiscal year'}}, 'additionalProperties': False}
usaspending_get_award
Get Award Details
Fetch full details of a federal award by its generated unique award ID. Returns contract or assistance award data including recipient info, agency hierarchy, period of performance, place of performance, funding account linkages (account_obligations_by_defc), parent IDV information, and subaward count. Use generated_internal_id values from usaspending_search_awards as input. Recipient hashes can be passed to usaspending_get_recipient; NAICS codes can be used in usaspending_search_awards filters. For IDV-category awards (category="idv"), use usaspending_get_idv_awards to list the child contracts and task/delivery orders placed under them.
Lecture seule Idempotent
Schéma d’entrée
{'type': 'object', '$schema': 'https://json-schema.org/draft/2020-12/schema', 'required': ['award_id'], 'properties': {'award_id': {'type': 'string', 'minLength': 1, 'description': 'Generated unique award ID (e.g., CONT_AWD_FA862118F6251_9700_FA862115D6276_9700) â\x80\x94 use generated_internal_id from usaspending_search_awards'}}, 'additionalProperties': False}
Schéma de sortie
{'type': 'object', 'anyOf': [{'not': {'required': ['error']}}, {'required': ['error']}], '$schema': 'https://json-schema.org/draft/2020-12/schema', 'properties': {'cfda': {'type': 'object', 'properties': {'title': {'type': 'string', 'description': 'CFDA program title'}, 'number': {'type': 'string', 'description': 'CFDA/Assistance Listing number'}}, 'description': 'CFDA program (grants/assistance)', 'additionalProperties': False}, 'fain': {'type': 'string', 'description': 'Federal Award Identification Number (for assistance)'}, 'piid': {'type': 'string', 'description': 'Procurement Instrument Identifier (for contracts)'}, 'type': {'type': 'string', 'description': 'Award type code'}, 'error': {'type': 'object', 'required': ['code', 'message'], 'properties': {'code': {'type': 'integer', 'maximum': 9007199254740991, 'minimum': -9007199254740991, 'description': 'JSON-RPC error code for this failure.'}, 'data': {'type': 'object', 'properties': {'reason': {'type': 'string', 'examples': ['award_not_found', 'api_unavailable', 'api_timeout'], 'description': 'Machine-readable failure mode. Declared by this tool: `award_not_found`: No award exists for the given award ID. `api_unavailable`: USAspending.gov API is unreachable or returns an error. `api_timeout`: USAspending.gov did not respond before the request deadline elapsed. Other values are possible when a failure originates below the handler.'}, 'recovery': {'type': 'object', 'required': ['hint'], 'properties': {'hint': {'type': 'string'}}, 'description': 'Actionable next step for the caller.', 'additionalProperties': {}}, 'retryable': {'type': 'boolean', 'description': 'Whether retrying may succeed.'}}, 'additionalProperties': {}}, 'message': {'type': 'string', 'description': 'Human-readable description of what went wrong.'}}, 'description': 'Present when the call failed. Absent on success.', 'additionalProperties': {}}, 'naics': {'type': 'object', 'properties': {'code': {'type': 'string', 'description': 'NAICS industry code'}, 'description': {'type': 'string', 'description': 'NAICS industry description'}}, 'description': 'NAICS code (contracts)', 'additionalProperties': False}, 'category': {'type': 'string', 'description': 'Award category (contract, grant, direct_payment, loan, idv, other)'}, 'recipient': {'type': 'object', 'properties': {'uei': {'type': 'string', 'description': 'Unique Entity Identifier'}, 'location': {'type': 'object', 'properties': {'city_name': {'type': 'string', 'description': 'Recipient city'}, 'state_code': {'type': 'string', 'description': 'Recipient state code'}, 'country_code': {'type': 'string', 'description': 'Recipient country code'}}, 'description': 'Recipient address', 'additionalProperties': False}, 'recipient_id': {'type': 'string', 'description': 'Recipient hash ID â\x80\x94 pass to usaspending_get_recipient for full profile'}, 'business_types': {'type': 'array', 'items': {'type': 'string'}, 'description': 'Recipient business type codes'}, 'recipient_name': {'type': 'string', 'description': 'Recipient legal business name'}, 'parent_recipient_name': {'type': 'string', 'description': 'Parent organization name'}}, 'description': 'Recipient details', 'additionalProperties': False}, 'date_signed': {'type': 'string', 'description': 'Date award was signed (YYYY-MM-DD)'}, 'description': {'type': 'string', 'description': 'Award description'}, 'parent_award': {'type': 'object', 'properties': {'award_id': {'type': 'string', 'description': 'Parent award display ID'}, 'agency_name': {'type': 'string', 'description': 'Parent award agency name'}, 'type_description': {'type': 'string', 'description': 'Parent award type description'}, 'generated_unique_award_id': {'type': 'string', 'description': 'Parent award chaining ID â\x80\x94 pass to usaspending_get_award for parent IDV details'}}, 'description': 'Parent IDV information (contracts only)', 'additionalProperties': False}, 'total_outlays': {'type': 'number', 'description': 'Total outlay amount in USD'}, 'funding_agency': {'type': 'object', 'properties': {'subtier_name': {'type': 'string', 'description': 'Sub-tier funding agency name'}, 'toptier_code': {'type': 'string', 'description': 'Top-tier funding agency code'}, 'toptier_name': {'type': 'string', 'description': 'Top-tier funding agency name'}}, 'description': 'Funding agency hierarchy', 'additionalProperties': False}, 'subaward_count': {'type': 'number', 'description': 'Number of subawards; use with usaspending_get_award_subawards'}, 'awarding_agency': {'type': 'object', 'properties': {'subtier_name': {'type': 'string', 'description': 'Sub-tier agency name'}, 'toptier_code': {'type': 'string', 'description': 'Top-tier agency code'}, 'toptier_name': {'type': 'string', 'description': 'Top-tier agency name'}, 'toptier_slug': {'type': 'string', 'description': 'Top-tier agency slug'}}, 'description': 'Awarding agency hierarchy', 'additionalProperties': False}, 'total_obligation': {'type': 'number', 'description': 'Total obligation amount in USD'}, 'type_description': {'type': 'string', 'description': 'Human-readable award type'}, 'place_of_performance': {'type': 'object', 'properties': {'zip5': {'type': 'string', 'description': 'ZIP code of performance'}, 'city_name': {'type': 'string', 'description': 'City of performance'}, 'state_code': {'type': 'string', 'description': 'State code of performance'}, 'country_code': {'type': 'string', 'description': 'Country code of performance'}}, 'description': 'Place of performance', 'additionalProperties': False}, 'period_of_performance': {'type': 'object', 'properties': {'end_date': {'type': 'string', 'description': 'Performance end date (YYYY-MM-DD)'}, 'start_date': {'type': 'string', 'description': 'Performance start date (YYYY-MM-DD)'}, 'potential_end_date': {'type': 'string', 'description': 'Potential end date including options (YYYY-MM-DD)'}}, 'description': 'Period of performance dates', 'additionalProperties': False}, 'product_or_service_code': {'type': 'object', 'properties': {'code': {'type': 'string', 'description': 'PSC product or service code'}, 'description': {'type': 'string', 'description': 'PSC description'}}, 'description': 'Product or service code (contracts)', 'additionalProperties': False}, 'generated_unique_award_id': {'type': 'string', 'description': 'Generated unique award ID'}, 'base_and_all_options_value': {'type': 'number', 'description': 'Base and all options value in USD (contracts)'}, 'account_obligations_by_defc': {'type': 'array', 'items': {'type': 'object', 'properties': {'code': {'type': 'string', 'description': 'DEF code identifying the emergency supplemental'}, 'amount': {'type': 'number', 'description': 'Obligation amount in USD for this DEF code'}}, 'description': 'DEF code entry with code and obligation amount', 'additionalProperties': False}, 'description': 'Funding breakdown by Disaster/Emergency Funding (DEF) code â\x80\x94 links to disaster appropriations'}}, 'additionalProperties': False}
usaspending_get_award_federal_accounts
Get Award Federal Accounts
List the Treasury federal accounts that funded an award, with the amount obligated from each and the funding agency behind it. This is the award → appropriation link: each row returns federal_account (AGENCY-MAIN format, e.g. 080-0120) to chain into usaspending_get_federal_account for the account budget detail. The award_id must be a generated_unique_award_id — from usaspending_search_awards (generated_internal_id field) or usaspending_get_award. Distinct from usaspending_get_award account_obligations_by_defc, which breaks funding down by Disaster/Emergency Funding code rather than by account. An award_id that does not exist returns an empty list rather than an error.
Lecture seule Idempotent
Schéma d’entrée
{'type': 'object', '$schema': 'https://json-schema.org/draft/2020-12/schema', 'required': ['award_id'], 'properties': {'page': {'type': 'integer', 'default': 1, 'maximum': 9007199254740991, 'minimum': 1, 'description': 'Page number (1-based)'}, 'limit': {'type': 'integer', 'default': 10, 'maximum': 100, 'minimum': 1, 'description': 'Maximum results per page (1â\x80\x93100)'}, 'award_id': {'type': 'string', 'minLength': 1, 'description': 'Award generated_unique_award_id (e.g., CONT_AWD_GSFC0198106DNAS526555_8000_-NONE-_-NONE-) â\x80\x94 use generated_internal_id from usaspending_search_awards or generated_unique_award_id from usaspending_get_award'}}, 'additionalProperties': False}
Schéma de sortie
{'type': 'object', 'anyOf': [{'not': {'required': ['error']}, 'required': ['award_id', 'results', 'page_metadata', 'current_page', 'has_next_page']}, {'required': ['error']}], '$schema': 'https://json-schema.org/draft/2020-12/schema', 'properties': {'error': {'type': 'object', 'required': ['code', 'message'], 'properties': {'code': {'type': 'integer', 'maximum': 9007199254740991, 'minimum': -9007199254740991, 'description': 'JSON-RPC error code for this failure.'}, 'data': {'type': 'object', 'properties': {'reason': {'type': 'string', 'examples': ['api_unavailable', 'api_timeout'], 'description': 'Machine-readable failure mode. Declared by this tool: `api_unavailable`: USAspending.gov API is unreachable or returns an error. `api_timeout`: USAspending.gov did not respond before the request deadline elapsed. Other values are possible when a failure originates below the handler.'}, 'recovery': {'type': 'object', 'required': ['hint'], 'properties': {'hint': {'type': 'string'}}, 'description': 'Actionable next step for the caller.', 'additionalProperties': {}}, 'retryable': {'type': 'boolean', 'description': 'Whether retrying may succeed.'}}, 'additionalProperties': {}}, 'message': {'type': 'string', 'description': 'Human-readable description of what went wrong.'}}, 'description': 'Present when the call failed. Absent on success.', 'additionalProperties': {}}, 'notice': {'type': 'string', 'description': 'Recovery hint when results are empty â\x80\x94 the award_id may not exist or may have no account linkage. Absent when results are present.'}, 'results': {'type': 'array', 'items': {'type': 'object', 'properties': {'account_title': {'type': 'string', 'description': 'Full federal account title'}, 'federal_account': {'type': 'string', 'description': 'Federal account code in AGENCY-MAIN format (e.g., 080-0120) â\x80\x94 pass to usaspending_get_federal_account as account_code for the account budget detail'}, 'funding_agency_id': {'type': 'number', 'description': 'Internal USAspending database ID of the funding agency â\x80\x94 not the toptier code accepted by usaspending_get_agency'}, 'funding_agency_name': {'type': 'string', 'description': 'Name of the funding agency'}, 'funding_agency_slug': {'type': 'string', 'description': 'Funding agency slug (e.g., "national-aeronautics-and-space-administration") â\x80\x94 pass to usaspending_get_agency as agency_slug'}, 'funding_toptier_agency_id': {'type': 'number', 'description': 'Internal USAspending database ID of the funding toptier agency â\x80\x94 not the 3-digit toptier code accepted by usaspending_get_agency'}, 'funding_agency_abbreviation': {'type': 'string', 'description': 'Abbreviation of the funding agency (e.g., "NASA")'}, 'total_transaction_obligated_amount': {'type': 'number', 'description': 'Amount obligated to this award from this federal account in USD'}}, 'description': 'Federal account that funded this award, with obligation and funding agency', 'additionalProperties': False}, 'description': 'Federal accounts funding this award'}, 'award_id': {'type': 'string', 'description': 'Award ID queried'}, 'totalCount': {'type': 'number', 'description': 'Total number of funding accounts across all pages (when available)'}, 'current_page': {'type': 'number', 'description': 'Current page returned'}, 'has_next_page': {'type': 'boolean', 'description': 'Whether there are more pages of funding accounts'}, 'page_metadata': {'type': 'object', 'required': ['page', 'has_next', 'has_previous', 'limit'], 'properties': {'page': {'type': 'number', 'description': 'Current page number'}, 'count': {'type': 'number', 'description': 'Total funding accounts across all pages'}, 'limit': {'type': 'number', 'description': 'Results per page'}, 'has_next': {'type': 'boolean', 'description': 'Whether there are more pages of results'}, 'has_previous': {'type': 'boolean', 'description': 'Whether there are previous pages'}}, 'description': 'Pagination metadata', 'additionalProperties': False}}, 'additionalProperties': False}
usaspending_get_award_subawards
Get Award Subawards
List subaward contracts or grants under a prime federal award. Reveals the sub-contractor or sub-grantee layer — the organizations that actually perform the work. Each row shows the subaward number, amount, description, action date, and recipient. Check subaward_count on usaspending_get_award first to confirm subawards exist before calling this tool.
Lecture seule Idempotent
Schéma d’entrée
{'type': 'object', '$schema': 'https://json-schema.org/draft/2020-12/schema', 'required': ['award_id'], 'properties': {'page': {'type': 'integer', 'default': 1, 'maximum': 9007199254740991, 'minimum': 1, 'description': 'Page number (1-based)'}, 'sort': {'enum': ['subaward_number', 'description', 'action_date', 'amount', 'recipient_name'], 'type': 'string', 'default': 'action_date', 'description': 'Sort field for subawards'}, 'limit': {'type': 'integer', 'default': 10, 'maximum': 100, 'minimum': 1, 'description': 'Maximum subawards per page (1â\x80\x93100)'}, 'order': {'enum': ['asc', 'desc'], 'type': 'string', 'default': 'desc', 'description': 'Sort direction'}, 'award_id': {'type': 'string', 'minLength': 1, 'description': 'Generated unique award ID (generated_internal_id from usaspending_search_awards)'}}, 'additionalProperties': False}
Schéma de sortie
{'type': 'object', 'anyOf': [{'not': {'required': ['error']}, 'required': ['award_id', 'results', 'page_metadata', 'prime_award_id', 'current_page', 'has_next_page']}, {'required': ['error']}], '$schema': 'https://json-schema.org/draft/2020-12/schema', 'properties': {'error': {'type': 'object', 'required': ['code', 'message'], 'properties': {'code': {'type': 'integer', 'maximum': 9007199254740991, 'minimum': -9007199254740991, 'description': 'JSON-RPC error code for this failure.'}, 'data': {'type': 'object', 'properties': {'reason': {'type': 'string', 'examples': ['api_unavailable', 'api_timeout'], 'description': 'Machine-readable failure mode. Declared by this tool: `api_unavailable`: USAspending.gov API is unreachable or returns an error. `api_timeout`: USAspending.gov did not respond before the request deadline elapsed. Other values are possible when a failure originates below the handler.'}, 'recovery': {'type': 'object', 'required': ['hint'], 'properties': {'hint': {'type': 'string'}}, 'description': 'Actionable next step for the caller.', 'additionalProperties': {}}, 'retryable': {'type': 'boolean', 'description': 'Whether retrying may succeed.'}}, 'additionalProperties': {}}, 'message': {'type': 'string', 'description': 'Human-readable description of what went wrong.'}}, 'description': 'Present when the call failed. Absent on success.', 'additionalProperties': {}}, 'notice': {'type': 'string', 'description': 'Guidance when no subawards were returned â\x80\x94 suggests checking subaward_count from usaspending_get_award first. Absent when results are present.'}, 'results': {'type': 'array', 'items': {'type': 'object', 'properties': {'id': {'type': 'number', 'description': 'Subaward internal ID'}, 'amount': {'type': 'number', 'description': 'Subaward amount in USD'}, 'action_date': {'type': 'string', 'description': 'Subaward action date (YYYY-MM-DD)'}, 'description': {'type': 'string', 'description': 'Subaward description'}, 'recipient_uei': {'type': 'string', 'description': 'Sub-recipient Unique Entity Identifier'}, 'recipient_name': {'type': 'string', 'description': 'Subcontractor or sub-grantee name'}, 'subaward_number': {'type': 'string', 'description': 'Subaward number or identifier'}, 'place_of_performance': {'type': 'object', 'properties': {'city': {'type': 'string', 'description': 'City of performance'}, 'state': {'type': 'string', 'description': 'State code'}, 'country': {'type': 'string', 'description': 'Country code'}}, 'description': 'Subaward place of performance', 'additionalProperties': False}}, 'description': 'Subaward record with amount, recipient, and location', 'additionalProperties': False}, 'description': 'List of subawards under this prime award'}, 'award_id': {'type': 'string', 'description': 'Prime award ID queried'}, 'totalCount': {'type': 'number', 'description': 'Total subaward count across all pages (when available)'}, 'current_page': {'type': 'number', 'description': 'Current page returned'}, 'has_next_page': {'type': 'boolean', 'description': 'Whether there are more pages of subawards'}, 'page_metadata': {'type': 'object', 'required': ['has_next', 'page', 'limit'], 'properties': {'page': {'type': 'number', 'description': 'Current page'}, 'limit': {'type': 'number', 'description': 'Subawards per page'}, 'total': {'type': 'number', 'description': 'Total subaward count'}, 'has_next': {'type': 'boolean', 'description': 'Whether there are more pages'}}, 'description': 'Pagination metadata', 'additionalProperties': False}, 'prime_award_id': {'type': 'string', 'description': 'Prime award ID whose subawards were listed'}}, 'additionalProperties': False}
usaspending_get_award_transactions
Get Award Transactions
List individual transactions (contract modifications, grant amendments) on a federal award. Each transaction represents a change event — obligation modifications, performance period extensions, scope changes, etc. Use this to trace the spending history and obligation changes over the life of an award. Award IDs come from usaspending_search_awards (generated_internal_id field).
Lecture seule Idempotent
Schéma d’entrée
{'type': 'object', '$schema': 'https://json-schema.org/draft/2020-12/schema', 'required': ['award_id'], 'properties': {'page': {'type': 'integer', 'default': 1, 'maximum': 9007199254740991, 'minimum': 1, 'description': 'Page number (1-based)'}, 'sort': {'enum': ['action_date', 'federal_action_obligation', 'modification_number'], 'type': 'string', 'default': 'action_date', 'description': 'Sort field for transactions'}, 'limit': {'type': 'integer', 'default': 10, 'maximum': 100, 'minimum': 1, 'description': 'Maximum transactions per page (1â\x80\x93100)'}, 'order': {'enum': ['asc', 'desc'], 'type': 'string', 'default': 'desc', 'description': 'Sort direction'}, 'award_id': {'type': 'string', 'minLength': 1, 'description': 'Generated unique award ID (generated_internal_id from usaspending_search_awards)'}}, 'additionalProperties': False}
Schéma de sortie
{'type': 'object', 'anyOf': [{'not': {'required': ['error']}, 'required': ['award_id', 'results', 'page_metadata', 'queried_award_id', 'current_page', 'has_next_page']}, {'required': ['error']}], '$schema': 'https://json-schema.org/draft/2020-12/schema', 'properties': {'error': {'type': 'object', 'required': ['code', 'message'], 'properties': {'code': {'type': 'integer', 'maximum': 9007199254740991, 'minimum': -9007199254740991, 'description': 'JSON-RPC error code for this failure.'}, 'data': {'type': 'object', 'properties': {'reason': {'type': 'string', 'examples': ['api_unavailable', 'api_timeout'], 'description': 'Machine-readable failure mode. Declared by this tool: `api_unavailable`: USAspending.gov API is unreachable or returns an error. `api_timeout`: USAspending.gov did not respond before the request deadline elapsed. Other values are possible when a failure originates below the handler.'}, 'recovery': {'type': 'object', 'required': ['hint'], 'properties': {'hint': {'type': 'string'}}, 'description': 'Actionable next step for the caller.', 'additionalProperties': {}}, 'retryable': {'type': 'boolean', 'description': 'Whether retrying may succeed.'}}, 'additionalProperties': {}}, 'message': {'type': 'string', 'description': 'Human-readable description of what went wrong.'}}, 'description': 'Present when the call failed. Absent on success.', 'additionalProperties': {}}, 'notice': {'type': 'string', 'description': 'Guidance when no transactions were returned â\x80\x94 helps confirm the award_id is a valid generated_internal_id. Absent when results are present.'}, 'results': {'type': 'array', 'items': {'type': 'object', 'properties': {'id': {'type': 'number', 'description': 'Transaction internal ID'}, 'type': {'type': 'string', 'description': 'Transaction type code'}, 'action_date': {'type': 'string', 'description': 'Transaction action date (YYYY-MM-DD)'}, 'action_type': {'type': 'string', 'description': 'Action type code'}, 'description': {'type': 'string', 'description': 'Transaction description'}, 'recipient_name': {'type': 'string', 'description': 'Recipient name at time of transaction'}, 'type_description': {'type': 'string', 'description': 'Transaction type description'}, 'modification_number': {'type': 'string', 'description': 'Modification number or amendment'}, 'awarding_agency_name': {'type': 'string', 'description': 'Awarding agency name'}, 'action_type_description': {'type': 'string', 'description': 'Action type description'}, 'federal_action_obligation': {'type': 'number', 'description': 'Obligation change in USD for this transaction (positive = increase, negative = deobligation)'}}, 'description': 'Transaction record with modification details and obligation change', 'additionalProperties': False}, 'description': 'List of transactions for this award'}, 'award_id': {'type': 'string', 'description': 'Award ID queried'}, 'totalCount': {'type': 'number', 'description': 'Total transaction count across all pages (when available)'}, 'current_page': {'type': 'number', 'description': 'Current page returned'}, 'has_next_page': {'type': 'boolean', 'description': 'Whether there are more pages of transactions'}, 'page_metadata': {'type': 'object', 'required': ['has_next', 'page', 'limit'], 'properties': {'page': {'type': 'number', 'description': 'Current page'}, 'limit': {'type': 'number', 'description': 'Transactions per page'}, 'total': {'type': 'number', 'description': 'Total transaction count'}, 'has_next': {'type': 'boolean', 'description': 'Whether there are more pages'}}, 'description': 'Pagination metadata', 'additionalProperties': False}, 'queried_award_id': {'type': 'string', 'description': 'Award ID whose transactions were listed'}}, 'additionalProperties': False}
usaspending_get_federal_account
Get Federal Account
Fetch a federal account's budget data: total obligations, gross outlays, and budgetary resources, plus the per-Treasury-Account-Symbol (TAS) component breakdown in children. Federal accounts connect appropriations law to actual agency spending. Account codes come from usaspending_search_federal_accounts (its account_number output field) or usaspending_get_award_federal_accounts (its federal_account field), and are formatted as AGENCY-MAIN (e.g., 097-0100 for DoD Operation and Maintenance). For obligations broken down by program activity or object class, use usaspending_get_federal_account_breakdown.
Lecture seule Idempotent
Schéma d’entrée
{'type': 'object', '$schema': 'https://json-schema.org/draft/2020-12/schema', 'required': ['account_code'], 'properties': {'account_code': {'type': 'string', 'minLength': 1, 'description': 'Federal account code in AGENCY-MAIN format (e.g., 097-0100). Returned as account_number by usaspending_search_federal_accounts and as federal_account by usaspending_get_award_federal_accounts.'}}, 'additionalProperties': False}
Schéma de sortie
{'type': 'object', 'anyOf': [{'not': {'required': ['error']}}, {'required': ['error']}], '$schema': 'https://json-schema.org/draft/2020-12/schema', 'properties': {'error': {'type': 'object', 'required': ['code', 'message'], 'properties': {'code': {'type': 'integer', 'maximum': 9007199254740991, 'minimum': -9007199254740991, 'description': 'JSON-RPC error code for this failure.'}, 'data': {'type': 'object', 'properties': {'reason': {'type': 'string', 'examples': ['account_not_found', 'api_unavailable', 'api_timeout'], 'description': 'Machine-readable failure mode. Declared by this tool: `account_not_found`: No federal account found for the given account code. `api_unavailable`: USAspending.gov API is unreachable or returns an error. `api_timeout`: USAspending.gov did not respond before the request deadline elapsed. Other values are possible when a failure originates below the handler.'}, 'recovery': {'type': 'object', 'required': ['hint'], 'properties': {'hint': {'type': 'string'}}, 'description': 'Actionable next step for the caller.', 'additionalProperties': {}}, 'retryable': {'type': 'boolean', 'description': 'Whether retrying may succeed.'}}, 'additionalProperties': {}}, 'message': {'type': 'string', 'description': 'Human-readable description of what went wrong.'}}, 'description': 'Present when the call failed. Absent on success.', 'additionalProperties': {}}, 'children': {'type': 'array', 'items': {'type': 'object', 'properties': {'code': {'type': 'string', 'description': 'Full Treasury Account Symbol (e.g., 080-2020/2021-0120-000) â\x80\x94 the availability-period-scoped component of this federal account, not an account_code accepted by this tool'}, 'name': {'type': 'string', 'description': 'Treasury Account Symbol title'}, 'obligated_amount': {'type': 'number', 'description': 'Obligated amount in USD for this Treasury Account Symbol'}, 'gross_outlay_amount': {'type': 'number', 'description': 'Gross outlay amount in USD for this Treasury Account Symbol'}, 'budgetary_resources_amount': {'type': 'number', 'description': 'Budgetary resources in USD for this Treasury Account Symbol'}}, 'description': 'Treasury Account Symbol component with its own financial amounts', 'additionalProperties': False}, 'description': 'Treasury Account Symbol (TAS) components that make up this federal account, each with its own obligated, outlay, and budgetary-resource amounts. Omitted when the upstream returns none.'}, 'bureau_name': {'type': 'string', 'description': 'Bureau name within the agency'}, 'fiscal_year': {'type': 'number', 'description': 'Fiscal year of the financial data'}, 'account_title': {'type': 'string', 'description': 'Full account title'}, 'agency_identifier': {'type': 'string', 'description': 'Agency identifier code'}, 'main_account_code': {'type': 'string', 'description': 'Main account code'}, 'parent_agency_name': {'type': 'string', 'description': 'Managing parent agency name'}, 'federal_account_code': {'type': 'string', 'description': 'Federal account code'}, 'total_obligated_amount': {'type': 'number', 'description': 'Total obligated amount in USD'}, 'total_budgetary_resources': {'type': 'number', 'description': 'Total budgetary resources in USD'}, 'total_gross_outlay_amount': {'type': 'number', 'description': 'Total gross outlay amount in USD'}}, 'additionalProperties': False}
usaspending_get_federal_account_breakdown
Get Federal Account Breakdown
Fetch a federal account's obligations broken down by program activity (what the money funds) or object class (what it buys — personnel, supplies, contracts). Use the dimension parameter to select the axis. Account codes are AGENCY-MAIN format and come from usaspending_search_federal_accounts (its account_number output field), usaspending_get_award_federal_accounts (its federal_account field), or usaspending_get_federal_account. Paginated with an honest total count. For the account's own metadata and top-level totals, use usaspending_get_federal_account.
Lecture seule Idempotent
Schéma d’entrée
{'type': 'object', '$schema': 'https://json-schema.org/draft/2020-12/schema', 'required': ['account_code', 'dimension'], 'properties': {'page': {'type': 'integer', 'default': 1, 'maximum': 9007199254740991, 'minimum': 1, 'description': 'Page number (1-based)'}, 'limit': {'type': 'integer', 'default': 10, 'maximum': 100, 'minimum': 1, 'description': 'Maximum results per page (1â\x80\x93100)'}, 'dimension': {'enum': ['program_activity', 'object_class'], 'type': 'string', 'description': 'Breakdown axis: program_activity (obligations by the program the funds support) or object_class (obligations by the category of goods/services purchased)'}, 'account_code': {'type': 'string', 'minLength': 1, 'description': 'Federal account code in AGENCY-MAIN format (e.g., 097-0100). Returned as account_number by usaspending_search_federal_accounts and as federal_account by usaspending_get_award_federal_accounts.'}}, 'additionalProperties': False}
Schéma de sortie
{'type': 'object', 'anyOf': [{'not': {'required': ['error']}, 'required': ['account_code', 'dimension', 'results', 'page_metadata', 'applied_dimension', 'current_page', 'has_next_page']}, {'required': ['error']}], '$schema': 'https://json-schema.org/draft/2020-12/schema', 'properties': {'error': {'type': 'object', 'required': ['code', 'message'], 'properties': {'code': {'type': 'integer', 'maximum': 9007199254740991, 'minimum': -9007199254740991, 'description': 'JSON-RPC error code for this failure.'}, 'data': {'type': 'object', 'properties': {'reason': {'type': 'string', 'examples': ['api_unavailable', 'api_timeout'], 'description': 'Machine-readable failure mode. Declared by this tool: `api_unavailable`: USAspending.gov API is unreachable or returns an error. `api_timeout`: USAspending.gov did not respond before the request deadline elapsed. Other values are possible when a failure originates below the handler.'}, 'recovery': {'type': 'object', 'required': ['hint'], 'properties': {'hint': {'type': 'string'}}, 'description': 'Actionable next step for the caller.', 'additionalProperties': {}}, 'retryable': {'type': 'boolean', 'description': 'Whether retrying may succeed.'}}, 'additionalProperties': {}}, 'message': {'type': 'string', 'description': 'Human-readable description of what went wrong.'}}, 'description': 'Present when the call failed. Absent on success.', 'additionalProperties': {}}, 'notice': {'type': 'string', 'description': 'Recovery hint when results are empty â\x80\x94 the account code may not exist or may have no obligations on this axis. Absent when results are present.'}, 'results': {'type': 'array', 'items': {'type': 'object', 'properties': {'code': {'type': 'string', 'description': 'Program activity code or object class code (e.g., "0001", "25.2")'}, 'name': {'type': 'string', 'description': 'Program activity name or object class name'}, 'type': {'type': 'string', 'description': 'Program activity code system, returned only for the program_activity dimension: "PAC/PAN" (legacy program activity code/name) or "PARK" (Program Activity Reporting Key). Both can appear for the same account. Absent for object_class rows.'}, 'obligations': {'type': 'number', 'description': 'Obligated amount in USD'}}, 'description': 'Breakdown row with code, name, and obligated amount', 'additionalProperties': False}, 'description': 'Breakdown rows for the requested dimension'}, 'dimension': {'type': 'string', 'description': 'Breakdown dimension returned'}, 'totalCount': {'type': 'number', 'description': 'Total number of breakdown rows across all pages (when available)'}, 'account_code': {'type': 'string', 'description': 'Federal account code queried'}, 'current_page': {'type': 'number', 'description': 'Current page returned'}, 'has_next_page': {'type': 'boolean', 'description': 'Whether there are more pages of breakdown rows'}, 'page_metadata': {'type': 'object', 'required': ['page', 'has_next', 'has_previous', 'limit'], 'properties': {'page': {'type': 'number', 'description': 'Current page number'}, 'limit': {'type': 'number', 'description': 'Results per page'}, 'total': {'type': 'number', 'description': 'Total rows across all pages'}, 'has_next': {'type': 'boolean', 'description': 'Whether there are more pages of results'}, 'has_previous': {'type': 'boolean', 'description': 'Whether there are previous pages'}}, 'description': 'Pagination metadata', 'additionalProperties': False}, 'applied_dimension': {'type': 'string', 'description': 'Breakdown dimension applied'}}, 'additionalProperties': False}
usaspending_get_idv_awards
Get IDV Child Awards
List child contracts and task/delivery orders placed under an IDV (Indefinite Delivery Vehicle) award. Each row includes the generated_unique_award_id to chain into usaspending_get_award for full detail. The award_id must be the generated_unique_award_id of the parent IDV — obtainable from usaspending_search_awards (generated_internal_id field) or from usaspending_get_award. IDV category awards returned by usaspending_get_award have child orders accessible via this tool.
Lecture seule Idempotent
Schéma d’entrée
{'type': 'object', '$schema': 'https://json-schema.org/draft/2020-12/schema', 'required': ['award_id'], 'properties': {'page': {'type': 'integer', 'default': 1, 'maximum': 9007199254740991, 'minimum': 1, 'description': 'Page number (1-based)'}, 'sort': {'type': 'string', 'default': 'obligated_amount', 'description': 'Field to sort child awards by (e.g., obligated_amount, period_of_performance_start_date)'}, 'type': {'enum': ['child_awards', 'child_idvs', 'grandchild_awards'], 'type': 'string', 'default': 'child_awards', 'description': 'Type of child awards to list: child_awards = task/delivery orders, child_idvs = sub-IDVs, grandchild_awards = orders under sub-IDVs'}, 'limit': {'type': 'integer', 'default': 10, 'maximum': 100, 'minimum': 1, 'description': 'Maximum results per page (1â\x80\x93100)'}, 'order': {'enum': ['asc', 'desc'], 'type': 'string', 'default': 'desc', 'description': 'Sort direction'}, 'award_id': {'type': 'string', 'minLength': 1, 'description': 'Parent IDV generated_unique_award_id (e.g., CONT_IDV_NNK14MA74C_8000) â\x80\x94 use generated_internal_id from usaspending_search_awards or generated_unique_award_id from usaspending_get_award'}}, 'additionalProperties': False}
Schéma de sortie
{'type': 'object', 'anyOf': [{'not': {'required': ['error']}, 'required': ['award_id', 'results', 'page_metadata', 'parent_award_id', 'current_page', 'has_next_page']}, {'required': ['error']}], '$schema': 'https://json-schema.org/draft/2020-12/schema', 'properties': {'cap': {'type': 'number', 'description': 'The per-page limit that was applied.'}, 'error': {'type': 'object', 'required': ['code', 'message'], 'properties': {'code': {'type': 'integer', 'maximum': 9007199254740991, 'minimum': -9007199254740991, 'description': 'JSON-RPC error code for this failure.'}, 'data': {'type': 'object', 'properties': {'reason': {'type': 'string', 'examples': ['api_unavailable', 'api_timeout'], 'description': 'Machine-readable failure mode. Declared by this tool: `api_unavailable`: USAspending.gov API is unreachable or returns an error. `api_timeout`: USAspending.gov did not respond before the request deadline elapsed. Other values are possible when a failure originates below the handler.'}, 'recovery': {'type': 'object', 'required': ['hint'], 'properties': {'hint': {'type': 'string'}}, 'description': 'Actionable next step for the caller.', 'additionalProperties': {}}, 'retryable': {'type': 'boolean', 'description': 'Whether retrying may succeed.'}}, 'additionalProperties': {}}, 'message': {'type': 'string', 'description': 'Human-readable description of what went wrong.'}}, 'description': 'Present when the call failed. Absent on success.', 'additionalProperties': {}}, 'shown': {'type': 'number', 'description': 'Number of child awards returned on this page.'}, 'notice': {'type': 'string', 'description': 'Recovery hint when results are empty â\x80\x94 the award may have no children of the requested type. Absent when results are present.'}, 'results': {'type': 'array', 'items': {'type': 'object', 'properties': {'piid': {'type': 'string', 'description': 'Procurement Instrument Identifier'}, 'award_type': {'type': 'string', 'description': 'Award type (e.g., "DELIVERY ORDER")'}, 'description': {'type': 'string', 'description': 'Award description'}, 'funding_agency': {'type': 'string', 'description': 'Name of the funding agency'}, 'awarding_agency': {'type': 'string', 'description': 'Name of the awarding agency'}, 'obligated_amount': {'type': 'number', 'description': 'Total obligated amount in USD'}, 'last_date_to_order': {'type': 'string', 'description': 'Last date to place orders against this IDV (YYYY-MM-DD, nullable)'}, 'generated_unique_award_id': {'type': 'string', 'description': 'Generated unique award ID for this child award â\x80\x94 pass to usaspending_get_award to fetch full details'}, 'period_of_performance_start_date': {'type': 'string', 'description': 'Performance start date (YYYY-MM-DD)'}, 'period_of_performance_current_end_date': {'type': 'string', 'description': 'Performance current end date (YYYY-MM-DD)'}}, 'description': 'Child award record with ID, amounts, agencies, and performance dates', 'additionalProperties': False}, 'description': 'Child awards placed under this IDV'}, 'award_id': {'type': 'string', 'description': 'Parent IDV award ID queried'}, 'truncated': {'type': 'boolean', 'description': 'True when this page was full and more child awards may remain beyond it.'}, 'current_page': {'type': 'number', 'description': 'Current page returned'}, 'has_next_page': {'type': 'boolean', 'description': 'Whether more pages of child awards may remain â\x80\x94 set on a full page even when the upstream flag reports none.'}, 'page_metadata': {'type': 'object', 'required': ['has_next', 'has_previous', 'page', 'limit'], 'properties': {'page': {'type': 'number', 'description': 'Current page number'}, 'limit': {'type': 'number', 'description': 'Results per page'}, 'has_next': {'type': 'boolean', 'description': 'Whether more child awards may remain â\x80\x94 true on a full page even when the upstream flag reports none (this endpoint returns no total). A short or empty page marks the end.'}, 'has_previous': {'type': 'boolean', 'description': 'Whether there are previous pages'}}, 'description': 'Pagination metadata (no total count available from this endpoint)', 'additionalProperties': False}, 'parent_award_id': {'type': 'string', 'description': 'Parent IDV award ID whose children were listed'}}, 'additionalProperties': False}
usaspending_get_recipient
Get Recipient Profile
Fetch a recipient's full profile including address, business type codes, parent organization, alternate names, and total transaction and loan amounts. Recipient IDs are UUID hashes with a level suffix (-P parent, -C child, -R standalone) from usaspending_search_recipients or usaspending_get_award. Optionally scope the totals to a specific fiscal year and award type. UEI and DUNS values can be used to cross-reference with SAM.gov and SEC EDGAR.
Lecture seule Idempotent
Schéma d’entrée
{'type': 'object', '$schema': 'https://json-schema.org/draft/2020-12/schema', 'required': ['recipient_id'], 'properties': {'award_type': {'enum': ['contracts', 'grants', 'direct_payments', 'loans', 'other_financial_assistance'], 'type': 'string', 'description': 'Award type category to scope award totals'}, 'fiscal_year': {'type': 'integer', 'maximum': 2030, 'minimum': 2001, 'description': 'Fiscal year to scope award totals (e.g., 2024)'}, 'recipient_id': {'type': 'string', 'minLength': 1, 'description': 'Recipient hash ID (UUID with level suffix, e.g., b97d19b0-833c-8d8f-3a2c-157d04ea55ef-P) â\x80\x94 from usaspending_search_recipients or usaspending_get_award'}}, 'additionalProperties': False}
Schéma de sortie
{'type': 'object', 'anyOf': [{'not': {'required': ['error']}}, {'required': ['error']}], '$schema': 'https://json-schema.org/draft/2020-12/schema', 'properties': {'uei': {'type': 'string', 'description': 'Unique Entity Identifier (SAM.gov)'}, 'duns': {'type': 'string', 'description': 'DUNS number (legacy)'}, 'name': {'type': 'string', 'description': 'Recipient legal business name'}, 'error': {'type': 'object', 'required': ['code', 'message'], 'properties': {'code': {'type': 'integer', 'maximum': 9007199254740991, 'minimum': -9007199254740991, 'description': 'JSON-RPC error code for this failure.'}, 'data': {'type': 'object', 'properties': {'reason': {'type': 'string', 'examples': ['recipient_not_found', 'api_unavailable', 'api_timeout'], 'description': 'Machine-readable failure mode. Declared by this tool: `recipient_not_found`: No recipient found for the given recipient ID. `api_unavailable`: USAspending.gov API is unreachable or returns an error. `api_timeout`: USAspending.gov did not respond before the request deadline elapsed. Other values are possible when a failure originates below the handler.'}, 'recovery': {'type': 'object', 'required': ['hint'], 'properties': {'hint': {'type': 'string'}}, 'description': 'Actionable next step for the caller.', 'additionalProperties': {}}, 'retryable': {'type': 'boolean', 'description': 'Whether retrying may succeed.'}}, 'additionalProperties': {}}, 'message': {'type': 'string', 'description': 'Human-readable description of what went wrong.'}}, 'description': 'Present when the call failed. Absent on success.', 'additionalProperties': {}}, 'location': {'type': 'object', 'properties': {'zip': {'type': 'string', 'description': 'ZIP code'}, 'zip4': {'type': 'string', 'description': 'ZIP+4 extension'}, 'city_name': {'type': 'string', 'description': 'City'}, 'state_code': {'type': 'string', 'description': 'State code'}, 'country_code': {'type': 'string', 'description': 'Country code'}, 'address_line1': {'type': 'string', 'description': 'Street address line 1'}, 'address_line2': {'type': 'string', 'description': 'Street address line 2'}}, 'description': 'Recipient address', 'additionalProperties': False}, 'parent_uei': {'type': 'string', 'description': 'Parent organization UEI'}, 'parent_name': {'type': 'string', 'description': 'Parent organization name'}, 'recipient_id': {'type': 'string', 'description': 'Recipient hash ID'}, 'business_types': {'type': 'array', 'items': {'type': 'string'}, 'description': 'Business type codes'}, 'alternate_names': {'type': 'array', 'items': {'type': 'string'}, 'description': 'Alternate business names'}, 'recipient_level': {'type': 'string', 'description': 'Hierarchy level: P = parent, C = child, R = standalone'}, 'total_transactions': {'type': 'number', 'description': 'Total number of award transactions'}, 'total_transaction_amount': {'type': 'number', 'description': 'Total transaction (award) amount in USD; scoped by fiscal_year/award_type when provided'}, 'total_face_value_loan_amount': {'type': 'number', 'description': 'Total face value of loans in USD'}, 'total_face_value_loan_transactions': {'type': 'number', 'description': 'Number of face-value loan transactions'}}, 'additionalProperties': False}
usaspending_list_agencies
List Federal Agencies
List all top-tier federal agencies with toptier codes, agency slugs, budget authority amounts, and obligation totals for the current fiscal year. Use this as the entry point for agency navigation — toptier codes and agency slugs are required inputs for usaspending_get_agency and agency-based filters on spending analysis tools.
Lecture seule Idempotent
Schéma d’entrée
{'type': 'object', '$schema': 'https://json-schema.org/draft/2020-12/schema', 'properties': {'sort': {'enum': ['agency_name', 'budget_authority_amount', 'obligated_amount', 'outlay_amount'], 'type': 'string', 'default': 'agency_name', 'description': 'Sort field: agency_name (alphabetical), budget_authority_amount, obligated_amount, or outlay_amount'}, 'order': {'enum': ['asc', 'desc'], 'type': 'string', 'default': 'asc', 'description': 'Sort direction: asc or desc'}}, 'additionalProperties': False}
Schéma de sortie
{'type': 'object', 'anyOf': [{'not': {'required': ['error']}, 'required': ['results', 'total', 'agency_count']}, {'required': ['error']}], '$schema': 'https://json-schema.org/draft/2020-12/schema', 'properties': {'error': {'type': 'object', 'required': ['code', 'message'], 'properties': {'code': {'type': 'integer', 'maximum': 9007199254740991, 'minimum': -9007199254740991, 'description': 'JSON-RPC error code for this failure.'}, 'data': {'type': 'object', 'properties': {'reason': {'type': 'string', 'examples': ['api_unavailable', 'api_timeout'], 'description': 'Machine-readable failure mode. Declared by this tool: `api_unavailable`: USAspending.gov API is unreachable or returns an error. `api_timeout`: USAspending.gov did not respond before the request deadline elapsed. Other values are possible when a failure originates below the handler.'}, 'recovery': {'type': 'object', 'required': ['hint'], 'properties': {'hint': {'type': 'string'}}, 'description': 'Actionable next step for the caller.', 'additionalProperties': {}}, 'retryable': {'type': 'boolean', 'description': 'Whether retrying may succeed.'}}, 'additionalProperties': {}}, 'message': {'type': 'string', 'description': 'Human-readable description of what went wrong.'}}, 'description': 'Present when the call failed. Absent on success.', 'additionalProperties': {}}, 'total': {'type': 'number', 'description': 'Total number of agencies returned'}, 'results': {'type': 'array', 'items': {'type': 'object', 'required': ['agency_name', 'toptier_code'], 'properties': {'agency_name': {'type': 'string', 'description': 'Full agency name'}, 'agency_slug': {'type': 'string', 'description': 'URL-friendly agency slug (e.g., department-of-defense) â\x80\x94 accepted by usaspending_get_agency'}, 'abbreviation': {'type': 'string', 'description': 'Agency abbreviation or acronym'}, 'toptier_code': {'type': 'string', 'description': 'Three-digit toptier agency code (e.g., 097 for DoD) â\x80\x94 required by usaspending_get_agency'}, 'outlay_amount': {'type': 'number', 'description': 'Total outlay amount in USD for the current fiscal year'}, 'obligated_amount': {'type': 'number', 'description': 'Total obligated amount in USD for the current fiscal year'}, 'budget_authority_amount': {'type': 'number', 'description': 'Total budget authority amount in USD for the current fiscal year'}}, 'description': 'Agency entry with codes, slugs, and fiscal year budget data', 'additionalProperties': False}, 'description': 'List of top-tier federal agencies with budget and obligation data'}, 'agency_count': {'type': 'number', 'description': 'Total number of top-tier federal agencies returned'}}, 'additionalProperties': False}
usaspending_search_awards
Search Federal Awards
Search federal awards by keyword, recipient, agency, award type, NAICS code, assistance listing (CFDA) number, location, or date range. Returns ranked award summaries including recipient names, amounts, awarding agencies, and generated award IDs for use with usaspending_get_award; loan rows carry loan value, subsidy cost, and issue date in place of award amount and dates. Award types: A/B/C/D = contracts, IDV_A–IDV_E = IDVs, 02/03/04/05/F001/F002 = grants, 06/10/F006/F007 = direct payments, 07/08/F003/F004 = loans, 09/11/-1/F005/F008/F009/F010 = other assistance. Dates must be ISO 8601 (YYYY-MM-DD). Earliest data: 2007-10-01 via search API. DoD contracts have a 90-day publication lag.
Lecture seule Accès externe Idempotent
Schéma d’entrée
{'type': 'object', '$schema': 'https://json-schema.org/draft/2020-12/schema', 'properties': {'page': {'type': 'integer', 'default': 1, 'maximum': 9007199254740991, 'minimum': 1, 'description': 'Page number (1-based). Page-number pagination caps at a 50,000-result offset (page Ã\x97 limit), but the keyset cursor below is only returned while the offset stays under 10,000 â\x80\x94 capture the cursor pair before paging past that, or the only way forward is page numbers.'}, 'sort': {'enum': ['Award Amount', 'Total Outlays', 'Start Date', 'End Date', 'Loan Value', 'Subsidy Cost', 'Issued Date', 'Recipient Name', 'Awarding Agency'], 'type': 'string', 'description': 'Sort field for results. Loans (07/08/F003/F004) sort by Loan Value, Subsidy Cost, Issued Date, Recipient Name, or Awarding Agency, defaulting to Loan Value. Every other group sorts by Award Amount, Total Outlays, Start Date, End Date, Recipient Name, or Awarding Agency, defaulting to Award Amount â\x80\x94 except IDVs, which have no End Date. A sort the group does not support is rejected before the search runs.'}, 'limit': {'type': 'integer', 'default': 10, 'maximum': 100, 'minimum': 1, 'description': 'Maximum results per page (1â\x80\x93100)'}, 'order': {'enum': ['asc', 'desc'], 'type': 'string', 'default': 'desc', 'description': 'Sort direction'}, 'filters': {'type': 'object', 'properties': {'keywords': {'type': 'array', 'items': {'type': 'string'}, 'description': 'Full-text search terms across award descriptions, recipient names, and places'}, 'agency_name': {'type': 'string', 'description': 'Awarding agency name (toptier), e.g., "Department of Defense"'}, 'naics_codes': {'type': 'array', 'items': {'type': 'string'}, 'description': 'NAICS industry codes to require, e.g., ["541512"]'}, 'recipient_name': {'type': 'string', 'description': 'Recipient name search (partial match); maps to recipient_search_text. Use instead of recipient_id, which this endpoint ignores.'}, 'time_period_end': {'anyOf': [{'type': 'string', 'const': ''}, {'type': 'string', 'pattern': '^\\d{4}-\\d{1,2}-\\d{1,2}$', 'description': 'Date as YYYY-MM-DD; month and day may be unpadded'}], 'description': 'End date (YYYY-MM-DD). Given alone, the range starts at 2007-10-01, the earliest searchable date.'}, 'award_type_codes': {'type': 'array', 'items': {'type': 'string'}, 'description': 'Award type codes; all must belong to one group (A/B/C/D contracts, IDV_Aâ\x80\x93IDV_E IDVs, 02/03/04/05/F001/F002 grants, 06/10/F006/F007 direct payments, 07/08/F003/F004 loans, 09/11/-1/F005/F008/F009/F010 other assistance). When non-empty, overrides the top-level award_type_codes and decides which sort values apply; an empty array falls back to the top-level value.'}, 'time_period_start': {'anyOf': [{'type': 'string', 'const': ''}, {'type': 'string', 'pattern': '^\\d{4}-\\d{1,2}-\\d{1,2}$', 'description': 'Date as YYYY-MM-DD; month and day may be unpadded'}], 'description': 'Start date (YYYY-MM-DD); earliest valid 2007-10-01. Given alone, the range runs through today (UTC).'}}, 'description': 'Optional analytics-style filter object mirroring the shape the spending analytics tools accept, for reusing one filter set across tools. When both this object and the equivalent top-level flat filters are given, this object wins per-field. recipient_id is intentionally not accepted â\x80\x94 this endpoint silently ignores it; filter by recipient via recipient_name.'}, 'keyword': {'type': 'string', 'description': 'Full-text search across award descriptions, recipient names, and place names'}, 'agency_name': {'type': 'string', 'description': 'Filter to a specific awarding agency by name (e.g., "Department of Defense"). Use usaspending_autocomplete_filters type=awarding_agency to find exact names.'}, 'naics_codes': {'type': 'array', 'items': {'type': 'string'}, 'description': 'Filter by NAICS industry codes (e.g., ["541512"]). Use usaspending_autocomplete_filters type=naics to look up codes.'}, 'time_period': {'type': 'object', 'required': ['start_date', 'end_date'], 'properties': {'end_date': {'anyOf': [{'type': 'string', 'const': ''}, {'type': 'string', 'pattern': '^\\d{4}-\\d{1,2}-\\d{1,2}$', 'description': 'Date as YYYY-MM-DD; month and day may be unpadded'}], 'description': 'End date in ISO 8601 format (YYYY-MM-DD). Blank ("") leaves the end open, filled with today (UTC).'}, 'start_date': {'anyOf': [{'type': 'string', 'const': ''}, {'type': 'string', 'pattern': '^\\d{4}-\\d{1,2}-\\d{1,2}$', 'description': 'Date as YYYY-MM-DD; month and day may be unpadded'}], 'description': 'Start date in ISO 8601 format (YYYY-MM-DD); earliest valid: 2007-10-01. Blank ("") leaves the start open, filled with 2007-10-01.'}}, 'description': 'Filter awards by date range (action date). Both blank means no date filter; one blank end is filled and named in the notice.'}, 'recipient_name': {'type': 'string', 'description': "Filter by recipient name (partial match); maps to this endpoint's recipient_search_text. This endpoint has no recipient_id filter â\x80\x94 use usaspending_search_recipients to look up a recipient by name."}, 'location_filter': {'type': 'object', 'properties': {'city': {'type': 'string', 'description': 'City name'}, 'state': {'type': 'string', 'description': 'Two-letter US state abbreviation (e.g., CA)'}, 'county': {'type': 'string', 'description': 'FIPS county code (e.g., 06037 for Los Angeles County)'}, 'country': {'type': 'string', 'description': 'ISO 3166-1 alpha-3 country code (e.g., USA)'}}, 'description': 'Filter by place of performance location. Uses FIPS codes and 2-letter state abbreviations, not place names â\x80\x94 use a geocoding server to resolve names to codes first.'}, 'award_type_codes': {'type': 'array', 'items': {'type': 'string'}, 'default': ['A', 'B', 'C', 'D'], 'minItems': 1, 'description': 'Filter by award type codes. All codes must belong to a single group: A/B/C/D (contracts), IDV_A/IDV_B/IDV_B_A/IDV_B_B/IDV_B_C/IDV_C/IDV_D/IDV_E (IDVs), 02/03/04/05/F001/F002 (grants), 06/10/F006/F007 (direct payments), 07/08/F003/F004 (loans), 09/11/-1/F005/F008/F009/F010 (other assistance). Defaults to contracts. Mixing groups causes a 422 error. The group decides which sort values apply.'}, 'assistance_listings': {'type': 'array', 'items': {'type': 'string', 'pattern': '^\\d{2}\\.[0-9A-Z]{3}$', 'description': 'Assistance Listing number, e.g. 93.866'}, 'description': 'Filter by Assistance Listing (CFDA) program numbers, e.g. ["93.866"]: two digits, a dot, then three digits or capital letters (11.67A). Matches an award when any of its listings equals one of these exactly; several values match any of them. A row\'s primary listing can differ from the one requested, and its amount is the whole award, not that listing\'s share. Assistance award types only â\x80\x94 set award_type_codes to grants, direct payments, loans, or other assistance; contracts and IDVs carry no listings, so pairing them (including the default award_type_codes) is rejected. Use usaspending_autocomplete_filters type=cfda to look up numbers.'}, 'last_record_unique_id': {'type': 'integer', 'maximum': 9007199254740991, 'minimum': -9007199254740991, 'description': 'Keyset-pagination cursor: the last_record_unique_id from a prior response page_metadata. Provide together with last_record_sort_value.'}, 'last_record_sort_value': {'type': 'string', 'description': 'Keyset-pagination cursor: the last_record_sort_value from a prior response page_metadata. Provide together with last_record_unique_id to fetch the next page past the 50,000-result page-number cap. The upstream stops emitting the pair once page Ã\x97 limit reaches 10,000, so take it from a page below that offset. When both cursor fields are supplied, page is ignored.'}}, 'additionalProperties': False}
Schéma de sortie
{'type': 'object', 'anyOf': [{'not': {'required': ['error']}, 'required': ['results', 'page_metadata', 'page', 'has_next']}, {'required': ['error']}], '$schema': 'https://json-schema.org/draft/2020-12/schema', 'properties': {'cap': {'type': 'number', 'description': 'Per-page cap (limit) applied to this page.'}, 'page': {'type': 'number', 'description': 'Current page number returned'}, 'error': {'type': 'object', 'required': ['code', 'message'], 'properties': {'code': {'type': 'integer', 'maximum': 9007199254740991, 'minimum': -9007199254740991, 'description': 'JSON-RPC error code for this failure.'}, 'data': {'type': 'object', 'properties': {'reason': {'type': 'string', 'examples': ['api_unavailable', 'api_timeout', 'pagination_limit_exceeded', 'date_before_earliest', 'date_range_inverted', 'unsupported_sort', 'assistance_listings_type_mismatch'], 'description': 'Machine-readable failure mode. Declared by this tool: `api_unavailable`: USAspending.gov API is unreachable or returns an error. `api_timeout`: USAspending.gov did not respond before the request deadline elapsed. `pagination_limit_exceeded`: page multiplied by limit exceeds the endpoint 50,000-result page window and no cursor was supplied. `date_before_earliest`: The resolved start date precedes the 2007-10-01 earliest date this endpoint can search. `date_range_inverted`: Both ends of the date range were supplied and the start date falls after the end date. `unsupported_sort`: The sort value is not one the award type group supports. `assistance_listings_type_mismatch`: assistance_listings was given while the award type codes include contract or IDV codes, or were left at the contract default. Other values are possible when a failure originates below the handler.'}, 'recovery': {'type': 'object', 'required': ['hint'], 'properties': {'hint': {'type': 'string'}}, 'description': 'Actionable next step for the caller.', 'additionalProperties': {}}, 'retryable': {'type': 'boolean', 'description': 'Whether retrying may succeed.'}}, 'additionalProperties': {}}, 'message': {'type': 'string', 'description': 'Human-readable description of what went wrong.'}}, 'description': 'Present when the call failed. Absent on success.', 'additionalProperties': {}}, 'shown': {'type': 'number', 'description': 'Number of awards returned on this page.'}, 'notice': {'type': 'string', 'description': 'How to page on when more results may remain, which date bound was filled in when only the other was supplied, and â\x80\x94 when results are empty â\x80\x94 the applied filters with how to broaden. Absent when none applies.'}, 'results': {'type': 'array', 'items': {'type': 'object', 'properties': {'award_id': {'type': 'string', 'description': 'Display award ID (piid, fain, or uri) â\x80\x94 NOT the chaining ID'}, 'end_date': {'type': 'string', 'description': 'Award end date (YYYY-MM-DD)'}, 'award_type': {'type': 'string', 'description': 'Award type description'}, 'loan_value': {'type': 'number', 'description': 'Face value of the loan in USD (loans only â\x80\x94 they carry no award_amount)'}, 'start_date': {'type': 'string', 'description': 'Award start date (YYYY-MM-DD)'}, 'agency_slug': {'type': 'string', 'description': 'URL-friendly awarding-agency slug (e.g., national-aeronautics-and-space-administration) â\x80\x94 pass to usaspending_get_agency as agency_slug. Absent when the agency has no profile page.'}, 'description': {'type': 'string', 'description': 'Award description'}, 'issued_date': {'type': 'string', 'description': 'Date the loan was issued (YYYY-MM-DD; loans only â\x80\x94 they carry no start or end date)'}, 'award_amount': {'type': 'number', 'description': 'Total award amount in USD'}, 'subsidy_cost': {'type': 'number', 'description': 'Original subsidy cost of the loan in USD â\x80\x94 the estimated long-term cost to the government (loans only)'}, 'total_outlays': {'type': 'number', 'description': 'Total outlays in USD'}, 'funding_agency': {'type': 'string', 'description': 'Name of the funding agency'}, 'recipient_name': {'type': 'string', 'description': 'Name of the award recipient'}, 'awarding_agency': {'type': 'string', 'description': 'Name of the awarding agency'}, 'awarding_sub_agency': {'type': 'string', 'description': 'Name of the awarding sub-agency'}, 'place_of_performance': {'type': 'object', 'properties': {'city': {'type': 'string', 'description': 'City of performance'}, 'state': {'type': 'string', 'description': 'State code of performance'}, 'country': {'type': 'string', 'description': 'Country code of performance'}}, 'description': 'Place of performance location', 'additionalProperties': False}, 'generated_internal_id': {'type': 'string', 'description': 'Generated unique award ID â\x80\x94 pass to usaspending_get_award to fetch full details'}}, 'description': 'Award summary with amounts, agencies, and chaining IDs', 'additionalProperties': False}, 'description': 'Matching award summaries'}, 'has_next': {'type': 'boolean', 'description': 'Whether more results may remain â\x80\x94 set on a full page even when the upstream flag reports none.'}, 'truncated': {'type': 'boolean', 'description': 'True when this page was capped at `limit` and more results may remain (continue via page or the cursor).'}, 'page_metadata': {'type': 'object', 'required': ['has_next', 'page', 'limit'], 'properties': {'page': {'type': 'number', 'description': 'Current page number'}, 'limit': {'type': 'number', 'description': 'Results per page'}, 'has_next': {'type': 'boolean', 'description': 'Whether more results may remain â\x80\x94 true on a full page even when the upstream flag reports none, since this endpoint under-reports continuation on a final full page and on every page past a 10,000-result offset. A short or empty page marks the end.'}, 'last_record_unique_id': {'type': 'number', 'description': 'Keyset-pagination cursor for the next page â\x80\x94 pass back as last_record_unique_id alongside last_record_sort_value. Absent on the same pages that omit last_record_sort_value.'}, 'last_record_sort_value': {'type': 'string', 'description': 'Keyset-pagination cursor for the next page â\x80\x94 pass back as last_record_sort_value to continue past the 50,000-result page limit. Absent once page Ã\x97 limit reaches 10,000, where the upstream stops emitting the pair.'}}, 'description': 'Pagination metadata. This endpoint does not return a total match count; use has_next and the cursor pair to page.', 'additionalProperties': False}, 'applied_keyword': {'type': 'string', 'description': 'Keyword filter applied to this search'}, 'upstream_messages': {'type': 'array', 'items': {'type': 'string'}, 'description': 'Notices the USAspending API returned with this response â\x80\x94 e.g. a supplied filter it ignored because this endpoint does not support it. Every successful response also carries a standing advisory that search covers 2007-10-01 onward; that advisory is boilerplate, not a verdict on the dates requested. Present whenever the API returns any messages.'}, 'applied_agency_name': {'type': 'string', 'description': 'Awarding agency name filter applied'}, 'applied_naics_codes': {'type': 'string', 'description': 'NAICS codes filter applied (comma-separated)'}, 'applied_time_period_end': {'type': 'string', 'description': 'End of the date range sent (YYYY-MM-DD), including a filled-in end'}, 'applied_time_period_start': {'type': 'string', 'description': 'Start of the date range sent (YYYY-MM-DD), including a filled-in start'}, 'applied_assistance_listings': {'type': 'string', 'description': 'Assistance Listing numbers filter applied (comma-separated)'}}, 'additionalProperties': False}
usaspending_search_federal_accounts
Search Federal Accounts
List and keyword-search federal accounts by agency identifier or title keyword. Returns account numbers, names, managing agencies, and budgetary resources. Use account_number from results as input to usaspending_get_federal_account for full budget detail. Use usaspending_list_agencies to look up agency_identifier codes (3-digit strings, e.g. "097" for DoD).
Lecture seule Accès externe Idempotent
Schéma d’entrée
{'type': 'object', '$schema': 'https://json-schema.org/draft/2020-12/schema', 'properties': {'page': {'type': 'integer', 'default': 1, 'maximum': 9007199254740991, 'minimum': 1, 'description': 'Page number (1-based)'}, 'limit': {'type': 'integer', 'default': 10, 'maximum': 100, 'minimum': 1, 'description': 'Maximum results per page (1â\x80\x93100)'}, 'keyword': {'type': 'string', 'description': 'Filter accounts by name or title keyword (e.g., "defense", "transportation")'}, 'sort_field': {'enum': ['account_name', 'account_number', 'budgetary_resources', 'managing_agency'], 'type': 'string', 'default': 'budgetary_resources', 'description': 'Field to sort results by'}, 'sort_direction': {'enum': ['asc', 'desc'], 'type': 'string', 'default': 'desc', 'description': 'Sort direction'}, 'agency_identifier': {'type': 'string', 'description': '3-digit agency identifier code (e.g., "097" for Department of Defense). Use usaspending_list_agencies to look up codes.'}}, 'additionalProperties': False}
Schéma de sortie
{'type': 'object', 'anyOf': [{'not': {'required': ['error']}, 'required': ['results', 'page_metadata', 'page', 'has_next']}, {'required': ['error']}], '$schema': 'https://json-schema.org/draft/2020-12/schema', 'properties': {'page': {'type': 'number', 'description': 'Current page number returned'}, 'error': {'type': 'object', 'required': ['code', 'message'], 'properties': {'code': {'type': 'integer', 'maximum': 9007199254740991, 'minimum': -9007199254740991, 'description': 'JSON-RPC error code for this failure.'}, 'data': {'type': 'object', 'properties': {'reason': {'type': 'string', 'examples': ['api_unavailable', 'api_timeout'], 'description': 'Machine-readable failure mode. Declared by this tool: `api_unavailable`: USAspending.gov API is unreachable or returns an error. `api_timeout`: USAspending.gov did not respond before the request deadline elapsed. Other values are possible when a failure originates below the handler.'}, 'recovery': {'type': 'object', 'required': ['hint'], 'properties': {'hint': {'type': 'string'}}, 'description': 'Actionable next step for the caller.', 'additionalProperties': {}}, 'retryable': {'type': 'boolean', 'description': 'Whether retrying may succeed.'}}, 'additionalProperties': {}}, 'message': {'type': 'string', 'description': 'Human-readable description of what went wrong.'}}, 'description': 'Present when the call failed. Absent on success.', 'additionalProperties': {}}, 'notice': {'type': 'string', 'description': 'Recovery hint when results are empty â\x80\x94 echoes applied filters and suggests how to broaden. Absent when results are present.'}, 'results': {'type': 'array', 'items': {'type': 'object', 'properties': {'account_name': {'type': 'string', 'description': 'Full federal account title'}, 'account_number': {'type': 'string', 'description': 'Federal account code (e.g., "097-8097") â\x80\x94 pass to usaspending_get_federal_account for full detail'}, 'managing_agency': {'type': 'string', 'description': 'Name of the managing agency'}, 'agency_identifier': {'type': 'string', 'description': '3-digit agency identifier code for this account'}, 'budgetary_resources': {'type': 'number', 'description': 'Total budgetary resources for this account in USD'}, 'managing_agency_acronym': {'type': 'string', 'description': 'Acronym of the managing agency (e.g., "DOD")'}}, 'description': 'Federal account record with code, name, agency, and budget', 'additionalProperties': False}, 'description': 'Matching federal accounts'}, 'has_next': {'type': 'boolean', 'description': 'Whether there are more pages of results'}, 'totalCount': {'type': 'number', 'description': 'Total number of matching accounts across all pages (when available)'}, 'page_metadata': {'type': 'object', 'required': ['page', 'has_next', 'limit'], 'properties': {'page': {'type': 'number', 'description': 'Current page number'}, 'count': {'type': 'number', 'description': 'Total matching accounts across all pages'}, 'limit': {'type': 'number', 'description': 'Results per page'}, 'has_next': {'type': 'boolean', 'description': 'Whether there are more pages of results'}}, 'description': 'Pagination metadata', 'additionalProperties': False}}, 'additionalProperties': False}
usaspending_search_recipients
Search Award Recipients
Search for organizations or individuals receiving federal funds by name, UEI (Unique Entity Identifier), or DUNS. Returns recipient hash IDs, UEI/DUNS identifiers, total award amounts, and hierarchy level. Results are paginated — use page to retrieve matches beyond the first page; page_metadata.total reports the full match count. Recipient hash IDs from this tool can be passed to usaspending_get_recipient for full profiles. Recipient level: P = parent organization, C = child entity, R = standalone.
Lecture seule Accès externe Idempotent
Schéma d’entrée
{'type': 'object', '$schema': 'https://json-schema.org/draft/2020-12/schema', 'required': ['keyword'], 'properties': {'page': {'type': 'integer', 'default': 1, 'maximum': 9007199254740991, 'minimum': 1, 'description': 'Page number (1-based) â\x80\x94 request the next page to retrieve matches beyond the first'}, 'limit': {'type': 'integer', 'default': 10, 'maximum': 100, 'minimum': 1, 'description': 'Maximum results per page (1â\x80\x93100)'}, 'keyword': {'type': 'string', 'minLength': 1, 'description': 'Name, UEI, DUNS, or keyword to search for â\x80\x94 partial matches are supported'}, 'award_type': {'enum': ['contracts', 'grants', 'direct_payments', 'loans', 'other_financial_assistance'], 'type': 'string', 'description': 'Filter by award type category to scope the total amounts returned'}}, 'additionalProperties': False}
Schéma de sortie
{'type': 'object', 'anyOf': [{'not': {'required': ['error']}, 'required': ['results', 'page_metadata', 'recipient_count', 'page', 'has_next']}, {'required': ['error']}], '$schema': 'https://json-schema.org/draft/2020-12/schema', 'properties': {'page': {'type': 'number', 'description': 'Current page number returned'}, 'error': {'type': 'object', 'required': ['code', 'message'], 'properties': {'code': {'type': 'integer', 'maximum': 9007199254740991, 'minimum': -9007199254740991, 'description': 'JSON-RPC error code for this failure.'}, 'data': {'type': 'object', 'properties': {'reason': {'type': 'string', 'examples': ['api_unavailable', 'api_timeout'], 'description': 'Machine-readable failure mode. Declared by this tool: `api_unavailable`: USAspending.gov API is unreachable or returns an error. `api_timeout`: USAspending.gov did not respond before the request deadline elapsed. Other values are possible when a failure originates below the handler.'}, 'recovery': {'type': 'object', 'required': ['hint'], 'properties': {'hint': {'type': 'string'}}, 'description': 'Actionable next step for the caller.', 'additionalProperties': {}}, 'retryable': {'type': 'boolean', 'description': 'Whether retrying may succeed.'}}, 'additionalProperties': {}}, 'message': {'type': 'string', 'description': 'Human-readable description of what went wrong.'}}, 'description': 'Present when the call failed. Absent on success.', 'additionalProperties': {}}, 'notice': {'type': 'string', 'description': 'Recovery hint â\x80\x94 how to continue to the next page when more results exist, or how to broaden the search when empty. Absent when the full match set fits on this page.'}, 'results': {'type': 'array', 'items': {'type': 'object', 'properties': {'id': {'type': 'string', 'description': 'Recipient hash ID (UUID format with level suffix: -P parent, -C child, -R standalone) â\x80\x94 pass to usaspending_get_recipient for full profile'}, 'uei': {'type': 'string', 'description': 'Unique Entity Identifier (SAM.gov)'}, 'duns': {'type': 'string', 'description': 'DUNS number (legacy, being phased out)'}, 'name': {'type': 'string', 'description': 'Recipient legal business name'}, 'amount': {'type': 'number', 'description': 'Total award amount in USD for the selected award type'}, 'recipient_level': {'type': 'string', 'description': 'Hierarchy level: P = parent, C = child, R = standalone'}}, 'description': 'Recipient entry with ID, name, and award totals', 'additionalProperties': False}, 'description': 'Matching recipients'}, 'has_next': {'type': 'boolean', 'description': 'Whether there are more pages of results'}, 'totalCount': {'type': 'number', 'description': 'Total matching recipients across all pages'}, 'page_metadata': {'type': 'object', 'required': ['page', 'has_next', 'limit'], 'properties': {'page': {'type': 'number', 'description': 'Current page number'}, 'limit': {'type': 'number', 'description': 'Results per page'}, 'total': {'type': 'number', 'description': 'Total matching recipients across all pages'}, 'has_next': {'type': 'boolean', 'description': 'Whether there are more pages of results'}}, 'description': 'Pagination metadata â\x80\x94 page through with the page input to reach later matches', 'additionalProperties': False}, 'recipient_count': {'type': 'number', 'description': 'Number of matching recipients returned on this page'}}, 'additionalProperties': False}
usaspending_spending_by_category
Spending by Category
Aggregate federal spending grouped by a specific dimension: NAICS industry code, PSC product/service code, awarding agency, funding agency, CFDA assistance program, or recipient. Returns top items with obligation amounts — useful for trend and breakdown analysis. Chain NAICS codes into usaspending_search_awards filters or usaspending_autocomplete_filters lookups.
Lecture seule Accès externe Idempotent
Schéma d’entrée
{'type': 'object', '$schema': 'https://json-schema.org/draft/2020-12/schema', 'required': ['category'], 'properties': {'page': {'type': 'integer', 'default': 1, 'maximum': 9007199254740991, 'minimum': 1, 'description': 'Page number (1-based)'}, 'limit': {'type': 'integer', 'default': 10, 'maximum': 100, 'minimum': 1, 'description': 'Maximum items to return (1â\x80\x93100)'}, 'filters': {'type': 'object', 'properties': {'keywords': {'type': 'array', 'items': {'type': 'string'}, 'description': 'Full-text keyword filters'}, 'agency_name': {'type': 'string', 'description': 'Awarding agency name filter'}, 'naics_codes': {'type': 'array', 'items': {'type': 'string'}, 'description': 'NAICS code filters'}, 'recipient_id': {'type': 'string', 'description': 'Exact recipient hash ID filter'}, 'time_period_end': {'anyOf': [{'type': 'string', 'const': ''}, {'type': 'string', 'pattern': '^\\d{4}-\\d{1,2}-\\d{1,2}$', 'description': 'Date as YYYY-MM-DD; month and day may be unpadded'}], 'description': 'End date (YYYY-MM-DD). Given alone, the window starts at 2007-10-01, the earliest searchable date.'}, 'award_type_codes': {'type': 'array', 'items': {'type': 'string'}, 'description': 'Award type code filters (A/B/C/D, 02â\x80\x9305, etc.)'}, 'time_period_start': {'anyOf': [{'type': 'string', 'const': ''}, {'type': 'string', 'pattern': '^\\d{4}-\\d{1,2}-\\d{1,2}$', 'description': 'Date as YYYY-MM-DD; month and day may be unpadded'}], 'description': 'Start date (YYYY-MM-DD), 2007-10-01 or later. Given alone, the window runs through today (UTC).'}}, 'description': 'Optional filters to scope the aggregation'}, 'category': {'enum': ['naics', 'psc', 'awarding_agency', 'awarding_subagency', 'funding_agency', 'funding_subagency', 'cfda', 'recipient_duns', 'recipient_parent_duns'], 'type': 'string', 'description': 'Breakdown dimension: naics (industry), psc (product/service code), awarding_agency, awarding_subagency, funding_agency, funding_subagency, cfda (assistance programs), recipient_duns, or recipient_parent_duns'}}, 'additionalProperties': False}
Schéma de sortie
{'type': 'object', 'anyOf': [{'not': {'required': ['error']}, 'required': ['category', 'results', 'page_metadata', 'page', 'has_next']}, {'required': ['error']}], '$schema': 'https://json-schema.org/draft/2020-12/schema', 'properties': {'page': {'type': 'number', 'description': 'Current page returned'}, 'error': {'type': 'object', 'required': ['code', 'message'], 'properties': {'code': {'type': 'integer', 'maximum': 9007199254740991, 'minimum': -9007199254740991, 'description': 'JSON-RPC error code for this failure.'}, 'data': {'type': 'object', 'properties': {'reason': {'type': 'string', 'examples': ['api_unavailable', 'api_timeout', 'date_range_inverted', 'date_before_earliest'], 'description': 'Machine-readable failure mode. Declared by this tool: `api_unavailable`: USAspending.gov API is unreachable or returns an error. `api_timeout`: USAspending.gov did not respond before the request deadline elapsed. `date_range_inverted`: Both filters.time_period_start and filters.time_period_end were supplied and the start falls after the end. `date_before_earliest`: The resolved start date precedes the 2007-10-01 earliest date this endpoint can search. Other values are possible when a failure originates below the handler.'}, 'recovery': {'type': 'object', 'required': ['hint'], 'properties': {'hint': {'type': 'string'}}, 'description': 'Actionable next step for the caller.', 'additionalProperties': {}}, 'retryable': {'type': 'boolean', 'description': 'Whether retrying may succeed.'}}, 'additionalProperties': {}}, 'message': {'type': 'string', 'description': 'Human-readable description of what went wrong.'}}, 'description': 'Present when the call failed. Absent on success.', 'additionalProperties': {}}, 'notice': {'type': 'string', 'description': 'Names a date bound that was filled in because only the other was supplied, and suggests how to broaden filters when results are empty. Absent when neither applies.'}, 'results': {'type': 'array', 'items': {'type': 'object', 'properties': {'id': {'type': 'string', 'description': 'Item identifier (varies by category)'}, 'code': {'type': 'string', 'description': 'Code value (NAICS, PSC, CFDA number, etc.)'}, 'name': {'type': 'string', 'description': 'Item name or description'}, 'amount': {'type': 'number', 'description': 'Total obligation amount in USD'}}, 'description': 'Category item with code, name, and obligation amount', 'additionalProperties': False}, 'description': 'Top items in this category by obligation amount'}, 'category': {'type': 'string', 'description': 'Breakdown dimension used'}, 'has_next': {'type': 'boolean', 'description': 'Whether there are more pages'}, 'totalCount': {'type': 'number', 'description': 'Total number of items in this category (when available)'}, 'page_metadata': {'type': 'object', 'required': ['has_next', 'page', 'limit'], 'properties': {'page': {'type': 'number', 'description': 'Current page'}, 'limit': {'type': 'number', 'description': 'Items per page'}, 'total': {'type': 'number', 'description': 'Total items'}, 'has_next': {'type': 'boolean', 'description': 'Whether there are more pages'}}, 'description': 'Pagination metadata', 'additionalProperties': False}, 'applied_keywords': {'type': 'string', 'description': 'Keyword filters applied (comma-separated)'}, 'applied_agency_name': {'type': 'string', 'description': 'Awarding agency name filter applied'}, 'applied_naics_codes': {'type': 'string', 'description': 'NAICS code filters applied (comma-separated)'}, 'applied_time_period_end': {'type': 'string', 'description': 'End date sent (YYYY-MM-DD), including a filled-in end'}, 'applied_time_period_start': {'type': 'string', 'description': 'Start date sent (YYYY-MM-DD), including a filled-in start'}}, 'additionalProperties': False}
usaspending_spending_by_geography
Spending by Geography
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.
Lecture seule Accès externe Idempotent
Schéma d’entrée
{'type': 'object', '$schema': 'https://json-schema.org/draft/2020-12/schema', 'required': ['scope', 'geo_layer'], 'properties': {'limit': {'type': 'integer', 'default': 50, 'maximum': 500, 'minimum': 1, 'description': 'Maximum geographic areas to return, ranked by aggregated_amount descending (1â\x80\x93500). The upstream endpoint is not paginated â\x80\x94 it returns every matching area in one response â\x80\x94 so this caps client-side. A nationwide county query matches over 3,000 areas.'}, 'scope': {'enum': ['place_of_performance', 'recipient_location'], 'type': 'string', 'description': 'Which location to aggregate by: place_of_performance (where work is done) or recipient_location (where the recipient is based)'}, 'filters': {'type': 'object', 'properties': {'keywords': {'type': 'array', 'items': {'type': 'string'}, 'description': 'Full-text keyword filter (e.g., ["cybersecurity", "cloud"])'}, 'agency_name': {'type': 'string', 'description': 'Awarding agency name filter'}, 'naics_codes': {'type': 'array', 'items': {'type': 'string'}, 'description': 'NAICS industry codes to include'}, 'recipient_id': {'type': 'string', 'description': 'Exact recipient hash ID to filter awards'}, 'time_period_end': {'anyOf': [{'type': 'string', 'const': ''}, {'type': 'string', 'pattern': '^\\d{4}-\\d{1,2}-\\d{1,2}$', 'description': 'Date as YYYY-MM-DD; month and day may be unpadded'}], 'description': 'End of time period (YYYY-MM-DD). Given alone, the period starts at 2007-10-01, the earliest searchable date.'}, 'award_type_codes': {'type': 'array', 'items': {'type': 'string'}, 'description': 'Award type codes: A/B/C/D (contracts), IDV_Aâ\x80\x93IDV_E (IDVs), 02â\x80\x9305 (grants), 06/10 (direct payments), 07/08 (loans), 09/11 (insurance and other assistance), -1 (unspecified). Groups may be mixed here. Omit to aggregate every type.'}, 'time_period_start': {'anyOf': [{'type': 'string', 'const': ''}, {'type': 'string', 'pattern': '^\\d{4}-\\d{1,2}-\\d{1,2}$', 'description': 'Date as YYYY-MM-DD; month and day may be unpadded'}], 'description': 'Start of time period (YYYY-MM-DD), 2007-10-01 or later. Given alone, the period runs through today (UTC).'}}, 'description': 'Optional filters to scope the spending aggregation'}, 'geo_layer': {'enum': ['state', 'county', 'district'], 'type': 'string', 'description': 'Geographic granularity: state (50 states), county (county-level), or district (congressional district)'}, 'subawards': {'type': 'boolean', 'default': False, 'description': 'Include subaward data instead of prime award data'}}, 'additionalProperties': False}
Schéma de sortie
{'type': 'object', 'anyOf': [{'not': {'required': ['error']}, 'required': ['scope', 'geo_layer', 'results', 'total', 'total_areas_available', 'applied_scope', 'applied_geo_layer', 'area_count']}, {'required': ['error']}], '$schema': 'https://json-schema.org/draft/2020-12/schema', 'properties': {'cap': {'type': 'number', 'description': 'The limit that was applied.'}, 'error': {'type': 'object', 'required': ['code', 'message'], 'properties': {'code': {'type': 'integer', 'maximum': 9007199254740991, 'minimum': -9007199254740991, 'description': 'JSON-RPC error code for this failure.'}, 'data': {'type': 'object', 'properties': {'reason': {'type': 'string', 'examples': ['api_unavailable', 'api_timeout', 'date_range_inverted', 'date_before_earliest'], 'description': 'Machine-readable failure mode. Declared by this tool: `api_unavailable`: USAspending.gov API is unreachable or returns an error. `api_timeout`: USAspending.gov did not respond before the request deadline elapsed. `date_range_inverted`: Both filters.time_period_start and filters.time_period_end were supplied and the start falls after the end. `date_before_earliest`: The resolved start date precedes the 2007-10-01 earliest date this endpoint can search. Other values are possible when a failure originates below the handler.'}, 'recovery': {'type': 'object', 'required': ['hint'], 'properties': {'hint': {'type': 'string'}}, 'description': 'Actionable next step for the caller.', 'additionalProperties': {}}, 'retryable': {'type': 'boolean', 'description': 'Whether retrying may succeed.'}}, 'additionalProperties': {}}, 'message': {'type': 'string', 'description': 'Human-readable description of what went wrong.'}}, 'description': 'Present when the call failed. Absent on success.', 'additionalProperties': {}}, 'scope': {'type': 'string', 'description': 'Location scope used for aggregation'}, 'shown': {'type': 'number', 'description': 'Number of geographic areas returned.'}, 'total': {'type': 'number', 'description': 'Number of geographic areas returned'}, 'notice': {'type': 'string', 'description': 'How to reach areas omitted by limit, which time-period bound was filled in when only the other was supplied, and how to broaden filters when results are empty. Absent when none applies.'}, 'results': {'type': 'array', 'items': {'type': 'object', 'properties': {'per_capita': {'type': 'number', 'description': 'Per-capita obligation amount in USD (aggregated_amount / population)'}, 'population': {'type': 'number', 'description': 'Population of the geographic area (when available)'}, 'shape_code': {'type': 'string', 'description': 'Geographic identifier (FIPS state code, county FIPS, or district code)'}, 'award_count': {'type': 'number', 'description': 'Number of awards in this area'}, 'display_name': {'type': 'string', 'description': 'Human-readable name for the geographic area'}, 'aggregated_amount': {'type': 'number', 'description': 'Total obligation amount in USD for this geographic area'}}, 'description': 'Geographic area with spending totals and optional per-capita data', 'additionalProperties': False}, 'description': 'Spending totals by geographic area'}, 'geo_layer': {'type': 'string', 'description': 'Geographic granularity used'}, 'truncated': {'type': 'boolean', 'description': 'True when the area list was capped at limit.'}, 'area_count': {'type': 'number', 'description': 'Number of geographic areas returned'}, 'applied_scope': {'type': 'string', 'description': 'Location scope applied: place_of_performance or recipient_location'}, 'applied_keywords': {'type': 'string', 'description': 'Keyword filters applied (comma-separated)'}, 'applied_geo_layer': {'type': 'string', 'description': 'Geographic granularity applied: state, county, or district'}, 'truncationCeiling': {'type': 'number', 'description': 'Obligation amount of the lowest-ranked area shown â\x80\x94 an upper bound on omitted ones.'}, 'applied_agency_name': {'type': 'string', 'description': 'Awarding agency name filter applied'}, 'applied_naics_codes': {'type': 'string', 'description': 'NAICS code filters applied (comma-separated)'}, 'total_areas_available': {'type': 'number', 'description': 'Number of geographic areas the filters matched, before limit was applied'}, 'applied_time_period_end': {'type': 'string', 'description': 'End of the time period sent (YYYY-MM-DD), including a filled-in end'}, 'applied_time_period_start': {'type': 'string', 'description': 'Start of the time period sent (YYYY-MM-DD), including a filled-in start'}, 'applied_award_type_default': {'type': 'string', 'description': 'Disclosure that no filters were supplied, so award_type_codes defaulted to the complete set. Absent when the caller supplied at least one filter.'}}, 'additionalProperties': False}
usaspending_spending_over_time
Spending Over Time
Fetch aggregated federal obligation amounts grouped by fiscal year, fiscal quarter, or fiscal month. All grouping is relative to the US government fiscal year (Oct–Sep), so fiscal month 1 is October, not January. Filter by award type, agency, recipient, keyword, or NAICS code to trace spending trends in a specific area. Returns per-period totals and optional breakdowns by award category (contracts, grants, direct payments, IDVs, loans, other).
Lecture seule Accès externe Idempotent
Schéma d’entrée
{'type': 'object', '$schema': 'https://json-schema.org/draft/2020-12/schema', 'required': ['group'], 'properties': {'group': {'enum': ['fiscal_year', 'quarter', 'month'], 'type': 'string', 'description': 'Time grouping: fiscal_year (annual US govt FY: Octâ\x80\x93Sep), quarter (fiscal quarter), or month (fiscal month â\x80\x94 an ordinal within the fiscal year, where 1 = October)'}, 'filters': {'type': 'object', 'properties': {'keywords': {'type': 'array', 'items': {'type': 'string'}, 'description': 'Full-text keyword filters'}, 'agency_name': {'type': 'string', 'description': 'Awarding agency name filter'}, 'naics_codes': {'type': 'array', 'items': {'type': 'string'}, 'description': 'NAICS code filters'}, 'recipient_id': {'type': 'string', 'description': 'Exact recipient hash ID filter'}, 'time_period_end': {'anyOf': [{'type': 'string', 'const': ''}, {'type': 'string', 'pattern': '^\\d{4}-\\d{1,2}-\\d{1,2}$', 'description': 'Date as YYYY-MM-DD; month and day may be unpadded'}], 'description': 'End of the time window (YYYY-MM-DD). Given alone, the window starts at 2007-10-01, the earliest searchable date.'}, 'award_type_codes': {'type': 'array', 'items': {'type': 'string'}, 'description': 'Award type code filters (A/B/C/D, 02â\x80\x9305, etc.). All codes must belong to a single group. When omitted, defaults to contracts (A, B, C, D).'}, 'time_period_start': {'anyOf': [{'type': 'string', 'const': ''}, {'type': 'string', 'pattern': '^\\d{4}-\\d{1,2}-\\d{1,2}$', 'description': 'Date as YYYY-MM-DD; month and day may be unpadded'}], 'description': 'Start of the time window (YYYY-MM-DD), 2007-10-01 or later. Given alone, the window runs through today (UTC).'}}, 'description': 'Filters to scope the time-series aggregation. Defaults to contract awards when omitted.'}, 'subawards': {'type': 'boolean', 'default': False, 'description': 'Aggregate subaward data instead of prime award data'}}, 'additionalProperties': False}
Schéma de sortie
{'type': 'object', 'anyOf': [{'not': {'required': ['error']}, 'required': ['group', 'results', 'total_periods', 'time_group', 'period_count']}, {'required': ['error']}], '$schema': 'https://json-schema.org/draft/2020-12/schema', 'properties': {'error': {'type': 'object', 'required': ['code', 'message'], 'properties': {'code': {'type': 'integer', 'maximum': 9007199254740991, 'minimum': -9007199254740991, 'description': 'JSON-RPC error code for this failure.'}, 'data': {'type': 'object', 'properties': {'reason': {'type': 'string', 'examples': ['api_unavailable', 'api_timeout', 'date_range_inverted', 'date_before_earliest'], 'description': 'Machine-readable failure mode. Declared by this tool: `api_unavailable`: USAspending.gov API is unreachable or returns an error. `api_timeout`: USAspending.gov did not respond before the request deadline elapsed. `date_range_inverted`: Both filters.time_period_start and filters.time_period_end were supplied and the start falls after the end. `date_before_earliest`: The resolved start date precedes the 2007-10-01 earliest date this endpoint can search. Other values are possible when a failure originates below the handler.'}, 'recovery': {'type': 'object', 'required': ['hint'], 'properties': {'hint': {'type': 'string'}}, 'description': 'Actionable next step for the caller.', 'additionalProperties': {}}, 'retryable': {'type': 'boolean', 'description': 'Whether retrying may succeed.'}}, 'additionalProperties': {}}, 'message': {'type': 'string', 'description': 'Human-readable description of what went wrong.'}}, 'description': 'Present when the call failed. Absent on success.', 'additionalProperties': {}}, 'group': {'type': 'string', 'description': 'Time grouping used'}, 'notice': {'type': 'string', 'description': 'Names a time-window bound that was filled in because only the other was supplied, and suggests broadening filters when no periods are returned. Absent when neither applies.'}, 'results': {'type': 'array', 'items': {'type': 'object', 'required': ['time_period'], 'properties': {'idvs': {'type': 'number', 'description': 'IDV (Indefinite Delivery Vehicle) obligation amount in USD for this period'}, 'loans': {'type': 'number', 'description': 'Loan obligation amount in USD for this period'}, 'other': {'type': 'number', 'description': 'Other financial assistance obligation amount in USD for this period'}, 'grants': {'type': 'number', 'description': 'Grant obligation amount in USD for this period'}, 'contracts': {'type': 'number', 'description': 'Contract obligation amount in USD for this period'}, 'time_period': {'type': 'object', 'properties': {'month': {'type': 'string', 'description': 'Fiscal month: an ordinal within fiscal_year, 1â\x80\x9312, where 1 = October and 12 = September. Fiscal month 1 of FY2025 is October 2024 â\x80\x94 not January.'}, 'quarter': {'type': 'string', 'description': 'Fiscal quarter (1â\x80\x934)'}, 'fiscal_year': {'type': 'string', 'description': 'Fiscal year (e.g., 2024)'}}, 'description': 'Time period for this row. Populated per the requested grouping: fiscal_year alone, fiscal_year + quarter, or fiscal_year + month.', 'additionalProperties': False}, 'direct_payments': {'type': 'number', 'description': 'Direct payment obligation amount in USD for this period'}, 'aggregated_amount': {'type': 'number', 'description': 'Total obligation amount in USD for this period'}}, 'description': 'Time period row with total obligations and optional award-type breakdowns', 'additionalProperties': False}, 'description': 'Time-series of obligation totals'}, 'time_group': {'type': 'string', 'description': 'Time grouping applied: fiscal_year, quarter, or month'}, 'period_count': {'type': 'number', 'description': 'Number of time periods returned'}, 'total_periods': {'type': 'number', 'description': 'Number of time periods returned'}, 'applied_keywords': {'type': 'string', 'description': 'Keyword filters applied (comma-separated)'}, 'applied_agency_name': {'type': 'string', 'description': 'Awarding agency name filter applied'}, 'applied_naics_codes': {'type': 'string', 'description': 'NAICS code filters applied (comma-separated)'}, 'applied_time_period_end': {'type': 'string', 'description': 'End of the time window sent (YYYY-MM-DD), including a filled-in end'}, 'applied_time_period_start': {'type': 'string', 'description': 'Start of the time window sent (YYYY-MM-DD), including a filled-in start'}}, 'additionalProperties': False}
Modifié
usaspending_disaster_spending
27 September 2026 02:44
Modifié
usaspending_spending_over_time
27 September 2026 02:44
Modifié
usaspending_spending_by_category
27 September 2026 02:44
Modifié
usaspending_spending_by_geography
27 September 2026 02:44
Modifié
usaspending_search_awards
27 September 2026 02:44
Modifié
usaspending_autocomplete_filters
27 September 2026 02:44
Ajouté
usaspending_search_federal_accounts
17 September 2026 12:41
Ajouté
usaspending_get_federal_account_breakdown
17 September 2026 12:41
Ajouté
usaspending_get_federal_account
17 September 2026 12:41
Ajouté
usaspending_disaster_spending
17 September 2026 12:41
Ajouté
usaspending_spending_over_time
17 September 2026 12:41
Ajouté
usaspending_spending_by_category
17 September 2026 12:41
Ajouté
usaspending_spending_by_geography
17 September 2026 12:41
Ajouté
usaspending_get_agency
17 September 2026 12:41
Ajouté
usaspending_get_recipient
17 September 2026 12:41
Ajouté
usaspending_search_recipients
17 September 2026 12:41
Ajouté
usaspending_get_idv_awards
17 September 2026 12:41
Ajouté
usaspending_get_award_federal_accounts
17 September 2026 12:41
Ajouté
usaspending_get_award_subawards
17 September 2026 12:41
Ajouté
usaspending_get_award_transactions
17 September 2026 12:41
Ajouté
usaspending_get_award
17 September 2026 12:41
Ajouté
usaspending_search_awards
17 September 2026 12:41
Ajouté
usaspending_autocomplete_filters
17 September 2026 12:41
Ajouté
usaspending_list_agencies
17 September 2026 12:41