@cyanheads/usaspending-mcp-server 0.7.3 → 0.7.4
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 +1 -1
- package/CLAUDE.md +1 -1
- package/README.md +13 -9
- package/changelog/0.7.x/0.7.4.md +35 -0
- package/dist/mcp-server/tools/definitions/agency-filters.d.ts +6 -2
- package/dist/mcp-server/tools/definitions/agency-filters.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/agency-filters.js +23 -21
- package/dist/mcp-server/tools/definitions/agency-filters.js.map +1 -1
- package/dist/mcp-server/tools/definitions/autocomplete-filters.tool.d.ts +1 -0
- package/dist/mcp-server/tools/definitions/autocomplete-filters.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/autocomplete-filters.tool.js +21 -11
- package/dist/mcp-server/tools/definitions/autocomplete-filters.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/filters.d.ts +69 -5
- package/dist/mcp-server/tools/definitions/filters.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/filters.js +107 -7
- package/dist/mcp-server/tools/definitions/filters.js.map +1 -1
- package/dist/mcp-server/tools/definitions/get-award-transactions.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/get-award-transactions.tool.js +3 -6
- package/dist/mcp-server/tools/definitions/get-award-transactions.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/get-award.tool.d.ts +17 -0
- package/dist/mcp-server/tools/definitions/get-award.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/get-award.tool.js +122 -17
- package/dist/mcp-server/tools/definitions/get-award.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/index.d.ts +42 -0
- package/dist/mcp-server/tools/definitions/index.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/locations.d.ts +15 -1
- package/dist/mcp-server/tools/definitions/locations.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/locations.js +31 -11
- package/dist/mcp-server/tools/definitions/locations.js.map +1 -1
- package/dist/mcp-server/tools/definitions/search-awards.tool.d.ts +26 -2
- package/dist/mcp-server/tools/definitions/search-awards.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/search-awards.tool.js +179 -71
- package/dist/mcp-server/tools/definitions/search-awards.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/search-recipients.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/search-recipients.tool.js +2 -0
- package/dist/mcp-server/tools/definitions/search-recipients.tool.js.map +1 -1
- 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 +2 -2
- 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.map +1 -1
- package/dist/mcp-server/tools/definitions/spending-by-geography.tool.js +2 -2
- 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.map +1 -1
- package/dist/mcp-server/tools/definitions/spending-over-time.tool.js +2 -2
- package/dist/mcp-server/tools/definitions/spending-over-time.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/unavailable-sections.d.ts +3 -1
- package/dist/mcp-server/tools/definitions/unavailable-sections.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/unavailable-sections.js +9 -3
- package/dist/mcp-server/tools/definitions/unavailable-sections.js.map +1 -1
- package/dist/services/usaspending/types.d.ts +26 -0
- package/dist/services/usaspending/types.d.ts.map +1 -1
- package/dist/services/usaspending/types.js.map +1 -1
- package/dist/services/usaspending/usaspending-service.d.ts +16 -5
- package/dist/services/usaspending/usaspending-service.d.ts.map +1 -1
- package/dist/services/usaspending/usaspending-service.js +26 -14
- package/dist/services/usaspending/usaspending-service.js.map +1 -1
- package/package.json +5 -5
- package/server.json +3 -3
- package/skills/usaspending-guide/SKILL.md +5 -3
package/AGENTS.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# Developer Protocol
|
|
2
2
|
|
|
3
3
|
**Server:** usaspending-mcp-server
|
|
4
|
-
**Version:** 0.7.
|
|
4
|
+
**Version:** 0.7.4
|
|
5
5
|
**Framework:** [@cyanheads/mcp-ts-core](https://www.npmjs.com/package/@cyanheads/mcp-ts-core) `^0.13.22`
|
|
6
6
|
**Engines:** Bun ≥1.4.4, Node ≥24.0.0
|
|
7
7
|
**MCP SDK:** `@modelcontextprotocol/server` ^2.4.0
|
package/CLAUDE.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# Developer Protocol
|
|
2
2
|
|
|
3
3
|
**Server:** usaspending-mcp-server
|
|
4
|
-
**Version:** 0.7.
|
|
4
|
+
**Version:** 0.7.4
|
|
5
5
|
**Framework:** [@cyanheads/mcp-ts-core](https://www.npmjs.com/package/@cyanheads/mcp-ts-core) `^0.13.22`
|
|
6
6
|
**Engines:** Bun ≥1.4.4, Node ≥24.0.0
|
|
7
7
|
**MCP SDK:** `@modelcontextprotocol/server` ^2.4.0
|
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
|
|
|
@@ -37,7 +37,7 @@ Where federal money goes, from USAspending.gov: awards, recipients, agencies, an
|
|
|
37
37
|
|:---|:---|
|
|
38
38
|
| `usaspending_list_agencies` | List top-tier federal agencies with codes, slugs, and budget totals labelled by reporting year and quarter |
|
|
39
39
|
| `usaspending_autocomplete_filters` | Look up NAICS, PSC, CFDA, DEF, agency, recipient, or state, county, and district location codes from a free-text description |
|
|
40
|
-
| `usaspending_search_awards` | Search awards by keyword, recipient, agency, award type, NAICS code, assistance listing, PSC, DEF code, location, or date range |
|
|
40
|
+
| `usaspending_search_awards` | Search awards by keyword, recipient, agency, award type, NAICS code, assistance listing, PSC, DEF code, extent competed, set-aside, contract pricing, location, or date range |
|
|
41
41
|
| `usaspending_get_award` | Fetch one award's full record: amounts, recipient, agencies, codes, competition, parent IDV, DEF-code funding |
|
|
42
42
|
| `usaspending_get_award_transactions` | List the transactions (modifications, amendments) on an award |
|
|
43
43
|
| `usaspending_get_award_subawards` | List the subcontracts or subgrants under a prime award |
|
|
@@ -69,10 +69,10 @@ The [usaspending-guide](./skills/usaspending-guide/SKILL.md) covers recipient re
|
|
|
69
69
|
|
|
70
70
|
### `usaspending_autocomplete_filters` <sub>tool</sub>
|
|
71
71
|
|
|
72
|
-
- `type` (`naics`, `psc`, `cfda`, `def_code`, `awarding_agency`, `recipient`, `location`) plus `search_text`; `limit` default 10, at most 500 per call
|
|
72
|
+
- `type` (`naics`, `psc`, `cfda`, `def_code`, `awarding_agency`, `funding_agency`, `recipient`, `location`) plus `search_text`; `limit` default 10, at most 500 per call
|
|
73
73
|
- `def_code` matches an exact code or text in the appropriation title or public law, case-insensitively. Rows carry `code`, `name`, and `public_law` / `disaster_group` when supplied; exact code matches come first. Use the returned code in spending and disaster filters
|
|
74
74
|
- Rows carry `code` and `name`, and `uei` / `duns` for recipients; no match fails as `no_match`. A `cfda` code goes in `assistance_listings` and a `psc` code in `psc_codes` on `usaspending_search_awards` and the three spending analytics tools
|
|
75
|
-
-
|
|
75
|
+
- `awarding_agency` and `funding_agency` rows carry the matched agency's own `name`, `abbreviation`, and `tier` (`toptier` or `subtier`), its parent's `toptier_name` and `toptier_code`, and `subtier_code` when supplied. Each type searches its own role's directory, and neither directory contains the other: pass an `awarding_agency` row's `name` to `agency_name` and a `funding_agency` row's `name` to `funding_agency_name` on award search or spending analytics to match that agency; pass `toptier_name` for the whole department. Agency results combine top-tier then sub-tier matches under one `limit`; office matches are excluded
|
|
76
76
|
- `naics` matches official NAICS title text: "software" resolves, "cybersecurity" does not, so search with the industry term a title would use
|
|
77
77
|
- `location` matches US states, then counties, then congressional districts by name. Rows carry `kind` (`state`, `county`, or `district`), the upstream's uppercase `name`, and `code`: a postal code for a state, the 5-digit state + county FIPS code for a county, the state FIPS + district number (e.g. `5307`) for a district; county and district rows add the `state` postal code. Upstream returns at most 100 rows of each kind, and a notice says when one hits it. Countries, cities, and ZIP codes are not returned; `no_match` names the three kinds. The freely associated states (`FM`, `MH`, `PW`) and the Minor Outlying Islands (`UM`) have no upstream state row and get no code. Pass a code to `usaspending_search_awards` and the spending analytics location filters, or to `shape_codes` on `usaspending_spending_by_geography`
|
|
78
78
|
|
|
@@ -85,11 +85,12 @@ The [usaspending-guide](./skills/usaspending-guide/SKILL.md) covers recipient re
|
|
|
85
85
|
- `assistance_listings`: Assistance Listing numbers such as `93.866`, from `usaspending_autocomplete_filters` `type: cfda`
|
|
86
86
|
- `psc_codes`: 1–4 characters, where a prefix such as `Y1` covers the codes under it; contracts and IDVs only
|
|
87
87
|
- `def_codes`: Disaster Emergency Fund Codes such as `Z` (PSC and DEF codes are sent uppercased)
|
|
88
|
+
- `extent_competed_type_codes`, `set_aside_type_codes`, `contract_pricing_type_codes`: the FPDS codes `usaspending_get_award` returns in `competition.extent_competed.code`, `competition.type_set_aside.code`, and `contract_pricing.code` (e.g. `C`, `SBA`, `J`). Each takes 1–8 letters or digits, sent uppercased; several values match any of them, and an unknown code matches nothing. Contracts and IDVs only; award search alone takes them, and the spending analytics tools reject the keys
|
|
88
89
|
- `time_period`: `YYYY-MM-DD` from 2007-10-01 on; either end may be given alone
|
|
89
90
|
- `location_filter` (place of performance; `filters.place_of_performance_location` overrides it) and `filters.recipient_location` (where the recipient is based), each taking: `country` (default `USA`; a territory code such as `PRI` becomes `USA` plus its state), `state` (a postal or 2-digit FIPS code, `FM`/`MH`/`PW`/`UM` and armed-forces `AA`/`AE`/`AP` included, or under another country its own 2-letter subdivision code such as `ON` with `CAN`), and `county` (3 digits with `state`, or the 5-digit FIPS code alone); echoed as `applied_location` and `applied_recipient_location`
|
|
90
91
|
- `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`; other assistance `09`/`11`/`-1`/`F005`/`F008`/`F009`/`F010`
|
|
91
92
|
- `limit`: default 10, at most 100 per call
|
|
92
|
-
- Rows carry `generated_internal_id` for `usaspending_get_award`, `recipient_id` for `usaspending_get_recipient` and `uei` when upstream has them, and `agency_slug` for `usaspending_get_agency`; loan rows carry `loan_value`, `subsidy_cost`, and `issued_date` in place of amounts and dates. `page_metadata.total` (also `totalCount`) counts every match
|
|
93
|
+
- Rows carry `generated_internal_id` for `usaspending_get_award`, `recipient_id` for `usaspending_get_recipient` and `uei` when upstream has them, and `agency_slug` for `usaspending_get_agency`; loan rows carry `loan_value`, `subsidy_cost`, and `issued_date` in place of amounts and dates. `page_metadata.total` (also `totalCount`) counts every match for the call's filters and `award_type_codes`, from a best-effort count request; when it fails the total is omitted, `unavailable_sections` names `total`, and `has_next` is true on any full page. A second best-effort count, sent the same filters without `award_type_codes`, returns `matches_by_group` (`contracts`, `idvs`, `grants`, `direct_payments`, `loans`, `other`): what a search of each group would find, with a notice naming every other group that has matches, its count, and its `award_type_codes`. The selected group's entry counts the whole group, so it can exceed `total` when `award_type_codes` name part of it, and a filter only some groups carry (`naics_codes`, `psc_codes`, the contract filters, `assistance_listings`) leaves the others at 0. Both counts run only when the codes resolve to one group, share one 10-second single-attempt deadline, and settle independently: a failure omits that value and names `total` or `matches_by_group` in `unavailable_sections`. The group count is also cut, and named the same way, once it runs 2 seconds past the search and the total count. `matches_by_group` is also absent, with nothing disclosed, when `award_type_codes` is the only filter. With a known total, `has_next` is exact on page-number paging; a page fetched by cursor keeps the full-page rule. The nested `filters` object takes the analytics tools' `filters` keys except `recipient_id`, plus `recipient_name` and the three contract filters, and wins per field over the flat ones. The applied contract codes are echoed as `applied_extent_competed_type_codes`, `applied_set_aside_type_codes`, and `applied_contract_pricing_type_codes`. Failures are `assistance_listings_type_mismatch` (listings with a non-assistance group), `psc_codes_type_mismatch` (PSC codes with an assistance group), `contract_filters_type_mismatch` (a contract filter with an assistance group), `unsupported_sort`, `date_range_inverted`, `date_before_earliest`, and `invalid_location` (an unknown state, a 3-digit county without a state, a county under an armed-forces code (`AA`/`AE`/`AP`), a county or FIPS-number state under another country, or parts naming different states)
|
|
93
94
|
- `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
|
|
94
95
|
- Effective keywords need at least three characters, with whitespace preserved. NAICS codes use 2, 4, or 6 digits; recognized numeric aliases such as `054`, `+54`, and `54_15_12` are normalized and echoed. Validation runs after nested-filter precedence, so an overridden flat value does not reject the call; active invalid values fail as `invalid_keyword` or `invalid_naics_code`
|
|
95
96
|
|
|
@@ -102,13 +103,16 @@ The [usaspending-guide](./skills/usaspending-guide/SKILL.md) covers recipient re
|
|
|
102
103
|
- `assistance_listings` lists every Assistance Listing on an assistance award, in upstream order, as `number`, `title`, and `obligation`; a `number` goes in `usaspending_search_awards` `assistance_listings`
|
|
103
104
|
- Contracts and IDVs also return a `competition` block (`extent_competed`, `solicitation_procedures`, `type_set_aside`, `other_than_full_and_open`, `fair_opportunity_limited`, each a `{code, description}`, plus `number_of_offers_received`) and `contract_pricing`; `total_subaward_amount` sits beside `subaward_count`
|
|
104
105
|
- `recipient` carries `uei`, `parent_uei`, `business_categories` (category names, not the `business_types` codes of `usaspending_get_recipient`), and a three-letter `country_code`, `county_name`, `county_code`, `congressional_code`, and `zip5` on its `location`. `place_of_performance` also carries a country code, county name, `county_code`, and congressional code; a location with no fields upstream is omitted
|
|
106
|
+
- `recipient.executive_compensation` lists the recipient's highest-compensated officers as `name` and `amount`, in upstream order, with unreported officers dropped; it describes the recipient, so every award to that recipient carries the same list, and it is absent when none is reported
|
|
107
|
+
- `awarding_agency` and `funding_agency` each carry `toptier_name`, `toptier_code`, `toptier_slug`, `subtier_name`, `subtier_code`, `subtier_abbreviation`, and `office_name`
|
|
108
|
+
- Assistance awards that report cost share also return `non_federal_funding` (recipient cost share) and `total_funding` (`total_obligation` plus `non_federal_funding`), zeros kept, and omitted on loans; and `funding_opportunity` (`number`, `goals`), absent when upstream reports only its placeholders
|
|
105
109
|
- `recipient.recipient_id` and `recipient.parent_recipient_id` chain 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`
|
|
106
110
|
|
|
107
111
|
---
|
|
108
112
|
|
|
109
113
|
### `usaspending_get_award_transactions` <sub>tool</sub>
|
|
110
114
|
|
|
111
|
-
- `award_id` plus `sort` (`action_date`, `federal_action_obligation`, `modification_number`); `limit` default 10, at most
|
|
115
|
+
- `award_id` plus `sort` (`action_date`, `federal_action_obligation`, `modification_number`); `limit` default 10, at most 5,000 per call
|
|
112
116
|
- Rows carry a string `id` (`ASST_TX` or `CONT_TX`), `action_date`, `modification_number`, `action_type`, and a signed `federal_action_obligation` (negative is a deobligation). Loan transactions also carry `face_value_loan_guarantee` and `original_loan_subsidy_cost`; assistance transactions carry `cfda_number` when supplied
|
|
113
117
|
|
|
114
118
|
---
|
|
@@ -137,7 +141,7 @@ The [usaspending-guide](./skills/usaspending-guide/SKILL.md) covers recipient re
|
|
|
137
141
|
|
|
138
142
|
### `usaspending_search_recipients` <sub>tool</sub>
|
|
139
143
|
|
|
140
|
-
- `keyword` matches names, UEI, or DUNS, partial matches included; surrounding whitespace is trimmed, and blank text applies no keyword filter with a notice. Optional `award_type` still scopes the totals; `limit` at most 1,000 per call
|
|
144
|
+
- `keyword` (also accepted as `name`, `recipient_name`, or `search_text`; an alias sent with `keyword` is rejected) matches names, UEI, or DUNS, partial matches included; surrounding whitespace is trimmed, and blank text applies no keyword filter with a notice. Optional `award_type` still scopes the totals; `limit` at most 1,000 per call
|
|
141
145
|
- 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
|
|
142
146
|
- `amount` is the selected award types' precomputed trailing-12-month obligations; `period: "trailing 12 months"` labels every page. Snapshot totals can differ from the profile's live trailing-12-month totals
|
|
143
147
|
|
|
@@ -188,7 +192,7 @@ The [usaspending-guide](./skills/usaspending-guide/SKILL.md) covers recipient re
|
|
|
188
192
|
|
|
189
193
|
### Shared spending scope
|
|
190
194
|
|
|
191
|
-
Award search and all three spending analytics tools accept `funding_agency_name` beside the awarding `agency_name`. Both roles together select their intersection, and each name matches either agency tier. Exact names and unambiguous abbreviations are resolved through agency discovery; inconclusive or unavailable lookup preserves the supplied name with an unresolved-name notice. Effective names are echoed as `applied_agency_name` and `applied_funding_agency_name`.
|
|
195
|
+
Award search and all three spending analytics tools accept `funding_agency_name` beside the awarding `agency_name`. Both roles together select their intersection, and each name matches either agency tier. Exact names and unambiguous abbreviations are resolved through agency discovery, each role against its own directory (`type=awarding_agency` for `agency_name`, `type=funding_agency` for `funding_agency_name`), with no fallback to the other; inconclusive or unavailable lookup preserves the supplied name with an unresolved-name notice naming the role's lookup type. Effective names are echoed as `applied_agency_name` and `applied_funding_agency_name`.
|
|
192
196
|
|
|
193
197
|
Award search, category, and geography disclose when no date filter was supplied and results use USAspending's available coverage. They echo the `applied_award_type_codes` actually sent; award search also echoes `applied_recipient_name`. Explicit date bounds retain their existing filling and validation rules.
|
|
194
198
|
|
|
@@ -246,7 +250,7 @@ Agent-friendly output:
|
|
|
246
250
|
- Chaining IDs as explicit fields: `generated_internal_id`, `agency_slug`, `recipient_id` (on award search rows and `recipient.recipient_id`), `federal_account`, and `account_number`, so agents follow the money without parsing display strings
|
|
247
251
|
- Honest pagination: `page_metadata.has_next` on every list, a `total` or `count` where the upstream publishes one, and `truncated` / `shown` / `cap` only when rows are known to exist beyond those returned. A full page with no such evidence keeps `has_next` without claiming truncation
|
|
248
252
|
- Empty results are notices, not errors: account funding, account breakdown, and recipient search distinguish a known zero total from an empty page past the total, which directs callers to an earlier page with the same filters. Without a total, notices describe only the page; award search supplies one through a best-effort count request and discloses a failed count in `unavailable_sections`. The ID-keyed list tools (transactions, subawards, funding accounts, IDV children, account breakdown) return an empty list for an unknown ID rather than failing
|
|
249
|
-
- Typed failures with recovery hints: `award_not_found`, `recipient_not_found`, `agency_not_found`, `account_not_found`, `no_match`, `conflicting_input`, `date_before_earliest`, `date_range_inverted`, `unsupported_sort`, `assistance_listings_type_mismatch`, `psc_codes_type_mismatch`, `invalid_location`, `pagination_limit_exceeded`, `incomplete_cursor`, `missing_def_codes`
|
|
253
|
+
- Typed failures with recovery hints: `award_not_found`, `recipient_not_found`, `agency_not_found`, `account_not_found`, `no_match`, `conflicting_input`, `date_before_earliest`, `date_range_inverted`, `unsupported_sort`, `assistance_listings_type_mismatch`, `psc_codes_type_mismatch`, `contract_filters_type_mismatch`, `invalid_location`, `pagination_limit_exceeded`, `incomplete_cursor`, `missing_def_codes`
|
|
250
254
|
|
|
251
255
|
## Getting started
|
|
252
256
|
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
---
|
|
2
|
+
summary: "Award search filters by extent competed, set-aside, and contract pricing codes and reports matches in every award-type group. Award detail adds executive compensation, offices, and assistance cost share. Funding agency names resolve against the funding directory."
|
|
3
|
+
breaking: false
|
|
4
|
+
security: false
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# 0.7.4 — 2026-11-25
|
|
8
|
+
|
|
9
|
+
## Added
|
|
10
|
+
|
|
11
|
+
- **`usaspending_search_awards`** filters by `extent_competed_type_codes`, `set_aside_type_codes`, and `contract_pricing_type_codes`, flat and in `filters`. They echo as `applied_*`, and an assistance award type beside them fails as `contract_filters_type_mismatch` ([#119](https://github.com/cyanheads/usaspending-mcp-server/issues/119)).
|
|
12
|
+
- **`usaspending_search_awards`** returns `matches_by_group`, the matches in every award-type group, beside `page_metadata.total` for the single group searched; the notice names other groups that match. The group count is cut when it runs 2 seconds past the search and the total count, and `matches_by_group` is then listed in `unavailable_sections` as `api_timeout`, retryable ([#125](https://github.com/cyanheads/usaspending-mcp-server/issues/125)).
|
|
13
|
+
- **`usaspending_get_award`** returns `recipient.executive_compensation`, `office_name`, `subtier_code`, and `subtier_abbreviation` on `awarding_agency` and `funding_agency`, `funding_agency.toptier_slug`, and, on assistance awards, `non_federal_funding`, `total_funding` (absent on loans), and `funding_opportunity` ([#130](https://github.com/cyanheads/usaspending-mcp-server/issues/130)).
|
|
14
|
+
- **`usaspending_search_recipients`** accepts `name`, `recipient_name`, and `search_text` as aliases of `keyword` ([#134](https://github.com/cyanheads/usaspending-mcp-server/issues/134)).
|
|
15
|
+
- **`usaspending_autocomplete_filters`** accepts `type: "funding_agency"` ([#133](https://github.com/cyanheads/usaspending-mcp-server/issues/133)).
|
|
16
|
+
|
|
17
|
+
## Changed
|
|
18
|
+
|
|
19
|
+
- **`usaspending_get_award_transactions`** caps `limit` at 5,000, the upstream maximum (was 2,000) ([#129](https://github.com/cyanheads/usaspending-mcp-server/issues/129)).
|
|
20
|
+
- **Tool descriptions** state each repeated description once per tool; nested twins point at the top-level field. `usaspending_search_awards` is 29,380 → 29,943 bytes in `tools/list` (its `inputSchema` 16,632 → 14,708, with the three new filters); `usaspending_spending_by_geography` 17,930 → 17,329, `usaspending_spending_by_category` 17,033 → 16,581, `usaspending_spending_over_time` 15,544 → 15,070 ([#131](https://github.com/cyanheads/usaspending-mcp-server/issues/131)).
|
|
21
|
+
- **`usaspending-guide` 1.3 → 1.4** covers the contract filters, group counts, and funding-agency lookup.
|
|
22
|
+
|
|
23
|
+
## Fixed
|
|
24
|
+
|
|
25
|
+
- **`funding_agency_name`** resolves against USAspending's funding-agency directory instead of the awarding one, so funding-only agencies verify and their abbreviations resolve ([#133](https://github.com/cyanheads/usaspending-mcp-server/issues/133)).
|
|
26
|
+
- **Award type descriptions** on the three spending analytics tools list the F001–F010 financial-assistance codes their input already accepted.
|
|
27
|
+
- **`usaspending_get_agency`, `usaspending_get_recipient`, and `usaspending_search_awards`** list a secondary request USAspending throttles (HTTP 429) in `unavailable_sections` as `api_unavailable`, retryable, instead of `upstream_error`.
|
|
28
|
+
- **Agency names** are trimmed before lookup, so a padded name resolves; a whitespace-only name is ignored like an empty one instead of failing with an upstream 400, and in award search a blank nested name falls back to the flat one.
|
|
29
|
+
|
|
30
|
+
## Dependencies
|
|
31
|
+
|
|
32
|
+
- **`@biomejs/biome`** ^2.6.7 → ^2.6.9 (dev)
|
|
33
|
+
- **`@types/node`** ^26.6.6 → ^26.6.7 (dev)
|
|
34
|
+
- **`ignore`** ^7.0.14 → ^7.0.16 (dev)
|
|
35
|
+
- **`vitest`** ^5.1.0 → ^5.1.1 (dev); the config selects the threads pool under Bun, whose `ChildProcess` lacks a method the fork pool calls
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
*/
|
|
5
5
|
import { type Context, z } from '@cyanheads/mcp-ts-core';
|
|
6
6
|
import type { USASpendingService } from '../../../services/usaspending/usaspending-service.js';
|
|
7
|
-
/**
|
|
7
|
+
/** Awarding and funding names, each resolved against its own role's directory. */
|
|
8
8
|
export declare const AGENCY_FILTER_FIELDS: {
|
|
9
9
|
agency_name: z.ZodOptional<z.ZodString>;
|
|
10
10
|
funding_agency_name: z.ZodOptional<z.ZodString>;
|
|
@@ -16,7 +16,11 @@ export declare const AGENCY_FILTER_ENRICHMENT: {
|
|
|
16
16
|
applied_agency_name: z.ZodOptional<z.ZodString>;
|
|
17
17
|
applied_funding_agency_name: z.ZodOptional<z.ZodString>;
|
|
18
18
|
};
|
|
19
|
-
/**
|
|
19
|
+
/**
|
|
20
|
+
* Look up each effective name in its own role's directory, in parallel under one deadline;
|
|
21
|
+
* disclose unresolved inputs. The same string in both roles is looked up once per directory.
|
|
22
|
+
* Names are trimmed; a whitespace-only name is absent, as an empty one is.
|
|
23
|
+
*/
|
|
20
24
|
export declare function resolveAgencyFilters(svc: USASpendingService, input: AgencyFilters | undefined, ctx: Context): Promise<{
|
|
21
25
|
names: {
|
|
22
26
|
agency_name?: string | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agency-filters.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/agency-filters.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,KAAK,OAAO,EAAE,CAAC,EAAE,MAAM,wBAAwB,CAAC;AAEzD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,+CAA+C,CAAC;AAKxF,kFAAkF;AAClF,eAAO,MAAM,oBAAoB;IAC/B,WAAW;IAMX,mBAAmB;CAMpB,CAAC;AAEF,uDAAuD;AACvD,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC,OAAO,oBAAoB,CAAC,CAAC,CAAC;AAK9E,6DAA6D;AAC7D,eAAO,MAAM,wBAAwB;IACnC,mBAAmB;IACnB,2BAA2B;CAI5B,CAAC;
|
|
1
|
+
{"version":3,"file":"agency-filters.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/agency-filters.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,KAAK,OAAO,EAAE,CAAC,EAAE,MAAM,wBAAwB,CAAC;AAEzD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,+CAA+C,CAAC;AAKxF,kFAAkF;AAClF,eAAO,MAAM,oBAAoB;IAC/B,WAAW;IAMX,mBAAmB;CAMpB,CAAC;AAEF,uDAAuD;AACvD,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC,OAAO,oBAAoB,CAAC,CAAC,CAAC;AAK9E,6DAA6D;AAC7D,eAAO,MAAM,wBAAwB;IACnC,mBAAmB;IACnB,2BAA2B;CAI5B,CAAC;AAmDF;;;;GAIG;AACH,wBAAsB,oBAAoB,CACxC,GAAG,EAAE,kBAAkB,EACvB,KAAK,EAAE,aAAa,GAAG,SAAS,EAChC,GAAG,EAAE,OAAO;;;;;;GA2Bb;AAED,yFAAyF;AACzF,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,KAAK,EAAE,aAAa,GAAG,IAAI,CAY/F;AAED,wDAAwD;AACxD,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,aAAa;;;EAOpD;AAED,4DAA4D;AAC5D,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,aAAa,GAAG,MAAM,EAAE,CAEpE"}
|
|
@@ -6,7 +6,7 @@ import { z } from '@cyanheads/mcp-ts-core';
|
|
|
6
6
|
import { JsonRpcErrorCode, McpError } from '@cyanheads/mcp-ts-core/errors';
|
|
7
7
|
const LOOKUP_LIMIT = 50;
|
|
8
8
|
const LOOKUP_TIMEOUT_MS = 2_000;
|
|
9
|
-
/**
|
|
9
|
+
/** Awarding and funding names, each resolved against its own role's directory. */
|
|
10
10
|
export const AGENCY_FILTER_FIELDS = {
|
|
11
11
|
agency_name: z
|
|
12
12
|
.string()
|
|
@@ -15,10 +15,10 @@ export const AGENCY_FILTER_FIELDS = {
|
|
|
15
15
|
funding_agency_name: z
|
|
16
16
|
.string()
|
|
17
17
|
.optional()
|
|
18
|
-
.describe('Funding top-tier or sub-tier agency name. Use the matched name from usaspending_autocomplete_filters type=
|
|
18
|
+
.describe('Funding top-tier or sub-tier agency name. Use the matched name from usaspending_autocomplete_filters type=funding_agency. Exact case-insensitive names and unambiguous abbreviations resolve to the directory spelling. When agency_name is also supplied, awards must match both roles.'),
|
|
19
19
|
};
|
|
20
20
|
const AGENCY_ROLES = { agency_name: 'awarding', funding_agency_name: 'funding' };
|
|
21
|
-
const AGENCY_KEYS =
|
|
21
|
+
const AGENCY_KEYS = Object.keys(AGENCY_ROLES);
|
|
22
22
|
/** Echo the names actually sent after best-effort lookup. */
|
|
23
23
|
export const AGENCY_FILTER_ENRICHMENT = {
|
|
24
24
|
applied_agency_name: z.string().optional().describe('Awarding agency name sent to USAspending'),
|
|
@@ -27,9 +27,9 @@ export const AGENCY_FILTER_ENRICHMENT = {
|
|
|
27
27
|
.optional()
|
|
28
28
|
.describe('Funding agency name sent to USAspending'),
|
|
29
29
|
};
|
|
30
|
-
async function resolveName(svc, name, ctx, deadlineAt) {
|
|
30
|
+
async function resolveName(svc, role, name, ctx, deadlineAt) {
|
|
31
31
|
try {
|
|
32
|
-
const { results } = await svc.
|
|
32
|
+
const { results } = await svc.autocompleteAgency(role, name, LOOKUP_LIMIT, ctx, deadlineAt);
|
|
33
33
|
ctx.signal.throwIfAborted();
|
|
34
34
|
const top = results?.toptier_agency ?? [];
|
|
35
35
|
const sub = results?.subtier_agency ?? [];
|
|
@@ -65,29 +65,31 @@ async function resolveName(svc, name, ctx, deadlineAt) {
|
|
|
65
65
|
return { name, reason: 'the agency directory was unavailable' };
|
|
66
66
|
}
|
|
67
67
|
}
|
|
68
|
-
/**
|
|
68
|
+
/**
|
|
69
|
+
* Look up each effective name in its own role's directory, in parallel under one deadline;
|
|
70
|
+
* disclose unresolved inputs. The same string in both roles is looked up once per directory.
|
|
71
|
+
* Names are trimmed; a whitespace-only name is absent, as an empty one is.
|
|
72
|
+
*/
|
|
69
73
|
export async function resolveAgencyFilters(svc, input, ctx) {
|
|
70
|
-
|
|
74
|
+
const supplied = AGENCY_KEYS.flatMap((key) => {
|
|
75
|
+
const name = input?.[key]?.trim();
|
|
76
|
+
return name ? [{ key, name }] : [];
|
|
77
|
+
});
|
|
78
|
+
if (!supplied.length)
|
|
71
79
|
return { names: {}, notices: [] };
|
|
72
|
-
const lookups = new Map();
|
|
73
80
|
const deadlineAt = Date.now() + LOOKUP_TIMEOUT_MS;
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
}
|
|
81
|
+
const resolved = await Promise.all(supplied.map(async ({ key, name }) => ({
|
|
82
|
+
key,
|
|
83
|
+
name,
|
|
84
|
+
match: await resolveName(svc, AGENCY_ROLES[key], name, ctx, deadlineAt),
|
|
85
|
+
})));
|
|
79
86
|
const names = {};
|
|
80
87
|
const notices = [];
|
|
81
|
-
const
|
|
82
|
-
for (const key of AGENCY_KEYS) {
|
|
83
|
-
const name = input?.[key];
|
|
84
|
-
const match = name ? resolved.get(name) : undefined;
|
|
85
|
-
if (!match)
|
|
86
|
-
continue;
|
|
88
|
+
for (const { key, name, match } of resolved) {
|
|
87
89
|
names[key] = match.name;
|
|
88
90
|
if (match.reason) {
|
|
89
91
|
const candidates = match.candidates?.map((candidate) => JSON.stringify(candidate)).join(', ');
|
|
90
|
-
notices.push(`Could not verify ${key}=${JSON.stringify(name)} because ${match.reason}. Sent the original name.${candidates ? ` Matching names: ${candidates}.` : ''} Use usaspending_autocomplete_filters type
|
|
92
|
+
notices.push(`Could not verify ${key}=${JSON.stringify(name)} because ${match.reason}. Sent the original name.${candidates ? ` Matching names: ${candidates}.` : ''} Use usaspending_autocomplete_filters type=${AGENCY_ROLES[key]}_agency to check the name.`);
|
|
91
93
|
}
|
|
92
94
|
}
|
|
93
95
|
return { names, notices };
|
|
@@ -95,7 +97,7 @@ export async function resolveAgencyFilters(svc, input, ctx) {
|
|
|
95
97
|
/** Match either tier within each supplied role, retaining matches under every parent. */
|
|
96
98
|
export function applyAgencyFilters(filters, names) {
|
|
97
99
|
const agencies = AGENCY_KEYS.flatMap((key) => {
|
|
98
|
-
const name = names[key];
|
|
100
|
+
const name = names[key]?.trim();
|
|
99
101
|
const type = AGENCY_ROLES[key];
|
|
100
102
|
return name
|
|
101
103
|
? [
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agency-filters.js","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/agency-filters.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAgB,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,EAAE,gBAAgB,EAAE,QAAQ,EAAE,MAAM,+BAA+B,CAAC;AAG3E,MAAM,YAAY,GAAG,EAAE,CAAC;AACxB,MAAM,iBAAiB,GAAG,KAAK,CAAC;AAEhC,kFAAkF;AAClF,MAAM,CAAC,MAAM,oBAAoB,GAAG;IAClC,WAAW,EAAE,CAAC;SACX,MAAM,EAAE;SACR,QAAQ,EAAE;SACV,QAAQ,CACP,uVAAuV,CACxV;IACH,mBAAmB,EAAE,CAAC;SACnB,MAAM,EAAE;SACR,QAAQ,EAAE;SACV,QAAQ,CACP,
|
|
1
|
+
{"version":3,"file":"agency-filters.js","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/agency-filters.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAgB,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,EAAE,gBAAgB,EAAE,QAAQ,EAAE,MAAM,+BAA+B,CAAC;AAG3E,MAAM,YAAY,GAAG,EAAE,CAAC;AACxB,MAAM,iBAAiB,GAAG,KAAK,CAAC;AAEhC,kFAAkF;AAClF,MAAM,CAAC,MAAM,oBAAoB,GAAG;IAClC,WAAW,EAAE,CAAC;SACX,MAAM,EAAE;SACR,QAAQ,EAAE;SACV,QAAQ,CACP,uVAAuV,CACxV;IACH,mBAAmB,EAAE,CAAC;SACnB,MAAM,EAAE;SACR,QAAQ,EAAE;SACV,QAAQ,CACP,0RAA0R,CAC3R;CACJ,CAAC;AAKF,MAAM,YAAY,GAAG,EAAE,WAAW,EAAE,UAAU,EAAE,mBAAmB,EAAE,SAAS,EAAW,CAAC;AAC1F,MAAM,WAAW,GAAG,MAAM,CAAC,IAAI,C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,KAAoB;IACxD,OAAO,WAAW,CAAC,OAAO,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,GAAG,IAAI,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;AACpG,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"autocomplete-filters.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/autocomplete-filters.tool.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAiEjE,eAAO,MAAM,uBAAuB
|
|
1
|
+
{"version":3,"file":"autocomplete-filters.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/autocomplete-filters.tool.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAiEjE,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA4ZlC,CAAC"}
|
|
@@ -61,12 +61,21 @@ function mapLocationBuckets(resp, requested) {
|
|
|
61
61
|
}
|
|
62
62
|
export const autocompleteFiltersTool = tool('usaspending_autocomplete_filters', {
|
|
63
63
|
title: 'Autocomplete Codes and Names',
|
|
64
|
-
description: '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), def_code (Disaster/Emergency Funding codes by code, appropriation title, or public law), awarding_agency (agency and sub-agency names, each with its tier and top-tier parent — agency_name and funding_agency_name
|
|
64
|
+
description: '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), def_code (Disaster/Emergency Funding codes by code, appropriation title, or public law), awarding_agency and funding_agency (agency and sub-agency names from the awarding and the funding directory, each with its tier and top-tier parent — agency_name takes an awarding_agency match and funding_agency_name a funding_agency match; a sub-tier name shared by several parents matches under all parents), recipient (recipient names with UEI/DUNS), or location (US state, county, and congressional district names, resolved to the codes the location filters and usaspending_spending_by_geography shape_codes take). 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.',
|
|
65
65
|
annotations: { readOnlyHint: true, openWorldHint: true, idempotentHint: true },
|
|
66
66
|
input: z.object({
|
|
67
67
|
type: z
|
|
68
|
-
.enum([
|
|
69
|
-
|
|
68
|
+
.enum([
|
|
69
|
+
'naics',
|
|
70
|
+
'psc',
|
|
71
|
+
'cfda',
|
|
72
|
+
'awarding_agency',
|
|
73
|
+
'funding_agency',
|
|
74
|
+
'recipient',
|
|
75
|
+
'location',
|
|
76
|
+
'def_code',
|
|
77
|
+
])
|
|
78
|
+
.describe('Lookup table to search: naics (industry codes), psc (product/service codes, for psc_codes), cfda (Assistance Listing program numbers, for assistance_listings), def_code (Disaster/Emergency Funding codes, for def_codes), awarding_agency (awarding agency and sub-agency names, for agency_name), funding_agency (funding agency and sub-agency names, for funding_agency_name), recipient (recipient names), location (US states with DC and the territories, counties, and current congressional districts, matched from the start of their name: "King County", "Santa Fe", "WA-07"; countries, cities, and ZIP codes are not returned). The psc_codes, assistance_listings, and def_codes filters are taken by usaspending_search_awards and the spending analytics tools.'),
|
|
70
79
|
search_text: z
|
|
71
80
|
.string()
|
|
72
81
|
.min(1)
|
|
@@ -90,7 +99,7 @@ export const autocompleteFiltersTool = tool('usaspending_autocomplete_filters',
|
|
|
90
99
|
name: z
|
|
91
100
|
.string()
|
|
92
101
|
.optional()
|
|
93
|
-
.describe("Human-readable name or description; for awarding_agency, the matched agency's own name, which for a sub-agency differs from toptier_name; for location, upstream's uppercase name (WASHINGTON, KING, WA-07)"),
|
|
102
|
+
.describe("Human-readable name or description; for awarding_agency and funding_agency, the matched agency's own name, which for a sub-agency differs from toptier_name; for location, upstream's uppercase name (WASHINGTON, KING, WA-07)"),
|
|
94
103
|
public_law: z
|
|
95
104
|
.string()
|
|
96
105
|
.optional()
|
|
@@ -106,23 +115,23 @@ export const autocompleteFiltersTool = tool('usaspending_autocomplete_filters',
|
|
|
106
115
|
abbreviation: z
|
|
107
116
|
.string()
|
|
108
117
|
.optional()
|
|
109
|
-
.describe("awarding_agency only: the matched agency's own abbreviation, when it has one"),
|
|
118
|
+
.describe("awarding_agency and funding_agency only: the matched agency's own abbreviation, when it has one"),
|
|
110
119
|
tier: z
|
|
111
120
|
.enum(['toptier', 'subtier'])
|
|
112
121
|
.optional()
|
|
113
|
-
.describe('awarding_agency only: toptier for a department-level agency, subtier for a component under one'),
|
|
122
|
+
.describe('awarding_agency and funding_agency only: toptier for a department-level agency, subtier for a component under one'),
|
|
114
123
|
toptier_name: z
|
|
115
124
|
.string()
|
|
116
125
|
.optional()
|
|
117
|
-
.describe('awarding_agency only: the top-tier parent name. Use the matched name in agency_name or funding_agency_name on usaspending_search_awards and spending analytics to select the sub-agency; use toptier_name intentionally to select its whole parent department.'),
|
|
126
|
+
.describe('awarding_agency and funding_agency only: the top-tier parent name. Use the matched name in agency_name (from awarding_agency) or funding_agency_name (from funding_agency) on usaspending_search_awards and spending analytics to select the sub-agency; use toptier_name intentionally to select its whole parent department.'),
|
|
118
127
|
toptier_code: z
|
|
119
128
|
.string()
|
|
120
129
|
.optional()
|
|
121
|
-
.describe('awarding_agency only: the directory top-tier agency code, accepted by usaspending_get_agency'),
|
|
130
|
+
.describe('awarding_agency and funding_agency only: the directory top-tier agency code, accepted by usaspending_get_agency'),
|
|
122
131
|
subtier_code: z
|
|
123
132
|
.string()
|
|
124
133
|
.optional()
|
|
125
|
-
.describe('awarding_agency only: the matched sub-tier agency code, when supplied'),
|
|
134
|
+
.describe('awarding_agency and funding_agency only: the matched sub-tier agency code, when supplied'),
|
|
126
135
|
uei: z
|
|
127
136
|
.string()
|
|
128
137
|
.optional()
|
|
@@ -254,8 +263,9 @@ export const autocompleteFiltersTool = tool('usaspending_autocomplete_filters',
|
|
|
254
263
|
: {}),
|
|
255
264
|
}));
|
|
256
265
|
}
|
|
257
|
-
else if (input.type === 'awarding_agency') {
|
|
258
|
-
const
|
|
266
|
+
else if (input.type === 'awarding_agency' || input.type === 'funding_agency') {
|
|
267
|
+
const role = input.type === 'awarding_agency' ? 'awarding' : 'funding';
|
|
268
|
+
const resp = await svc.autocompleteAgency(role, input.search_text, requested, ctx);
|
|
259
269
|
const mapAgency = (r, tier) => {
|
|
260
270
|
const parent = tier === 'toptier' ? r : r.toptier_agency;
|
|
261
271
|
return {
|
|
@@ -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;AACjE,OAAO,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AACpE,OAAO,EACL,+BAA+B,GAGhC,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,qBAAqB,EAAE,MAAM,+CAA+C,CAAC;AACtF,OAAO,EAAE,UAAU,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AACnF,OAAO,EAAE,kBAAkB,EAAE,0BAA0B,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AAEpG,iHAAiH;AACjH,MAAM,KAAK,GAAG,UAAU,CAAC,EAAE,IAAI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CAAC,EAAE,CAAC,CAAC;IACpD,CAAC;CACF,CAAC,CAAC"}
|
|
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;AACjE,OAAO,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AACpE,OAAO,EACL,+BAA+B,GAGhC,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,qBAAqB,EAAE,MAAM,+CAA+C,CAAC;AACtF,OAAO,EAAE,UAAU,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AACnF,OAAO,EAAE,kBAAkB,EAAE,0BAA0B,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AAEpG,iHAAiH;AACjH,MAAM,KAAK,GAAG,UAAU,CAAC,EAAE,IAAI,EAAE,kCAAkC,EAAE,OAAO,EAAE,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,CAAC;AAE9F,6GAA6G;AAC7G,MAAM,gBAAgB,GAAG,sBAAsB,CAAC;AAIhD;;;;;;GAMG;AACH,SAAS,kBAAkB,CAAC,IAAqC,EAAE,SAAiB;IAClF,MAAM,MAAM,GAAG,IAAI,CAAC,OAAO,EAAE,MAAM,IAAI,EAAE,CAAC;IAC1C,MAAM,QAAQ,GAAG,IAAI,CAAC,OAAO,EAAE,QAAQ,IAAI,EAAE,CAAC;IAC9C,MAAM,SAAS,GAAG,IAAI,CAAC,OAAO,EAAE,iBAAiB,IAAI,EAAE,CAAC;IACxD,MAAM,IAAI,GAAG;QACX,GAAG,MAAM,CAAC,OAAO,CAAC,CAAC,EAAE,UAAU,EAAE,IAAI,EAAE,EAAE,EAAE;YACzC,MAAM,MAA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AAC,YAAY,oBAAoB,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;YACjE,IAAI,CAAC,CAAC,YAAY;gBAAE,KAAK,CAAC,IAAI,CAAC,sBAAsB,oBAAoB,CAAC,CAAC,CAAC,YAAY,CAAC,EAAE,CAAC,CAAC;YAC7F,IAAI,CAAC,CAAC,IAAI;gBAAE,KAAK,CAAC,IAAI,CAAC,aAAa,oBAAoB,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;YACpE,IAAI,CAAC,CAAC,UAAU;gBAAE,KAAK,CAAC,IAAI,CAAC,mBAAmB,oBAAoB,CAAC,CAAC,CAAC,UAAU,CAAC,EAAE,CAAC,CAAC;YACtF,IAAI,CAAC,CAAC,cAAc;gBAClB,KAAK,CAAC,IAAI,CAAC,uBAAuB,oBAAoB,CAAC,CAAC,CAAC,cAAc,CAAC,EAAE,CAAC,CAAC;YAC9E,KAAK,CAAC,IAAI,CAAC,KAAK,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;QACvC,CAAC;QACD,KAAK,CAAC,IAAI,CAAC,gBAAgB,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC;QAC3C,OAAO,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACpD,CAAC;CACF,CAAC,CAAC"}
|
|
@@ -2,7 +2,8 @@
|
|
|
2
2
|
* @fileoverview Shared filter builder for USAspending analytics endpoints, and the
|
|
3
3
|
* program, product/service, and emergency-funding code filters and the
|
|
4
4
|
* place-of-performance and recipient location filters shared by
|
|
5
|
-
* `usaspending_search_awards` and the three spending analytics tools
|
|
5
|
+
* `usaspending_search_awards` and the three spending analytics tools, plus the
|
|
6
|
+
* contract competition, set-aside, and pricing filters award search alone takes.
|
|
6
7
|
* @module mcp-server/tools/definitions/filters
|
|
7
8
|
*/
|
|
8
9
|
import { z } from '@cyanheads/mcp-ts-core';
|
|
@@ -36,6 +37,11 @@ export declare const AWARD_TYPE_CODES: {
|
|
|
36
37
|
loans: string[];
|
|
37
38
|
other: string[];
|
|
38
39
|
};
|
|
40
|
+
/**
|
|
41
|
+
* Every award type code by group, as the `award_type_codes` descriptions list
|
|
42
|
+
* them: `A/B/C/D (contracts), IDV_A/… (IDVs), …`.
|
|
43
|
+
*/
|
|
44
|
+
export declare const AWARD_TYPE_GROUP_LIST: string;
|
|
39
45
|
/** Contract and IDV award type codes — the awards that carry a PSC and no Assistance Listing. */
|
|
40
46
|
export declare const PROCUREMENT_AWARD_TYPE_CODES: ReadonlySet<string>;
|
|
41
47
|
/**
|
|
@@ -43,10 +49,17 @@ export declare const PROCUREMENT_AWARD_TYPE_CODES: ReadonlySet<string>;
|
|
|
43
49
|
* awards that carry an Assistance Listing and no PSC.
|
|
44
50
|
*/
|
|
45
51
|
export declare const ASSISTANCE_AWARD_TYPE_CODES: ReadonlySet<string>;
|
|
52
|
+
/**
|
|
53
|
+
* Re-describes each field as a pointer to its top-level twin, for a tool that
|
|
54
|
+
* declares the same fields flat and again in a nested object: one schema per
|
|
55
|
+
* key, its full description stated once per tool, at the top level.
|
|
56
|
+
*/
|
|
57
|
+
export declare function nestedTwins<const T extends Record<string, z.ZodType>>(fields: T): T;
|
|
46
58
|
/**
|
|
47
59
|
* The three code filters, keyed as every tool that takes them declares them.
|
|
48
|
-
* One
|
|
49
|
-
*
|
|
60
|
+
* One schema per key, spread into each tool's input; award search, which
|
|
61
|
+
* declares them flat and in `filters`, points the nested copy at the flat one
|
|
62
|
+
* with {@link nestedTwins}.
|
|
50
63
|
*/
|
|
51
64
|
export declare const CODE_FILTER_FIELDS: {
|
|
52
65
|
assistance_listings: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
@@ -77,10 +90,42 @@ export declare function codeFilterEcho(codes: CodeFilters): {
|
|
|
77
90
|
};
|
|
78
91
|
/** The code filters sent, as `key=value` parts an empty-result notice names. */
|
|
79
92
|
export declare function describeCodeFilters(codes: CodeFilters): string[];
|
|
93
|
+
/**
|
|
94
|
+
* The contract filters, sent under these same upstream keys. Only
|
|
95
|
+
* `usaspending_search_awards` spreads them (flat, and as pointer twins in its
|
|
96
|
+
* nested `filters`); the analytics tools' `filters` stays without them. The rule
|
|
97
|
+
* the three share sits once on award search's tool description.
|
|
98
|
+
*/
|
|
99
|
+
export declare const CONTRACT_FILTER_FIELDS: {
|
|
100
|
+
extent_competed_type_codes: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
101
|
+
set_aside_type_codes: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
102
|
+
contract_pricing_type_codes: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
103
|
+
};
|
|
104
|
+
type ContractFilterKey = keyof typeof CONTRACT_FILTER_FIELDS;
|
|
105
|
+
/** The contract filters as sent: uppercased, with an empty list dropped. */
|
|
106
|
+
type ContractFilters = {
|
|
107
|
+
[K in ContractFilterKey]?: string[];
|
|
108
|
+
};
|
|
109
|
+
/**
|
|
110
|
+
* Upstream matches the codes case-sensitively, answering a lowercase one with
|
|
111
|
+
* zero rows, and 422s on an empty list, so both are normalized away.
|
|
112
|
+
*/
|
|
113
|
+
export declare function normalizeContractFilters(f: {
|
|
114
|
+
[K in ContractFilterKey]?: string[] | undefined;
|
|
115
|
+
}): ContractFilters;
|
|
116
|
+
/** The contract filters sent, as the comma-joined `applied_*` echo award search carries. */
|
|
117
|
+
export declare function contractFilterEcho(codes: ContractFilters): {
|
|
118
|
+
applied_contract_pricing_type_codes?: string;
|
|
119
|
+
applied_extent_competed_type_codes?: string;
|
|
120
|
+
applied_set_aside_type_codes?: string;
|
|
121
|
+
};
|
|
122
|
+
/** The contract filters sent, as `key=value` parts an empty-result notice names. */
|
|
123
|
+
export declare function describeContractFilters(codes: ContractFilters): string[];
|
|
80
124
|
/**
|
|
81
125
|
* The two location filters, keyed as every `filters` object that takes them
|
|
82
|
-
* declares them
|
|
83
|
-
*
|
|
126
|
+
* declares them, for the analytics tools: place_of_performance_location states
|
|
127
|
+
* the location fields in full, and recipient_location, validated the same way,
|
|
128
|
+
* points at it.
|
|
84
129
|
*/
|
|
85
130
|
export declare const LOCATION_FILTER_FIELDS: {
|
|
86
131
|
place_of_performance_location: z.ZodOptional<z.ZodObject<{
|
|
@@ -97,6 +142,25 @@ export declare const LOCATION_FILTER_FIELDS: {
|
|
|
97
142
|
}, z.core.$strict>>;
|
|
98
143
|
};
|
|
99
144
|
type LocationFilterKey = keyof typeof LOCATION_FILTER_FIELDS;
|
|
145
|
+
/**
|
|
146
|
+
* The location filters of `usaspending_search_awards`' nested `filters`, both
|
|
147
|
+
* pointing at its top-level location_filter, which states the location fields
|
|
148
|
+
* first.
|
|
149
|
+
*/
|
|
150
|
+
export declare const NESTED_LOCATION_FILTER_FIELDS: {
|
|
151
|
+
place_of_performance_location: z.ZodOptional<z.ZodObject<{
|
|
152
|
+
country: z.ZodOptional<z.ZodPreprocess<z.ZodUnion<readonly [z.ZodLiteral<"">, z.ZodString]>, unknown>>;
|
|
153
|
+
state: z.ZodOptional<z.ZodPreprocess<z.ZodUnion<readonly [z.ZodLiteral<"">, z.ZodString]>, unknown>>;
|
|
154
|
+
county: z.ZodOptional<z.ZodPreprocess<z.ZodUnion<readonly [z.ZodLiteral<"">, z.ZodString]>, unknown>>;
|
|
155
|
+
city: z.ZodOptional<z.ZodString>;
|
|
156
|
+
}, z.core.$strict>>;
|
|
157
|
+
recipient_location: z.ZodOptional<z.ZodObject<{
|
|
158
|
+
country: z.ZodOptional<z.ZodPreprocess<z.ZodUnion<readonly [z.ZodLiteral<"">, z.ZodString]>, unknown>>;
|
|
159
|
+
state: z.ZodOptional<z.ZodPreprocess<z.ZodUnion<readonly [z.ZodLiteral<"">, z.ZodString]>, unknown>>;
|
|
160
|
+
county: z.ZodOptional<z.ZodPreprocess<z.ZodUnion<readonly [z.ZodLiteral<"">, z.ZodString]>, unknown>>;
|
|
161
|
+
city: z.ZodOptional<z.ZodString>;
|
|
162
|
+
}, z.core.$strict>>;
|
|
163
|
+
};
|
|
100
164
|
/** The location filters as a call supplied them. */
|
|
101
165
|
export type LocationFilterInput = {
|
|
102
166
|
[K in LocationFilterKey]?: z.infer<typeof LocationFilterSchema>;
|