@cyanheads/usaspending-mcp-server 0.4.3 → 0.4.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AGENTS.md +12 -11
- package/CLAUDE.md +12 -11
- package/Dockerfile +91 -44
- package/README.md +104 -138
- package/changelog/0.4.x/0.4.4.md +31 -0
- package/changelog/0.4.x/0.4.5.md +31 -0
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/mcp-server/tools/definitions/autocomplete-filters.tool.js +2 -2
- package/dist/mcp-server/tools/definitions/autocomplete-filters.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/dates.d.ts +95 -0
- package/dist/mcp-server/tools/definitions/dates.d.ts.map +1 -0
- package/dist/mcp-server/tools/definitions/dates.js +145 -0
- package/dist/mcp-server/tools/definitions/dates.js.map +1 -0
- package/dist/mcp-server/tools/definitions/disaster-spending.tool.d.ts +8 -1
- package/dist/mcp-server/tools/definitions/disaster-spending.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/disaster-spending.tool.js +93 -14
- package/dist/mcp-server/tools/definitions/disaster-spending.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/filters.d.ts +11 -2
- package/dist/mcp-server/tools/definitions/filters.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/filters.js +12 -5
- package/dist/mcp-server/tools/definitions/filters.js.map +1 -1
- package/dist/mcp-server/tools/definitions/get-agency.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/get-agency.tool.js +4 -4
- package/dist/mcp-server/tools/definitions/get-agency.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/get-award.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/get-award.tool.js +1 -1
- package/dist/mcp-server/tools/definitions/get-award.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/get-federal-account.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/get-federal-account.tool.js +1 -1
- package/dist/mcp-server/tools/definitions/get-federal-account.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/get-recipient.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/get-recipient.tool.js +1 -1
- package/dist/mcp-server/tools/definitions/get-recipient.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/index.d.ts +81 -12
- package/dist/mcp-server/tools/definitions/index.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/search-awards.tool.d.ts +31 -5
- package/dist/mcp-server/tools/definitions/search-awards.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/search-awards.tool.js +213 -52
- package/dist/mcp-server/tools/definitions/search-awards.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/spending-by-category.tool.d.ts +14 -2
- package/dist/mcp-server/tools/definitions/spending-by-category.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/spending-by-category.tool.js +44 -12
- package/dist/mcp-server/tools/definitions/spending-by-category.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/spending-by-geography.tool.d.ts +14 -2
- package/dist/mcp-server/tools/definitions/spending-by-geography.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/spending-by-geography.tool.js +49 -19
- package/dist/mcp-server/tools/definitions/spending-by-geography.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/spending-over-time.tool.d.ts +14 -2
- package/dist/mcp-server/tools/definitions/spending-over-time.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/spending-over-time.tool.js +44 -12
- package/dist/mcp-server/tools/definitions/spending-over-time.tool.js.map +1 -1
- package/dist/services/usaspending/types.d.ts +28 -2
- package/dist/services/usaspending/types.d.ts.map +1 -1
- package/dist/services/usaspending/usaspending-service.d.ts +9 -13
- package/dist/services/usaspending/usaspending-service.d.ts.map +1 -1
- package/dist/services/usaspending/usaspending-service.js +108 -3
- package/dist/services/usaspending/usaspending-service.js.map +1 -1
- package/package.json +15 -13
- package/server.json +10 -24
package/README.md
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
|
|
8
8
|
<div align="center">
|
|
9
9
|
|
|
10
|
-
[](./CHANGELOG.md) [](./LICENSE) [](https://github.com/users/cyanheads/packages/container/package/usaspending-mcp-server) [](https://modelcontextprotocol.io/) [](https://www.npmjs.com/package/@cyanheads/usaspending-mcp-server) [](https://www.typescriptlang.org/) [](https://bun.sh/)
|
|
11
11
|
|
|
12
12
|
</div>
|
|
13
13
|
|
|
@@ -29,195 +29,161 @@
|
|
|
29
29
|
|
|
30
30
|
## Overview
|
|
31
31
|
|
|
32
|
-
Federal award, recipient, agency, and spending data from USAspending.gov, the US Treasury's DATA Act transparency platform. Search and trace
|
|
32
|
+
Federal award, recipient, agency, and spending data from USAspending.gov, the US Treasury's DATA Act transparency platform. Search and trace awards down to transactions, subawards, and funding accounts; profile recipients and agencies; and aggregate spending by geography, category, time, and disaster appropriation. Runs as a stdio process, a local Streamable HTTP server, or the public hosted endpoint above.
|
|
33
33
|
|
|
34
34
|
### Tools
|
|
35
35
|
|
|
36
36
|
| Tool | Description |
|
|
37
37
|
|:---|:---|
|
|
38
|
-
| `
|
|
39
|
-
| `
|
|
40
|
-
| `
|
|
41
|
-
| `
|
|
42
|
-
| `
|
|
43
|
-
| `
|
|
44
|
-
| `
|
|
45
|
-
| `
|
|
46
|
-
| `
|
|
47
|
-
| `
|
|
48
|
-
| `
|
|
49
|
-
| `
|
|
50
|
-
| `
|
|
51
|
-
| `
|
|
52
|
-
| `
|
|
53
|
-
| `usaspending_search_federal_accounts` |
|
|
54
|
-
| `
|
|
55
|
-
| `
|
|
38
|
+
| `usaspending_list_agencies` | List every top-tier federal agency with its toptier code, slug, and current-year budget totals |
|
|
39
|
+
| `usaspending_autocomplete_filters` | Look up NAICS, PSC, CFDA, agency, or recipient codes from a free-text description |
|
|
40
|
+
| `usaspending_search_awards` | Search awards by keyword, recipient, agency, award type, NAICS code, assistance listing, location, or date range |
|
|
41
|
+
| `usaspending_get_award` | Fetch one award's full record: amounts, recipient, agencies, codes, parent IDV, DEF-code funding |
|
|
42
|
+
| `usaspending_get_award_transactions` | List the transactions (modifications, amendments) on an award |
|
|
43
|
+
| `usaspending_get_award_subawards` | List the subcontracts or subgrants under a prime award |
|
|
44
|
+
| `usaspending_get_award_federal_accounts` | List the Treasury federal accounts that funded an award, with the amount from each |
|
|
45
|
+
| `usaspending_get_idv_awards` | List the child orders and sub-IDVs placed under an IDV |
|
|
46
|
+
| `usaspending_search_recipients` | Search recipients by name, UEI, or DUNS |
|
|
47
|
+
| `usaspending_get_recipient` | Fetch a recipient's profile: address, business types, parent, and award totals |
|
|
48
|
+
| `usaspending_get_agency` | Fetch an agency's mission, latest-year budget totals, sub-agencies, and DEF codes |
|
|
49
|
+
| `usaspending_spending_by_geography` | Aggregate spending by state, county, or congressional district |
|
|
50
|
+
| `usaspending_spending_by_category` | Aggregate spending by NAICS, PSC, agency, CFDA program, or recipient |
|
|
51
|
+
| `usaspending_spending_over_time` | Aggregate spending by fiscal year, quarter, or month |
|
|
52
|
+
| `usaspending_disaster_spending` | Break down disaster and emergency supplemental spending by agency, program, recipient, or geography |
|
|
53
|
+
| `usaspending_search_federal_accounts` | Search federal accounts by title keyword or agency identifier |
|
|
54
|
+
| `usaspending_get_federal_account` | Fetch a federal account's budget totals and its Treasury Account Symbol components |
|
|
55
|
+
| `usaspending_get_federal_account_breakdown` | Break a federal account's obligations down by program activity or object class |
|
|
56
56
|
|
|
57
57
|
## Capability reference
|
|
58
58
|
|
|
59
|
-
### `
|
|
59
|
+
### `usaspending_list_agencies` <sub>tool</sub>
|
|
60
60
|
|
|
61
|
-
-
|
|
62
|
-
-
|
|
63
|
-
- Filter by awarding or funding agency (toptier or subtier), recipient name, NAICS code, and place of performance
|
|
64
|
-
- Date range filtering — earliest 2007-10-01 via search API
|
|
65
|
-
- Pagination via `limit` (max 100) and `page`; `page_metadata.has_next` signals more results and is `true` on any full page — the endpoint stops advertising continuation once `page` × `limit` reaches 10,000, so page fullness is the honest signal past that point. Page-number paging caps at a 50,000-result offset — beyond it, continue with keyset pagination using the `last_record_sort_value` + `last_record_unique_id` cursor, which is only returned below the 10,000-result offset and has to be captured before crossing it
|
|
66
|
-
- Returns `generated_internal_id` for chaining to `usaspending_get_award` and `agency_slug` for chaining to `usaspending_get_agency`
|
|
61
|
+
- Takes only `sort` (`agency_name`, `budget_authority_amount`, `obligated_amount`, `outlay_amount`) and `order`; returns every agency in one unpaginated response
|
|
62
|
+
- Rows carry `toptier_code` and `agency_slug`, both accepted by `usaspending_get_agency`, plus current-year `budget_authority_amount`, `obligated_amount`, and `outlay_amount`
|
|
67
63
|
|
|
68
64
|
---
|
|
69
65
|
|
|
70
|
-
### `
|
|
66
|
+
### `usaspending_autocomplete_filters` <sub>tool</sub>
|
|
71
67
|
|
|
72
|
-
-
|
|
73
|
-
-
|
|
74
|
-
-
|
|
75
|
-
- Includes NAICS code and product/service code from the latest transaction
|
|
76
|
-
- Returns `account_obligations_by_defc` linking the award to specific disaster/emergency appropriations
|
|
77
|
-
- Award IDs use the `generated_unique_award_id` format (e.g., `CONT_AWD_FA862118F6251_9700_...`)
|
|
68
|
+
- `type` (`naics`, `psc`, `cfda`, `awarding_agency`, `recipient`) plus `search_text`; `limit` 1–500, default 10
|
|
69
|
+
- Rows carry `code` and `name`, with `id` for agencies and `uei` / `duns` for recipients; no match fails as `no_match`. A `cfda` code is what `usaspending_search_awards` takes in `assistance_listings`
|
|
70
|
+
- `naics` matches official NAICS title text: "software" resolves, "cybersecurity" does not, so search with the industry term a title would use
|
|
78
71
|
|
|
79
72
|
---
|
|
80
73
|
|
|
81
|
-
### `
|
|
74
|
+
### `usaspending_search_awards` <sub>tool</sub>
|
|
75
|
+
|
|
76
|
+
- Filters: `keyword`, `agency_name`, `recipient_name`, `naics_codes`, `assistance_listings` (Assistance Listing numbers such as `93.866`, from `usaspending_autocomplete_filters` `type: cfda`), `time_period` (`YYYY-MM-DD` from 2007-10-01 on; either end may be given alone), and `location_filter`; `award_type_codes` defaults to contracts (`A`–`D`) and must stay in one group: IDVs `IDV_A`–`IDV_E`, grants `02`–`05`/`F001`/`F002`, direct payments `06`/`10`/`F006`/`F007`, loans `07`/`08`/`F003`/`F004`, or other assistance `09`/`11`/`-1`/`F005`/`F008`/`F009`/`F010`; `limit` up to 100
|
|
77
|
+
- Rows carry `generated_internal_id` for `usaspending_get_award` and `agency_slug` for `usaspending_get_agency`; loan rows carry `loan_value`, `subsidy_cost`, and `issued_date` in place of amounts and dates. There is no total, and `page_metadata.has_next` is true on any full page. Failures are `assistance_listings_type_mismatch` (listings with a non-assistance group), `unsupported_sort`, `date_range_inverted`, and `date_before_earliest`
|
|
78
|
+
- `sort` depends on the group: loans take `Loan Value` (default), `Subsidy Cost`, `Issued Date`, `Recipient Name`, or `Awarding Agency`; the others `Award Amount` (default), `Total Outlays`, `Start Date`, `End Date` (not IDVs), `Recipient Name`, or `Awarding Agency`. Page numbers stop at a 50,000-result offset (`pagination_limit_exceeded`); past it, page with the `last_record_sort_value` + `last_record_unique_id` cursor, returned below a 10,000-result offset
|
|
79
|
+
|
|
80
|
+
---
|
|
81
|
+
|
|
82
|
+
### `usaspending_get_award` <sub>tool</sub>
|
|
82
83
|
|
|
83
|
-
- `award_id`
|
|
84
|
-
- `
|
|
85
|
-
-
|
|
86
|
-
- Pagination via `limit` and `page`; note: no `total` count is available from this endpoint
|
|
87
|
-
- An invalid `award_id` or an IDV with no children of the requested type returns an empty result set
|
|
84
|
+
- `award_id` is a `generated_unique_award_id`, the `generated_internal_id` from search; an unknown ID fails as `award_not_found`
|
|
85
|
+
- Returns `category`, `total_obligation`, `total_outlays`, `subaward_count`, NAICS / PSC or CFDA codes, and `account_obligations_by_defc`
|
|
86
|
+
- `recipient.recipient_id` chains to `usaspending_get_recipient` and `parent_award.generated_unique_award_id` to the parent IDV; `category: "idv"` awards list their children via `usaspending_get_idv_awards`
|
|
88
87
|
|
|
89
88
|
---
|
|
90
89
|
|
|
91
90
|
### `usaspending_get_award_transactions` <sub>tool</sub>
|
|
92
91
|
|
|
93
|
-
-
|
|
94
|
-
-
|
|
92
|
+
- `award_id` plus `sort` (`action_date`, `federal_action_obligation`, `modification_number`); `limit` up to 100
|
|
93
|
+
- Rows carry `action_date`, `modification_number`, `action_type`, and a signed `federal_action_obligation` (negative is a deobligation)
|
|
95
94
|
|
|
96
95
|
---
|
|
97
96
|
|
|
98
97
|
### `usaspending_get_award_subawards` <sub>tool</sub>
|
|
99
98
|
|
|
100
|
-
-
|
|
101
|
-
-
|
|
102
|
-
- Pagination via `limit` and `page`; configurable sort and order. No `total` count is available from this endpoint
|
|
99
|
+
- `award_id` plus `sort` (`subaward_number`, `description`, `action_date`, `amount`, `recipient_name`); `limit` up to 100
|
|
100
|
+
- Rows carry `subaward_number`, `amount`, `action_date`, `recipient_name`, `recipient_uei`, and place of performance; `subaward_count` on `usaspending_get_award` says whether any exist
|
|
103
101
|
|
|
104
102
|
---
|
|
105
103
|
|
|
106
104
|
### `usaspending_get_award_federal_accounts` <sub>tool</sub>
|
|
107
105
|
|
|
108
|
-
- `award_id`
|
|
109
|
-
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
106
|
+
- `award_id` is a `generated_unique_award_id`; `limit` up to 100, with `page_metadata.count` as the total
|
|
107
|
+
- Rows carry `federal_account` (AGENCY-MAIN, e.g. `080-0120`) for `usaspending_get_federal_account`, `total_transaction_obligated_amount`, and the funding agency with its `funding_agency_slug`
|
|
108
|
+
|
|
109
|
+
---
|
|
110
|
+
|
|
111
|
+
### `usaspending_get_idv_awards` <sub>tool</sub>
|
|
112
|
+
|
|
113
|
+
- Parent IDV `award_id`; `type` is `child_awards` (task and delivery orders, the default), `child_idvs`, or `grandchild_awards`; `limit` up to 100
|
|
114
|
+
- Rows carry `generated_unique_award_id` for `usaspending_get_award`, `obligated_amount`, and performance dates; there is no total, and `has_next` is true on any full page
|
|
113
115
|
|
|
114
116
|
---
|
|
115
117
|
|
|
116
118
|
### `usaspending_search_recipients` <sub>tool</sub>
|
|
117
119
|
|
|
118
|
-
-
|
|
119
|
-
- `
|
|
120
|
-
- Paginated via `limit` (max 100) and `page`; `page_metadata` reports `total`, `page`, and `has_next` — page through to reach matches beyond the first page
|
|
120
|
+
- `keyword` matches names, UEI, or DUNS, partial matches included; optional `award_type` scopes the totals; `limit` up to 100
|
|
121
|
+
- Rows carry `id` (a hash suffixed `-P` parent, `-C` child, or `-R` standalone) for `usaspending_get_recipient`, plus `uei`, `duns`, `recipient_level`, and `amount`; `page_metadata.total` is the full match count
|
|
121
122
|
|
|
122
123
|
---
|
|
123
124
|
|
|
124
125
|
### `usaspending_get_recipient` <sub>tool</sub>
|
|
125
126
|
|
|
126
|
-
-
|
|
127
|
-
-
|
|
128
|
-
- Requires the UUID-based recipient ID from `usaspending_search_recipients`
|
|
127
|
+
- `recipient_id` from `usaspending_search_recipients` or `usaspending_get_award`; optional `fiscal_year` (2001–2030) and `award_type` scope the totals; an unknown ID fails as `recipient_not_found`
|
|
128
|
+
- Returns address, `business_types`, `parent_name` / `parent_uei`, `alternate_names`, `total_transaction_amount`, `total_transactions`, and loan face-value totals
|
|
129
129
|
|
|
130
130
|
---
|
|
131
131
|
|
|
132
132
|
### `usaspending_get_agency` <sub>tool</sub>
|
|
133
133
|
|
|
134
|
-
-
|
|
135
|
-
-
|
|
136
|
-
- Includes sub-agency breakdown with transaction counts
|
|
134
|
+
- One of `toptier_code` (e.g. `097`) or `agency_slug` (e.g. `department-of-defense`); `page` walks the sub-agency list 10 at a time. Failures are `missing_input` and `agency_not_found`
|
|
135
|
+
- Returns `mission`, plus `budgetary_resources_amount`, `obligated_amount`, and `outlay_amount` for the latest `fiscal_year`, `sub_agencies` with obligations and transaction and new-award counts, and `def_codes`
|
|
137
136
|
|
|
138
137
|
---
|
|
139
138
|
|
|
140
139
|
### `usaspending_spending_by_geography` <sub>tool</sub>
|
|
141
140
|
|
|
142
|
-
- `scope
|
|
143
|
-
- `
|
|
144
|
-
-
|
|
145
|
-
- `limit` accepts 1–500 (default 50). The upstream endpoint is not paginated — a nationwide county query matches over 3,000 areas — so areas are ranked by `aggregated_amount` descending and capped client-side; `total_areas_available` reports the full match count
|
|
146
|
-
- Omitting `filters` entirely aggregates every award type (contracts, IDVs, grants, direct payments, loans, insurance, and unspecified); the substitution is disclosed on the response
|
|
147
|
-
- Geographic filters require FIPS codes or 2-letter state abbreviations — use a geocoding server (e.g., Census or OpenStreetMap) to resolve place names first
|
|
141
|
+
- `scope` (`place_of_performance`, `recipient_location`) and `geo_layer` (`state`, `county`, `district`) are required; `filters` takes `keywords`, `award_type_codes`, `agency_name`, `recipient_id`, `naics_codes`, and `time_period_start` / `time_period_end` (`YYYY-MM-DD`; either alone fills the other, as in `usaspending_search_awards`, `applied_time_period_*` echoes the range sent, a start after the end fails as `date_range_inverted`, and a range starting before 2007-10-01 fails as `date_before_earliest`); `limit` 1–500, default 50
|
|
142
|
+
- Rows carry `shape_code`, `display_name`, `aggregated_amount`, `population`, `per_capita`, and `award_count`, ranked by amount; `total_areas_available` counts every match before the cap
|
|
143
|
+
- With no filters, every award type is aggregated and `applied_award_type_default` says so; `subawards: true` switches to subaward data
|
|
148
144
|
|
|
149
145
|
---
|
|
150
146
|
|
|
151
147
|
### `usaspending_spending_by_category` <sub>tool</sub>
|
|
152
148
|
|
|
153
|
-
- `category`
|
|
154
|
-
-
|
|
155
|
-
- Accepts the standard award filter object for scoping to a specific agency, time period, or keyword
|
|
156
|
-
- Pagination via `limit` and `page`; no `total` count is available from this endpoint
|
|
149
|
+
- `category` is `naics`, `psc`, `awarding_agency`, `awarding_subagency`, `funding_agency`, `funding_subagency`, `cfda`, `recipient_duns`, or `recipient_parent_duns`; takes the same `filters` object as `usaspending_spending_by_geography`; `limit` up to 100
|
|
150
|
+
- Rows carry `id`, `code`, `name`, and `amount`, ranked by obligation
|
|
157
151
|
|
|
158
152
|
---
|
|
159
153
|
|
|
160
154
|
### `usaspending_spending_over_time` <sub>tool</sub>
|
|
161
155
|
|
|
162
|
-
- `group
|
|
163
|
-
-
|
|
164
|
-
- `subawards: true` shifts aggregation to the subaward layer
|
|
156
|
+
- `group` is `fiscal_year`, `quarter`, or `month` (fiscal month, where 1 is October); the same `filters` object, with `award_type_codes` defaulting to contracts and limited to one group; `subawards: true` switches to subaward data
|
|
157
|
+
- Rows carry `time_period`, `aggregated_amount`, and per-type `contracts`, `grants`, `direct_payments`, `idvs`, `loans`, and `other`
|
|
165
158
|
|
|
166
159
|
---
|
|
167
160
|
|
|
168
161
|
### `usaspending_disaster_spending` <sub>tool</sub>
|
|
169
162
|
|
|
170
|
-
- `dimension`
|
|
171
|
-
- `
|
|
172
|
-
-
|
|
173
|
-
- Returns obligation, outlay, and award count per row
|
|
174
|
-
|
|
175
|
-
---
|
|
176
|
-
|
|
177
|
-
### `usaspending_get_federal_account` <sub>tool</sub>
|
|
178
|
-
|
|
179
|
-
- Returns account title, federal account code, agency identifier, parent agency, and bureau
|
|
180
|
-
- Includes the fiscal year snapshot: total obligations, gross outlays, and budgetary resources
|
|
181
|
-
- `children` breaks the account into its Treasury Account Symbol (TAS) components, each with its own obligated, outlay, and budgetary-resource amounts — one entry per availability period, bounded and returned in full
|
|
182
|
-
- Account codes come from `account_number` in `usaspending_search_federal_accounts` results, or `federal_account` in `usaspending_get_award_federal_accounts` results
|
|
183
|
-
- For obligations broken down by program activity or object class, use `usaspending_get_federal_account_breakdown`
|
|
184
|
-
|
|
185
|
-
---
|
|
186
|
-
|
|
187
|
-
### `usaspending_get_federal_account_breakdown` <sub>tool</sub>
|
|
188
|
-
|
|
189
|
-
- `dimension` enum selects the axis: `program_activity` (what the money funds) or `object_class` (what it buys — personnel, supplies, contracts)
|
|
190
|
-
- Each row returns the code, name, and obligated amount; `program_activity` rows also carry `type` — `PAC/PAN` (legacy program activity code/name) or `PARK` (Program Activity Reporting Key), both of which can appear for the same account
|
|
191
|
-
- Pagination via `limit` (max 100) and `page`; `total` in `page_metadata` is the true row count across pages
|
|
192
|
-
- An account code that does not exist returns an empty list rather than an error — unlike `usaspending_get_federal_account`, these routes report no not-found signal
|
|
163
|
+
- `dimension` is `overview`, `agency`, `cfda`, `recipient`, or `geography`; every dimension except `overview` requires `filters.def_codes` (e.g. `["L", "M", "N", "O", "P"]` for COVID-19); `limit` up to 100 on agency, cfda, and recipient; `spending_type` (`award`, the default, or `total`) applies to agency only, and geography takes `filters.geo_layer` (`state`, `county`)
|
|
164
|
+
- Rows carry `obligation`, `outlay`, and `award_count`, plus `total_budgetary_resources` on agency rows under `spending_type: total`; `overview` returns totals and `funding_by_def_code`. A recipient row's `id` chains to `usaspending_get_recipient`. The recipient total tops out at 10,000, and a response at that cap is flagged `truncated`
|
|
165
|
+
- Agency, cfda, and recipient also return `totals` across every matching row: `obligation`, `outlay`, and either `total_budgetary_resources` (agency, `total`) or `award_count`. When `overview` outlasts the request budget, the agency breakdown with `spending_type: total` still reports obligations, outlays, and budgetary resources
|
|
193
166
|
|
|
194
167
|
---
|
|
195
168
|
|
|
196
169
|
### `usaspending_search_federal_accounts` <sub>tool</sub>
|
|
197
170
|
|
|
198
|
-
- `keyword`
|
|
199
|
-
- `
|
|
200
|
-
- `sort_field` enum: `account_name`, `account_number`, `budgetary_resources` (default), `managing_agency`
|
|
201
|
-
- Returns `account_number` (format `"097-8097"`) for chaining into `usaspending_get_federal_account` for full budget detail
|
|
202
|
-
- Pagination via `limit` and `page`; `count` in `page_metadata` is the total matches
|
|
171
|
+
- Optional `keyword` and 3-digit `agency_identifier`; `sort_field` is `account_name`, `account_number`, `budgetary_resources` (default), or `managing_agency`; `limit` up to 100
|
|
172
|
+
- Rows carry `account_number` (e.g. `097-8097`) for the federal-account tools, `managing_agency`, and `budgetary_resources`; `page_metadata.count` is the total
|
|
203
173
|
|
|
204
174
|
---
|
|
205
175
|
|
|
206
|
-
### `
|
|
176
|
+
### `usaspending_get_federal_account` <sub>tool</sub>
|
|
207
177
|
|
|
208
|
-
-
|
|
209
|
-
-
|
|
210
|
-
- Configurable sort and order
|
|
178
|
+
- `account_code` in AGENCY-MAIN format, from `account_number` in search results or `federal_account` on an award; an unknown code fails as `account_not_found`
|
|
179
|
+
- Returns `total_obligated_amount`, `total_gross_outlay_amount`, and `total_budgetary_resources` for `fiscal_year`, plus `children`: one entry per Treasury Account Symbol with its own amounts
|
|
211
180
|
|
|
212
181
|
---
|
|
213
182
|
|
|
214
|
-
### `
|
|
183
|
+
### `usaspending_get_federal_account_breakdown` <sub>tool</sub>
|
|
215
184
|
|
|
216
|
-
- `
|
|
217
|
-
-
|
|
218
|
-
- The `naics` lookup matches official NAICS title text, not colloquial industry language — "software" and "aircraft" resolve, "cybersecurity" and "aircraft maintenance" return nothing. Fall back to the broader industry term the NAICS title would use
|
|
219
|
-
- Consolidates five autocomplete endpoints into one tool
|
|
220
|
-
- `limit` accepts 1–500 and is enforced client-side — the `recipient` lookup unions three upstream match buckets (name, UEI, DUNS) and can return up to 3x the requested count, so its results are capped before returning; the other four honor `limit` exactly
|
|
185
|
+
- `account_code` plus `dimension` (`program_activity` or `object_class`); `limit` up to 100, with `page_metadata.total` as the row count
|
|
186
|
+
- Rows carry `code`, `name`, and `obligations`; `program_activity` rows add `type`, either `PAC/PAN` or `PARK`
|
|
221
187
|
|
|
222
188
|
## Features
|
|
223
189
|
|
|
@@ -225,17 +191,17 @@ Built on [`@cyanheads/mcp-ts-core`](https://github.com/cyanheads/mcp-ts-core): s
|
|
|
225
191
|
|
|
226
192
|
USAspending-specific:
|
|
227
193
|
|
|
228
|
-
-
|
|
229
|
-
-
|
|
230
|
-
- `usaspending_spending_by_category`
|
|
231
|
-
-
|
|
232
|
-
- `usaspending_autocomplete_filters` serves as the code-discovery step before filtering — maps human-readable terms to NAICS, PSC, CFDA, and agency codes
|
|
194
|
+
- USAspending.gov API v2, keyless: the data is public under the DATA Act
|
|
195
|
+
- Award search and the spending analytics tools cover action dates from 2007-10-01 on (an earlier start date fails as `date_before_earliest`), and DoD contract data lags publication by 90 days
|
|
196
|
+
- `usaspending_spending_by_category` puts nine category sub-routes behind one `category` enum, and `usaspending_disaster_spending` puts five disaster endpoints behind `dimension`
|
|
197
|
+
- Each request runs under a per-attempt timeout and a wall-clock retry budget; failures surface as `api_timeout` or `api_unavailable` with each tool's recovery hint, and a rejected request carries USAspending's own explanation in the error message
|
|
233
198
|
|
|
234
199
|
Agent-friendly output:
|
|
235
200
|
|
|
236
|
-
- Chaining
|
|
237
|
-
-
|
|
238
|
-
-
|
|
201
|
+
- Chaining IDs as explicit fields: `generated_internal_id`, `agency_slug`, `recipient.recipient_id`, `federal_account`, and `account_number`, so agents follow the money without parsing display strings
|
|
202
|
+
- Honest pagination: `page_metadata.has_next` on every list, a `total` or `count` where the upstream publishes one, and `truncated` / `shown` / `cap` when a response is capped
|
|
203
|
+
- Empty results are notices, not errors: an empty page carries a `notice` echoing the filters and how to broaden them. The ID-keyed list tools (transactions, subawards, funding accounts, IDV children, account breakdown) return an empty list for an unknown ID rather than failing
|
|
204
|
+
- Typed failures with recovery hints: `award_not_found`, `recipient_not_found`, `agency_not_found`, `account_not_found`, `no_match`, `date_before_earliest`, `date_range_inverted`, `unsupported_sort`, `assistance_listings_type_mismatch`, `pagination_limit_exceeded`
|
|
239
205
|
|
|
240
206
|
## Getting started
|
|
241
207
|
|
|
@@ -256,7 +222,7 @@ A public instance is available at `https://usaspending.caseyjhand.com/mcp` — n
|
|
|
256
222
|
|
|
257
223
|
### Self-Hosted / Local
|
|
258
224
|
|
|
259
|
-
Add the following to your MCP client configuration file. No API key is required
|
|
225
|
+
Add the following to your MCP client configuration file. No API key is required.
|
|
260
226
|
|
|
261
227
|
```json
|
|
262
228
|
{
|
|
@@ -319,8 +285,8 @@ MCP_TRANSPORT_TYPE=http MCP_HTTP_PORT=3010 bun run start:http
|
|
|
319
285
|
|
|
320
286
|
### Prerequisites
|
|
321
287
|
|
|
322
|
-
- [Bun v1.
|
|
323
|
-
- No API key
|
|
288
|
+
- [Bun v1.4.0](https://bun.sh/) or higher (or Node.js v24+).
|
|
289
|
+
- No API key or account: USAspending.gov is open to anonymous requests.
|
|
324
290
|
|
|
325
291
|
### Installation
|
|
326
292
|
|
|
@@ -351,23 +317,23 @@ cp .env.example .env
|
|
|
351
317
|
|
|
352
318
|
## Configuration
|
|
353
319
|
|
|
354
|
-
|
|
320
|
+
No variable is required; the defaults work out of the box.
|
|
355
321
|
|
|
356
322
|
| Variable | Description | Default |
|
|
357
|
-
|
|
358
|
-
| `USASPENDING_BASE_URL` |
|
|
359
|
-
| `USASPENDING_TIMEOUT_MS` | HTTP timeout in
|
|
360
|
-
| `USASPENDING_RETRY_BUDGET_MS` | Wall-clock budget
|
|
323
|
+
|:---|:---|:---|
|
|
324
|
+
| `USASPENDING_BASE_URL` | USAspending.gov API v2 base URL. | `https://api.usaspending.gov/api/v2/` |
|
|
325
|
+
| `USASPENDING_TIMEOUT_MS` | Per-attempt HTTP timeout, in ms (1000–120000). | `30000` |
|
|
326
|
+
| `USASPENDING_RETRY_BUDGET_MS` | Wall-clock budget for one request across all retry attempts, in ms (1000–300000). | 1.5 × `USASPENDING_TIMEOUT_MS` |
|
|
361
327
|
| `MCP_TRANSPORT_TYPE` | Transport: `stdio` or `http`. | `stdio` |
|
|
362
|
-
| `MCP_HTTP_PORT` |
|
|
363
|
-
| `
|
|
364
|
-
| `
|
|
365
|
-
| `MCP_PUBLIC_URL` | Public origin override for TLS-terminating reverse-proxy deployments. | — |
|
|
366
|
-
| `MCP_AUTH_MODE` | Auth mode: `none`, `jwt`, or `oauth`. | `none` |
|
|
328
|
+
| `MCP_HTTP_PORT` | HTTP server port. | `3010` |
|
|
329
|
+
| `MCP_SESSION_MODE` | HTTP session mode: `stateless`, `stateful`, or `auto`. | `stateless` |
|
|
330
|
+
| `MCP_AUTH_MODE` | Authentication: `none`, `jwt`, or `oauth`. | `none` |
|
|
367
331
|
| `MCP_LOG_LEVEL` | Log level (`debug`, `info`, `warning`, `error`, etc.). | `info` |
|
|
332
|
+
| `LOG_TOOL_FAILURE_PAYLOADS` | Log each failed tool call's arguments and result, redacted by key name and capped at `LOG_TOOL_FAILURE_PAYLOAD_MAX_BYTES` (default `16384`). A secret inside a free-form value is not redacted. | `false` |
|
|
368
333
|
| `LOGS_DIR` | Directory for log files (Node.js only). | `<project-root>/logs` |
|
|
369
334
|
| `STORAGE_PROVIDER_TYPE` | Storage backend: `in-memory`, `filesystem`, `supabase`, `cloudflare-kv/r2/d1`. | `in-memory` |
|
|
370
|
-
| `OTEL_ENABLED` | Enable [OpenTelemetry
|
|
335
|
+
| `OTEL_ENABLED` | Enable [OpenTelemetry](https://github.com/cyanheads/mcp-ts-core/tree/main/docs/telemetry). | `false` |
|
|
336
|
+
| `OTEL_EXPORTER_OTLP_LOGS_ENDPOINT` | Opt-in OTLP log export endpoint; the base `OTEL_EXPORTER_OTLP_ENDPOINT` never enables it. | — |
|
|
371
337
|
|
|
372
338
|
See [`.env.example`](./.env.example) for the full list of optional overrides.
|
|
373
339
|
|
|
@@ -407,12 +373,12 @@ The Dockerfile defaults to HTTP transport, stateless session mode, and logs to `
|
|
|
407
373
|
## Project structure
|
|
408
374
|
|
|
409
375
|
| Directory | Purpose |
|
|
410
|
-
|
|
411
|
-
| `src/index.ts` | `createApp()` entry point
|
|
376
|
+
|:---|:---|
|
|
377
|
+
| `src/index.ts` | `createApp()` entry point: registers the tools and initializes the USAspending service. |
|
|
412
378
|
| `src/config` | Server-specific environment variable parsing and validation with Zod. |
|
|
413
|
-
| `src/mcp-server/tools` | Tool definitions (`*.tool.ts`). |
|
|
414
|
-
| `src/services` | USAspending API client
|
|
415
|
-
| `tests/` | Unit
|
|
379
|
+
| `src/mcp-server/tools/definitions` | Tool definitions (`*.tool.ts`) plus shared filter, date, pagination, and formatting helpers. |
|
|
380
|
+
| `src/services/usaspending` | USAspending.gov API client: request timeouts, retry budget, raw response types. |
|
|
381
|
+
| `tests/` | Unit tests for tools, the service, config, and scripts. |
|
|
416
382
|
|
|
417
383
|
## Development guide
|
|
418
384
|
|
|
@@ -420,7 +386,7 @@ See [`CLAUDE.md`](./CLAUDE.md) for development guidelines and architectural rule
|
|
|
420
386
|
|
|
421
387
|
- Handlers throw, framework catches — no `try/catch` in tool logic
|
|
422
388
|
- Use `ctx.log` for request-scoped logging, `ctx.state` for tenant-scoped storage
|
|
423
|
-
- Register new tools via the
|
|
389
|
+
- Register new tools via the barrel in `src/mcp-server/tools/definitions/index.ts`
|
|
424
390
|
- Wrap external API calls: validate raw → normalize to domain type → return output schema; never fabricate missing fields
|
|
425
391
|
|
|
426
392
|
## Contributing
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
---
|
|
2
|
+
summary: "Upstream timeouts and outages reach the caller as api_timeout / api_unavailable with each tool's recovery hint, 4xx errors quote upstream's detail, date inputs are validated and half ranges filled, award search sorts by award type group and filters by assistance listing, and disaster breakdowns carry upstream totals."
|
|
3
|
+
breaking: false
|
|
4
|
+
security: false
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# 0.4.4 — 2026-09-25
|
|
8
|
+
|
|
9
|
+
## Changed
|
|
10
|
+
|
|
11
|
+
- **`usaspending_search_awards` `sort` follows the award type group** ([#60](https://github.com/cyanheads/usaspending-mcp-server/issues/60)). Loans sort by `Loan Value` (default), `Subsidy Cost`, `Issued Date`, `Recipient Name`, or `Awarding Agency`; other groups default to `Award Amount`, and IDVs have no `End Date`. Any other pairing fails as `unsupported_sort` before the request, listing the group's sorts.
|
|
12
|
+
- **Loan rows carry `loan_value`, `subsidy_cost`, and `issued_date`** on both `structuredContent` and the text output ([#60](https://github.com/cyanheads/usaspending-mcp-server/issues/60)).
|
|
13
|
+
- **`usaspending_search_awards` `assistance_listings`** filters by Assistance Listing (CFDA) number (`NN.NNN`, e.g. `93.866`, `11.67A`), sent as `program_numbers` and echoed as `applied_assistance_listings` ([#61](https://github.com/cyanheads/usaspending-mcp-server/issues/61)). Paired with contract or IDV codes, including the contract default, it fails as `assistance_listings_type_mismatch`.
|
|
14
|
+
- **`award_type_codes` descriptions list the full group partition** — IDV sub-codes, `F001`–`F010`, and the other-assistance group `09`/`11`/`-1`; an empty flat `award_type_codes` now fails schema validation ([#60](https://github.com/cyanheads/usaspending-mcp-server/issues/60)).
|
|
15
|
+
- **`usaspending_autocomplete_filters` `cfda` descriptions** point at `usaspending_search_awards` `assistance_listings` ([#61](https://github.com/cyanheads/usaspending-mcp-server/issues/61)).
|
|
16
|
+
- **`usaspending_disaster_spending` returns `totals`** — upstream's `obligation`, `outlay`, `total_budgetary_resources` or `award_count` for the whole result set on the agency, cfda, and recipient dimensions — plus per-row `total_budgetary_resources` on the agency dimension under `spending_type: total` ([#63](https://github.com/cyanheads/usaspending-mcp-server/issues/63)). Absent members stay absent; nothing is summed from the page.
|
|
17
|
+
- **Every date input advertises a `YYYY-MM-DD` pattern** on `usaspending_search_awards` and the three `usaspending_spending_*` tools, so a malformed date fails argument validation before any request ([#58](https://github.com/cyanheads/usaspending-mcp-server/issues/58)). Unpadded month and day are accepted and padded before sending; `""` still means no date, so a fully blank `time_period` applies none and one blank side is filled like a lone date.
|
|
18
|
+
- **The three `usaspending_spending_*` tools declare `date_before_earliest`** and reject a start before 2007-10-01 before the request, as `usaspending_search_awards` does. A lone end date before 2007-10-01, once dropped, now fails the same way on all four tools, as does a lone start on these three.
|
|
19
|
+
- **Docs:** the README tool reference and `docs/design.md` cover these changes, and `.env.example` lists `USASPENDING_BASE_URL`, `USASPENDING_TIMEOUT_MS`, and `USASPENDING_RETRY_BUDGET_MS`.
|
|
20
|
+
- **Dev dependencies:** `@socketsecurity/bun-security-scanner` `^1.1.2` → `^1.1.3`, `@types/node` `^26.6.1` → `^26.6.2`.
|
|
21
|
+
|
|
22
|
+
## Fixed
|
|
23
|
+
|
|
24
|
+
- **Upstream timeouts and outages carry the tool contract on the wire** ([#57](https://github.com/cyanheads/usaspending-mcp-server/issues/57)). Every `Timeout` (budget expiry, exhausted per-attempt timeouts, a 504) is tagged `api_timeout` and every `ServiceUnavailable` (5xx, network, HTML or invalid-JSON body) `api_unavailable`, each with `retryable` and the calling tool's recovery hint.
|
|
25
|
+
- **`usaspending_disaster_spending`'s `api_timeout` recovery names a lever per dimension** — overview points at a later retry or the agency breakdown instead of narrowing it cannot apply, and geography drops `limit` ([#57](https://github.com/cyanheads/usaspending-mcp-server/issues/57)).
|
|
26
|
+
- **A 4xx error message quotes upstream's `detail`** (or `message`, when there is no `detail`), capped at 500 characters: `USAspending rejected <operation> (HTTP <status>): <detail>` ([#58](https://github.com/cyanheads/usaspending-mcp-server/issues/58)). Code and `data.status` are kept.
|
|
27
|
+
- **A US-style start date on `usaspending_search_awards` no longer fails as `date_before_earliest`** — the pattern rejects it by field name, and the floor check compares padded dates ([#58](https://github.com/cyanheads/usaspending-mcp-server/issues/58)).
|
|
28
|
+
- **A lone start or end date is applied, not dropped** ([#62](https://github.com/cyanheads/usaspending-mcp-server/issues/62)). A lone start runs through today (UTC), a lone end from 2007-10-01; `applied_time_period_*` echoes the range sent and a notice names the filled field. On `usaspending_spending_by_geography` a lone date no longer triggers the all-award-types default.
|
|
29
|
+
- **An inverted date range fails as `date_range_inverted` before any request**, naming both fields ([#64](https://github.com/cyanheads/usaspending-mcp-server/issues/64)). It had surfaced as `api_unavailable` from the analytics endpoints and been ignored by award search.
|
|
30
|
+
- **`usaspending_disaster_spending` recipient rows carry one usable `id`** — the recipient-level `-R` entry when upstream sends several, else the first — instead of a comma-joined string ([#65](https://github.com/cyanheads/usaspending-mcp-server/issues/65)).
|
|
31
|
+
- **`usaspending_disaster_spending` `spending_type` describes what upstream honors** — only the agency dimension varies with it.
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
---
|
|
2
|
+
summary: "Built on mcp-ts-core 0.13.13: tool errors carry a request ID, each tool's declared recovery hint is filled in by the framework, and the MCP Registry entry now starts the HTTP transport when HTTP is chosen."
|
|
3
|
+
breaking: false
|
|
4
|
+
security: false
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# 0.4.5 — 2026-10-07
|
|
8
|
+
|
|
9
|
+
## Changed
|
|
10
|
+
|
|
11
|
+
- **Tool errors carry a request ID.** `data.requestId` is set on every error result and the text content ends with `request <id>` (mcp-ts-core 0.13.10).
|
|
12
|
+
- **Recovery hints come from each tool's declared `errors[]` entry**, filled by the framework (mcp-ts-core 0.13.10). Handlers and the upstream-failure classifier no longer forward them; the hint text callers see is unchanged.
|
|
13
|
+
- **Error `data` no longer carries server stack traces, request context, or `rootCause`** (mcp-ts-core 0.13.7, 0.13.8, and 0.13.13 respectively).
|
|
14
|
+
- **A JSON-stringified object, or an integer sent for a string field, is repaired before validation** instead of rejected (mcp-ts-core 0.13.9).
|
|
15
|
+
- **An upstream non-2xx response without a JSON `detail` names the endpoint by origin only** (`https://api.usaspending.gov/…`); a timeout message still names the endpoint path (mcp-ts-core 0.13.12).
|
|
16
|
+
- **`server.json`:** npm entries drop the `run start:*` package arguments and set `runtimeHint: "npx"`; the `streamable-http` entry fixes `MCP_TRANSPORT_TYPE` as `value: "http"`, so a registry install that picks HTTP starts HTTP (matches the mcp-ts-core 0.13.11 scaffold).
|
|
17
|
+
- **Docker image:** production dependencies install in a `deps` stage on the build platform (mcp-ts-core 0.13.10), musl-only packages are pruned (0.13.11), and the base image is Bun 1.4.2 (0.13.7). `scripts/install-otel.ts` and `scripts/prune-musl-packages.ts` are new.
|
|
18
|
+
- **MCP SDK** `@modelcontextprotocol/server` ^2.2.0 via the framework (^2.1.0 in 0.13.9, ^2.2.0 in 0.13.11).
|
|
19
|
+
- **Package scripts:** `start`, `start:stdio`, and `start:http` run `node dist/index.js`; `test` runs `vitest run`; `rebuild` calls `scripts/build.ts` directly; `files` excludes `dist/*.mcpb`.
|
|
20
|
+
- **Repo config:** CodeQL runs one matrix job per language (`actions`, `javascript-typescript`), `.gitignore` and `.dockerignore` cover every `.env*` variant, `.mcpbignore` excludes `docs/idea.md`, `logs/`, and `.cache/`, and the devcheck, packaging, skill-version, and release scripts match the framework templates.
|
|
21
|
+
- **Docs:** the README environment table lists `LOG_TOOL_FAILURE_PAYLOADS` and `OTEL_EXPORTER_OTLP_LOGS_ENDPOINT`, `.env.example` documents `MCP_REQUEST_STATE_KEY`, the Bun and MCP SDK badges are current, and `framework-skills/` is synced to 0.13.13.
|
|
22
|
+
|
|
23
|
+
## Dependencies
|
|
24
|
+
|
|
25
|
+
- `@cyanheads/mcp-ts-core` `^0.13.6` → `^0.13.13`
|
|
26
|
+
- `@biomejs/biome` `^2.5.14` → `^2.5.15` (dev)
|
|
27
|
+
- `@types/node` `^26.6.2` → `^26.6.4` (dev)
|
|
28
|
+
- `ignore` `^7.0.9` → `^7.0.12` (dev)
|
|
29
|
+
- `tsc-alias` `^1.9.5` → `^1.9.7` (dev)
|
|
30
|
+
- `vitest` `^5.0.1` → `^5.0.3` (dev)
|
|
31
|
+
- Bun `1.4.0` → `1.4.2`
|
package/dist/index.js
CHANGED
|
@@ -34,7 +34,7 @@ await createApp({
|
|
|
34
34
|
*/
|
|
35
35
|
sessionMode: 'stateless',
|
|
36
36
|
instructions: 'USAspending.gov MCP server — federal award, recipient, agency, and spending data from the US Treasury DATA Act platform.\n' +
|
|
37
|
-
'- Start with usaspending_list_agencies or usaspending_autocomplete_filters to discover agency codes
|
|
37
|
+
'- Start with usaspending_list_agencies or usaspending_autocomplete_filters to discover agency codes, NAICS/PSC codes, and Assistance Listing numbers\n' +
|
|
38
38
|
'- Use usaspending_search_awards to find awards, then usaspending_get_award for full details\n' +
|
|
39
39
|
'- Chain recipient_id from usaspending_get_award into usaspending_get_recipient for entity profiles\n' +
|
|
40
40
|
'- Search window: 2007-10-01 onward. DoD contracts have a 90-day publication lag.',
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA;;;;GAIG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACnD,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAC5D,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AC/F,sGAAsG;QACtG,kFAAkF;IACpF,KAAK,CAAC,IAAI;QACR,MAAM,YAAY,GAAG,eAAe,EAAE,CAAC;QACvC,sBAAsB,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,OAAO,EAAE,YAAY,CAAC,CAAC;IAClE,CAAC;CACF,CAAC,CAAC"}
|
|
@@ -13,7 +13,7 @@ export const autocompleteFiltersTool = tool('usaspending_autocomplete_filters',
|
|
|
13
13
|
input: z.object({
|
|
14
14
|
type: z
|
|
15
15
|
.enum(['naics', 'psc', 'cfda', 'awarding_agency', 'recipient'])
|
|
16
|
-
.describe('Lookup table to search: naics (industry codes), psc (product/service codes), cfda (
|
|
16
|
+
.describe('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)'),
|
|
17
17
|
search_text: z
|
|
18
18
|
.string()
|
|
19
19
|
.min(1)
|
|
@@ -35,7 +35,7 @@ export const autocompleteFiltersTool = tool('usaspending_autocomplete_filters',
|
|
|
35
35
|
code: z
|
|
36
36
|
.string()
|
|
37
37
|
.optional()
|
|
38
|
-
.describe('Code value (NAICS code, PSC code, CFDA number, or agency code); use this in filter parameters'),
|
|
38
|
+
.describe('Code value (NAICS code, PSC code, Assistance Listing/CFDA number, or agency code); use this in filter parameters — an Assistance Listing number goes in usaspending_search_awards assistance_listings'),
|
|
39
39
|
name: z.string().optional().describe('Human-readable name or description'),
|
|
40
40
|
id: z
|
|
41
41
|
.string()
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"autocomplete-filters.tool.js","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/autocomplete-filters.tool.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAEjE,OAAO,EAAE,qBAAqB,EAAE,MAAM,+CAA+C,CAAC;AAEtF,MAAM,CAAC,MAAM,uBAAuB,GAAG,IAAI,CAAC,kCAAkC,EAAE;IAC9E,KAAK,EAAE,8BAA8B;IACrC,WAAW,EACT,4dAA4d;IAC9d,WAAW,EAAE,EAAE,YAAY,EAAE,IAAI,EAAE,aAAa,EAAE,IAAI,EAAE,cAAc,EAAE,IAAI,EAAE;IAE9E,KAAK,EAAE,CAAC,CAAC,MAAM,CAAC;QACd,IAAI,EAAE,CAAC;aACJ,IAAI,CAAC,CAAC,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,iBAAiB,EAAE,WAAW,CAAC,CAAC;aAC9D,QAAQ,CACP,
|
|
1
|
+
{"version":3,"file":"autocomplete-filters.tool.js","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/autocomplete-filters.tool.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAEjE,OAAO,EAAE,qBAAqB,EAAE,MAAM,+CAA+C,CAAC;AAEtF,MAAM,CAAC,MAAM,uBAAuB,GAAG,IAAI,CAAC,kCAAkC,EAAE;IAC9E,KAAK,EAAE,8BAA8B;IACrC,WAAW,EACT,4dAA4d;IAC9d,WAAW,EAAE,EAAE,YAAY,EAAE,IAAI,EAAE,aAAa,EAAE,IAAI,EAAE,cAAc,EAAE,IAAI,EAAE;IAE9E,KAAK,EAAE,CAAC,CAAC,MAAM,CAAC;QACd,IAAI,EAAE,CAAC;aACJ,IAAI,CAAC,CAAC,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,iBAAiB,EAAE,WAAW,CAAC,CAAC;aAC9D,QAAQ,CACP,wOAAwO,CACzO;QACH,WAAW,EAAE,CAAC;aACX,MAAM,EAAE;aACR,GAAG,CAAC,CAAC,CAAC;aACN,QAAQ,CACP,uFAAuF,C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