@cyanheads/usaspending-mcp-server 0.2.3 → 0.2.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.
Files changed (31) hide show
  1. package/CLAUDE.md +2 -2
  2. package/Dockerfile +10 -6
  3. package/LICENSE +201 -0
  4. package/README.md +3 -3
  5. package/changelog/0.2.x/0.2.4.md +27 -0
  6. package/changelog/0.2.x/0.2.5.md +27 -0
  7. package/changelog/template.md +5 -3
  8. package/dist/mcp-server/tools/definitions/disaster-spending.tool.d.ts +2 -5
  9. package/dist/mcp-server/tools/definitions/disaster-spending.tool.d.ts.map +1 -1
  10. package/dist/mcp-server/tools/definitions/disaster-spending.tool.js +38 -23
  11. package/dist/mcp-server/tools/definitions/disaster-spending.tool.js.map +1 -1
  12. package/dist/mcp-server/tools/definitions/get-agency.tool.d.ts.map +1 -1
  13. package/dist/mcp-server/tools/definitions/get-agency.tool.js +7 -0
  14. package/dist/mcp-server/tools/definitions/get-agency.tool.js.map +1 -1
  15. package/dist/mcp-server/tools/definitions/index.d.ts +26 -7
  16. package/dist/mcp-server/tools/definitions/index.d.ts.map +1 -1
  17. package/dist/mcp-server/tools/definitions/search-awards.tool.d.ts +24 -2
  18. package/dist/mcp-server/tools/definitions/search-awards.tool.d.ts.map +1 -1
  19. package/dist/mcp-server/tools/definitions/search-awards.tool.js +198 -46
  20. package/dist/mcp-server/tools/definitions/search-awards.tool.js.map +1 -1
  21. package/dist/mcp-server/tools/definitions/spending-over-time.tool.d.ts.map +1 -1
  22. package/dist/mcp-server/tools/definitions/spending-over-time.tool.js +2 -1
  23. package/dist/mcp-server/tools/definitions/spending-over-time.tool.js.map +1 -1
  24. package/dist/services/usaspending/types.d.ts +12 -1
  25. package/dist/services/usaspending/types.d.ts.map +1 -1
  26. package/dist/services/usaspending/usaspending-service.d.ts +4 -1
  27. package/dist/services/usaspending/usaspending-service.d.ts.map +1 -1
  28. package/dist/services/usaspending/usaspending-service.js +27 -27
  29. package/dist/services/usaspending/usaspending-service.js.map +1 -1
  30. package/package.json +7 -4
  31. package/server.json +3 -3
package/CLAUDE.md CHANGED
@@ -1,8 +1,8 @@
1
1
  # Developer Protocol
2
2
 
3
3
  **Server:** usaspending-mcp-server
4
- **Version:** 0.2.3
5
- **Framework:** [@cyanheads/mcp-ts-core](https://www.npmjs.com/package/@cyanheads/mcp-ts-core) `^0.10.9`
4
+ **Version:** 0.2.5
5
+ **Framework:** [@cyanheads/mcp-ts-core](https://www.npmjs.com/package/@cyanheads/mcp-ts-core) `^0.10.14`
6
6
  **Engines:** Bun ≥1.3.0, Node ≥24.0.0
7
7
  **MCP SDK:** `@modelcontextprotocol/sdk` ^1.29.0
8
8
  **Zod:** ^4.4.3
package/Dockerfile CHANGED
@@ -4,15 +4,17 @@
4
4
  # This stage installs all dependencies (including dev), builds the TypeScript
5
5
  # source code into JavaScript, and prepares the production assets.
6
6
  # ==============================================================================
7
- FROM oven/bun:1.3 AS build
7
+ FROM oven/bun:1.3.14 AS build
8
8
 
9
9
  WORKDIR /usr/src/app
10
10
 
11
11
  # Copy dependency manifests for optimized layer caching
12
12
  COPY package.json bun.lock ./
13
13
 
14
- # Install all dependencies (including dev dependencies for building)
15
- RUN bun install --frozen-lockfile
14
+ # Install all dependencies (including dev dependencies for building).
15
+ # The BuildKit cache mount persists Bun's global package cache across builds.
16
+ RUN --mount=type=cache,target=/root/.bun/install/cache \
17
+ bun install --frozen-lockfile --ignore-scripts
16
18
 
17
19
  # Copy the rest of the source code
18
20
  COPY . .
@@ -28,7 +30,7 @@ RUN bun run build
28
30
  # application. It uses a slim base image and only includes production
29
31
  # dependencies and build artifacts.
30
32
  # ==============================================================================
31
- FROM oven/bun:1.3-slim AS production
33
+ FROM oven/bun:1.3.14-slim AS production
32
34
 
33
35
  WORKDIR /usr/src/app
34
36
 
@@ -49,13 +51,15 @@ COPY package.json bun.lock ./
49
51
 
50
52
  # Install only production dependencies, ignoring any lifecycle scripts (like 'prepare')
51
53
  # that are not needed in the final production image.
52
- RUN bun install --production --frozen-lockfile --ignore-scripts
54
+ RUN --mount=type=cache,target=/root/.bun/install/cache \
55
+ bun install --production --frozen-lockfile --ignore-scripts
53
56
 
54
57
  # Conditionally install OpenTelemetry optional peer dependencies (Tier 3).
55
58
  # These are not bundled by default to keep the base image lean. Enable at build time
56
59
  # with: docker build --build-arg OTEL_ENABLED=true
57
60
  ARG OTEL_ENABLED=true
58
- RUN if [ "$OTEL_ENABLED" = "true" ]; then \
61
+ RUN --mount=type=cache,target=/root/.bun/install/cache \
62
+ if [ "$OTEL_ENABLED" = "true" ]; then \
59
63
  bun add @hono/otel \
60
64
  @opentelemetry/instrumentation-http \
61
65
  @opentelemetry/exporter-metrics-otlp-http \
package/LICENSE ADDED
@@ -0,0 +1,201 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright 2026 Casey Hand @cyanheads
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
package/README.md CHANGED
@@ -7,7 +7,7 @@
7
7
 
8
8
  <div align="center">
9
9
 
10
- [![Version](https://img.shields.io/badge/Version-0.2.3-blue.svg?style=flat-square)](./CHANGELOG.md) [![License](https://img.shields.io/badge/License-Apache%202.0-orange.svg?style=flat-square)](./LICENSE) [![Docker](https://img.shields.io/badge/Docker-ghcr.io-2496ED?style=flat-square&logo=docker&logoColor=white)](https://github.com/users/cyanheads/packages/container/package/usaspending-mcp-server) [![MCP SDK](https://img.shields.io/badge/MCP%20SDK-^1.29.0-green.svg?style=flat-square)](https://modelcontextprotocol.io/) [![npm](https://img.shields.io/npm/v/@cyanheads/usaspending-mcp-server?style=flat-square&logo=npm&logoColor=white)](https://www.npmjs.com/package/@cyanheads/usaspending-mcp-server) [![TypeScript](https://img.shields.io/badge/TypeScript-^6.0.3-3178C6.svg?style=flat-square)](https://www.typescriptlang.org/) [![Bun](https://img.shields.io/badge/Bun-v1.3.0-blueviolet.svg?style=flat-square)](https://bun.sh/)
10
+ [![Version](https://img.shields.io/badge/Version-0.2.5-blue.svg?style=flat-square)](./CHANGELOG.md) [![License](https://img.shields.io/badge/License-Apache%202.0-orange.svg?style=flat-square)](./LICENSE) [![Docker](https://img.shields.io/badge/Docker-ghcr.io-2496ED?style=flat-square&logo=docker&logoColor=white)](https://github.com/users/cyanheads/packages/container/package/usaspending-mcp-server) [![MCP SDK](https://img.shields.io/badge/MCP%20SDK-^1.29.0-green.svg?style=flat-square)](https://modelcontextprotocol.io/) [![npm](https://img.shields.io/npm/v/@cyanheads/usaspending-mcp-server?style=flat-square&logo=npm&logoColor=white)](https://www.npmjs.com/package/@cyanheads/usaspending-mcp-server) [![TypeScript](https://img.shields.io/badge/TypeScript-^6.0.3-3178C6.svg?style=flat-square)](https://www.typescriptlang.org/) [![Bun](https://img.shields.io/badge/Bun-v1.3.14-blueviolet.svg?style=flat-square)](https://bun.sh/)
11
11
 
12
12
  </div>
13
13
 
@@ -56,9 +56,9 @@ Search for federal awards across contracts, grants, loans, direct payments, and
56
56
 
57
57
  - Full-text keyword search across award descriptions, recipient names, and locations
58
58
  - Filter by award type codes (`A/B/C/D` = contracts, `02/03/04/05` = grants, `06/10` = direct payments, `07/08` = loans, `IDV_*` = IDVs)
59
- - Filter by awarding or funding agency (toptier or subtier), recipient name or ID, NAICS code, PSC code, and place of performance
59
+ - Filter by awarding or funding agency (toptier or subtier), recipient name, NAICS code, and place of performance
60
60
  - Date range filtering — earliest 2007-10-01 via search API
61
- - Pagination via `limit` (max 100) and `page`; `page_metadata.hasNext` signals more results
61
+ - Pagination via `limit` (max 100) and `page`; `page_metadata.hasNext` signals more results. Page-number paging caps at a 50,000-result offset (`page` × `limit`) — past that, continue with keyset pagination using the `last_record_sort_value` + `last_record_unique_id` cursor returned on every page
62
62
  - Returns `generated_internal_id` for chaining to `usaspending_get_award` and `agency_slug` for chaining to `usaspending_get_agency`
63
63
 
64
64
  ---
@@ -0,0 +1,27 @@
1
+ ---
2
+ summary: "Three usaspending_disaster_spending fixes — geography returns real obligation amounts plus population/per-capita (#18), breakdown pagination advances pages (#19), and the unreachable no_data contract is removed (#35) — atop @cyanheads/mcp-ts-core ^0.10.14 adoption with Socket install-time scanning."
3
+ breaking: false
4
+ security: false
5
+ ---
6
+
7
+ # 0.2.4 — 2026-07-16
8
+
9
+ Three `usaspending_disaster_spending` bug fixes, plus adoption of the `@cyanheads/mcp-ts-core` ^0.10.14 toolchain (Socket supply-chain scanning, pinned Docker base, re-synced skills).
10
+
11
+ ## Fixed
12
+
13
+ - **`usaspending_disaster_spending` geography returned empty rows (#18)** — the geography dimension mapped a phantom `aggregated_amount` field the API never sends and omitted the `spending_type` the endpoint requires (returning HTTP 422). It now sends `spending_type: obligation` with `scope: place_of_performance` and reads the real `amount` field, surfacing obligated dollars plus `award_count`, `population`, and `per_capita` per area, rendered as columns in the results table.
14
+ - **`usaspending_disaster_spending` breakdown pagination was ignored (#19)** — the agency, CFDA, and recipient breakdowns passed `limit`/`page` at the top level of the request body, which USAspending silently drops, always returning the first default page. Pagination is now nested under a `pagination` key so `page` and `limit` take effect.
15
+ - **`usaspending_disaster_spending` unreachable `no_data` error contract (#35)** — removed the `no_data` error entry the handler never throws, and rewrote the empty-results guidance, which told callers to remove the `def_codes` filter that every non-overview dimension actually requires.
16
+
17
+ ## Changed
18
+
19
+ - **Geography `spending_type` output is now `obligation`** — the geography dimension reports the measure it queries; the `award`/`total` input still applies to the agency and recipient dimensions. Tool and field descriptions now spell out per-dimension applicability of `spending_type` and `limit`.
20
+ - **Biome cleanup from the 0.10.14 toolchain** — dropped redundant `async` on `USASpendingService` passthrough methods and replaced non-null assertions with explicit guards; `usaspending_get_agency` now throws a typed `missing_input` when neither `toptier_code` nor `agency_slug` resolves. Behavior-preserving.
21
+ - **Framework 0.10.14 toolchain adopted** — `bunfig.toml` adds a 3-day `minimumReleaseAge` install guard (framework excluded for same-day adoption) and the `@socketsecurity/bun-security-scanner`; `Dockerfile` pins the `oven/bun:1.3.14` base and adds BuildKit cache mounts; devcheck scripts, vendored skills, the changelog template, and repo metadata (`LICENSE`, `.github/SECURITY.md`, `.gitattributes`) re-synced.
22
+
23
+ ## Dependency bumps
24
+
25
+ - `@cyanheads/mcp-ts-core` `^0.10.9` → `^0.10.14`
26
+ - `@types/node` `26.0.0` → `^26.0.0`
27
+ - `@socketsecurity/bun-security-scanner` `^1.1.2` (new devDependency)
@@ -0,0 +1,27 @@
1
+ ---
2
+ summary: "usaspending_search_awards gains a nested filters object mirroring the analytics tools, an agency_slug chaining field, and keyset-cursor pagination past the endpoint's 50,000-result window, plus a fix for a crash on any search's terminal page."
3
+ breaking: false
4
+ security: false
5
+ ---
6
+
7
+ # 0.2.5 — 2026-07-16
8
+
9
+ Four `usaspending_search_awards` fixes: a nested `filters` object, the `agency_slug` chaining field, keyset-cursor pagination past the endpoint's 50,000-result window, and a crash fix on the last page of any search.
10
+
11
+ ## Added
12
+
13
+ - **`usaspending_search_awards` accepts a nested `filters` object** — mirrors the analytics-tool shape (`keywords`, `award_type_codes`, `agency_name`, `recipient_name`, `naics_codes`, `time_period_start`/`time_period_end`); per field, a nested value wins over its flat-input equivalent. `recipient_id` is intentionally excluded — `spending_by_award` silently ignores it. ([#21](https://github.com/cyanheads/usaspending-mcp-server/issues/21))
14
+ - **`agency_slug` in `usaspending_search_awards` results** — requested via `AWARD_SEARCH_FIELDS` and mapped into both `structuredContent` and `content[]` for chaining into `usaspending_get_agency`; absent (not `null`) when the agency has no profile page. ([#22](https://github.com/cyanheads/usaspending-mcp-server/issues/22))
15
+ - **Keyset-cursor pagination on `usaspending_search_awards`** — `last_record_sort_value` + `last_record_unique_id` accepted as input and returned in `page_metadata`, so callers can page past the endpoint's 50,000-result page-number boundary. A new `pagination_limit_exceeded` error fires when `page × limit` crosses that boundary without a cursor supplied. ([#37](https://github.com/cyanheads/usaspending-mcp-server/issues/37))
16
+ - **Upstream `messages` surfaced** — `usaspending_search_awards` reads the `messages` array `search/spending_by_award/` returns (e.g. an ignored filter) into an `upstream_messages` enrichment field, rendered as a bullet list in `content[]`. ([#21](https://github.com/cyanheads/usaspending-mcp-server/issues/21))
17
+ - **Page-based truncation disclosure** — `usaspending_search_awards` calls `ctx.enrich.truncated()` with `shown`/`cap` when a page is capped, since the endpoint returns no total count. ([#37](https://github.com/cyanheads/usaspending-mcp-server/issues/37))
18
+
19
+ ## Changed
20
+
21
+ - **`page_metadata.total` removed from `usaspending_search_awards`** — `spending_by_award` never populates it, confirmed across three live query shapes; the `totalCount` enrichment field is removed alongside it. ([#37](https://github.com/cyanheads/usaspending-mcp-server/issues/37))
22
+ - **`RawPageMetadata` cursor fields widened to `string | null` / `number | null`** — matches the upstream's literal terminal-page sentinels. ([#39](https://github.com/cyanheads/usaspending-mcp-server/issues/39))
23
+ - **`USASpendingService.searchAwards()` — `page` is now optional**, with new `last_record_sort_value?` / `last_record_unique_id?` params; page and cursor are mutually exclusive on the outgoing request. ([#37](https://github.com/cyanheads/usaspending-mcp-server/issues/37))
24
+
25
+ ## Fixed
26
+
27
+ - **Crash on the last page of any `usaspending_search_awards` call** — the upstream's terminal-page sentinels (`last_record_unique_id: null`, `last_record_sort_value: "None"`) passed a bare `!== undefined` check and failed the `z.number()` output schema, crashing routine searches — including zero-result ones — once they reached their last page. The cursor pair is now omitted unless `has_next` is true and both values are genuinely usable. ([#39](https://github.com/cyanheads/usaspending-mcp-server/issues/39))
@@ -15,9 +15,11 @@ summary: ""
15
15
  # usage. Flagged as `Breaking` in the rollup.
16
16
  breaking: false
17
17
 
18
- # Set `true` if this release contains any security fix. Pairs with the
19
- # `## Security` section below. Flagged as `Security` in the rollup so
20
- # users can triage upgrade urgency at a glance.
18
+ # Set `true` ONLY for a security fix in THIS project's own source code — a
19
+ # vulnerability or hardening in code you ship. A dependency or transitive CVE
20
+ # bump is routine maintenance, NOT a security release: record it under
21
+ # `## Dependencies` (with the advisory ID) and leave this `false`. When true,
22
+ # pairs with the `## Security` section below and flags `Security` in the rollup.
21
23
  security: false
22
24
 
23
25
  # Optional free-form notes for maintenance agents processing this release.
@@ -56,6 +56,8 @@ export declare const disasterSpendingTool: import("@cyanheads/mcp-ts-core").Tool
56
56
  shape_code: z.ZodOptional<z.ZodString>;
57
57
  display_name: z.ZodOptional<z.ZodString>;
58
58
  aggregated_amount: z.ZodOptional<z.ZodNumber>;
59
+ population: z.ZodOptional<z.ZodNumber>;
60
+ per_capita: z.ZodOptional<z.ZodNumber>;
59
61
  }, z.core.$strip>>;
60
62
  page_metadata: z.ZodOptional<z.ZodObject<{
61
63
  has_next: z.ZodBoolean;
@@ -64,11 +66,6 @@ export declare const disasterSpendingTool: import("@cyanheads/mcp-ts-core").Tool
64
66
  limit: z.ZodNumber;
65
67
  }, z.core.$strip>>;
66
68
  }, z.core.$strip>, readonly [{
67
- readonly reason: "no_data";
68
- readonly code: JsonRpcErrorCode.NotFound;
69
- readonly when: "No disaster spending data found for the specified filters.";
70
- readonly recovery: "Remove DEF code filters to include all emergency funds, or try a different dimension.";
71
- }, {
72
69
  readonly reason: "api_unavailable";
73
70
  readonly code: JsonRpcErrorCode.ServiceUnavailable;
74
71
  readonly when: "USAspending.gov API is unreachable or returns an error.";
@@ -1 +1 @@
1
- {"version":3,"file":"disaster-spending.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/disaster-spending.tool.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAmB,MAAM,+BAA+B,CAAC;AAIlF,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAkX/B,CAAC"}
1
+ {"version":3,"file":"disaster-spending.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/disaster-spending.tool.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAmB,MAAM,+BAA+B,CAAC;AAIlF,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAmY/B,CAAC"}
@@ -17,7 +17,7 @@ export const disasterSpendingTool = tool('usaspending_disaster_spending', {
17
17
  spending_type: z
18
18
  .enum(['award', 'total'])
19
19
  .default('award')
20
- .describe('Data type: award (award-level obligations and outlays) or total (includes direct non-award spending). Applies to agency and recipient dimensions only.'),
20
+ .describe('Data type for the agency and recipient dimensions: award (award-level obligations and outlays) or total (includes direct non-award spending). Ignored for cfda and overview; the geography dimension is not user-controllable and always reports obligation-based amounts.'),
21
21
  filters: z
22
22
  .object({
23
23
  def_codes: z
@@ -38,7 +38,7 @@ export const disasterSpendingTool = tool('usaspending_disaster_spending', {
38
38
  .min(1)
39
39
  .max(100)
40
40
  .default(10)
41
- .describe('Maximum results per page (1–100, not used for overview dimension)'),
41
+ .describe('Maximum results per page (1–100). Applies to the agency, cfda, and recipient dimensions; ignored for overview and geography, which are not paginated.'),
42
42
  page: z.number().int().min(1).default(1).describe('Page number (1-based)'),
43
43
  }),
44
44
  // Agent-facing context: the dimension applied and pagination for non-overview dimensions.
@@ -53,7 +53,9 @@ export const disasterSpendingTool = tool('usaspending_disaster_spending', {
53
53
  },
54
54
  output: z.object({
55
55
  dimension: z.string().describe('Breakdown dimension returned'),
56
- spending_type: z.string().describe('Data type returned (award or total)'),
56
+ spending_type: z
57
+ .string()
58
+ .describe('Data type returned — award/total for agency, cfda, and recipient; obligation for geography; spending for overview'),
57
59
  overview: z
58
60
  .object({
59
61
  total_budget_authority: z
@@ -101,7 +103,15 @@ export const disasterSpendingTool = tool('usaspending_disaster_spending', {
101
103
  aggregated_amount: z
102
104
  .number()
103
105
  .optional()
104
- .describe('Aggregated amount in USD (geography dimension)'),
106
+ .describe('Obligation-based spending amount in USD (geography dimension)'),
107
+ population: z
108
+ .number()
109
+ .optional()
110
+ .describe('Population of the geographic area (geography dimension)'),
111
+ per_capita: z
112
+ .number()
113
+ .optional()
114
+ .describe('Obligation-based spending per capita in USD (geography dimension)'),
105
115
  })
106
116
  .describe('Disaster spending breakdown entry by dimension (agency, CFDA, recipient, or geography)'))
107
117
  .describe('Breakdown results (empty for overview dimension)'),
@@ -116,12 +126,6 @@ export const disasterSpendingTool = tool('usaspending_disaster_spending', {
116
126
  .describe('Pagination metadata (non-overview dimensions)'),
117
127
  }),
118
128
  errors: [
119
- {
120
- reason: 'no_data',
121
- code: JsonRpcErrorCode.NotFound,
122
- when: 'No disaster spending data found for the specified filters.',
123
- recovery: 'Remove DEF code filters to include all emergency funds, or try a different dimension.',
124
- },
125
129
  {
126
130
  reason: 'api_unavailable',
127
131
  code: JsonRpcErrorCode.ServiceUnavailable,
@@ -190,7 +194,9 @@ export const disasterSpendingTool = tool('usaspending_disaster_spending', {
190
194
  results: [],
191
195
  };
192
196
  }
193
- const paginationBody = { ...baseBody, limit: input.limit, page: input.page };
197
+ // Disaster breakdown endpoints require pagination nested under a `pagination` key;
198
+ // top-level limit/page are silently ignored (upstream always returns its default page).
199
+ const paginationBody = { ...baseBody, pagination: { page: input.page, limit: input.limit } };
194
200
  let rawResults;
195
201
  if (input.dimension === 'agency') {
196
202
  const data = await svc.getDisasterByAgency(input.spending_type, paginationBody, ctx);
@@ -205,19 +211,26 @@ export const disasterSpendingTool = tool('usaspending_disaster_spending', {
205
211
  rawResults = { results: data.results ?? [], page_metadata: data.page_metadata ?? {} };
206
212
  }
207
213
  else {
208
- // geography
214
+ // geography — this endpoint requires a spending_type from a vocabulary distinct from
215
+ // the breakdown dimensions (obligation | outlay | face_value_of_loan); omitting it
216
+ // returns HTTP 422. It reports totals across the whole result set in a single page
217
+ // (no pagination). Default to obligation — total obligated dollars, the comparable
218
+ // default measure — and report that as the effective spending_type.
219
+ const geoSpendingType = 'obligation';
209
220
  const geoBody = {
210
221
  ...baseBody,
211
222
  geo_layer: input.filters?.geo_layer ?? 'state',
212
223
  scope: 'place_of_performance',
224
+ spending_type: geoSpendingType,
213
225
  };
214
226
  const data = await svc.getDisasterByGeography(geoBody, ctx);
215
227
  const geoResults = (data.results ?? []).map((r) => ({
216
- shape_code: r.shape_code ?? undefined,
217
- display_name: r.display_name ?? undefined,
218
- aggregated_amount: typeof r.aggregated_amount === 'number' ? r.aggregated_amount : undefined,
219
- population: typeof r.population === 'number' ? r.population : undefined,
220
- per_capita: typeof r.per_capita === 'number' ? r.per_capita : undefined,
228
+ ...(r.shape_code ? { shape_code: r.shape_code } : {}),
229
+ ...(r.display_name ? { display_name: r.display_name } : {}),
230
+ ...(typeof r.amount === 'number' ? { aggregated_amount: r.amount } : {}),
231
+ ...(typeof r.award_count === 'number' ? { award_count: r.award_count } : {}),
232
+ ...(typeof r.population === 'number' ? { population: r.population } : {}),
233
+ ...(typeof r.per_capita === 'number' ? { per_capita: r.per_capita } : {}),
221
234
  }));
222
235
  ctx.enrich.total(geoResults.length);
223
236
  ctx.enrich({
@@ -227,13 +240,13 @@ export const disasterSpendingTool = tool('usaspending_disaster_spending', {
227
240
  });
228
241
  return {
229
242
  dimension: 'geography',
230
- spending_type: input.spending_type,
243
+ spending_type: geoSpendingType,
231
244
  results: geoResults,
232
245
  page_metadata: {
233
246
  has_next: false,
234
247
  page: 1,
235
248
  total: geoResults.length,
236
- limit: input.limit,
249
+ limit: geoResults.length,
237
250
  },
238
251
  };
239
252
  }
@@ -304,13 +317,13 @@ export const disasterSpendingTool = tool('usaspending_disaster_spending', {
304
317
  }
305
318
  if (result.results.length === 0) {
306
319
  if (!result.overview) {
307
- lines.push('\n> No data found. Try removing DEF code filters or selecting a different dimension.');
320
+ lines.push('\n> No data found for the specified DEF codes and dimension. Try different DEF codes or another breakdown dimension — def_codes is required for all non-overview dimensions and cannot be removed.');
308
321
  }
309
322
  }
310
323
  else {
311
324
  lines.push('');
312
- lines.push('| Name/Display | ID | Code | Shape | Obligation | Outlay | Aggregated | Loans | Awards |');
313
- lines.push('|:-------------|:---|:-----|:------|:-----------|:-------|:-----------|:------|:-------|');
325
+ lines.push('| Name/Display | ID | Code | Shape | Obligation | Outlay | Aggregated | Population | Per Capita | Loans | Awards |');
326
+ lines.push('|:-------------|:---|:-----|:------|:-----------|:-------|:-----------|:-----------|:-----------|:------|:-------|');
314
327
  for (const r of result.results) {
315
328
  const label = r.display_name && r.name && r.display_name !== r.name
316
329
  ? `${r.display_name} (${r.name})`
@@ -321,9 +334,11 @@ export const disasterSpendingTool = tool('usaspending_disaster_spending', {
321
334
  const oblig = r.obligation !== undefined ? `$${r.obligation.toLocaleString()}` : 'N/A';
322
335
  const outlay = r.outlay !== undefined ? `$${r.outlay.toLocaleString()}` : 'N/A';
323
336
  const agg = r.aggregated_amount !== undefined ? `$${r.aggregated_amount.toLocaleString()}` : 'N/A';
337
+ const population = r.population !== undefined ? r.population.toLocaleString() : 'N/A';
338
+ const perCapita = r.per_capita !== undefined ? `$${r.per_capita.toLocaleString()}` : 'N/A';
324
339
  const loans = r.face_value_of_loan !== undefined ? `$${r.face_value_of_loan.toLocaleString()}` : 'N/A';
325
340
  const awards = r.award_count !== undefined ? String(r.award_count) : 'N/A';
326
- lines.push(`| ${label} | ${id} | ${code} | ${shape} | ${oblig} | ${outlay} | ${agg} | ${loans} | ${awards} |`);
341
+ lines.push(`| ${label} | ${id} | ${code} | ${shape} | ${oblig} | ${outlay} | ${agg} | ${population} | ${perCapita} | ${loans} | ${awards} |`);
327
342
  }
328
343
  }
329
344
  return [{ type: 'text', text: lines.join('\n') }];
@@ -1 +1 @@
1
- {"version":3,"file":"disaster-spending.tool.js","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/disaster-spending.tool.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAElF,OAAO,EAAE,qBAAqB,EAAE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AAC,UAAU,KAAK,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,UAAU,CAAC,cAAc,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC;gBACvF,MAAM,MAAM,GAAG,CAAC,CAAC,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,cAAc,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC;gBAChF,MAAM,GAAG,GACP,CAAC,CAAC,iBAAiB,KAAK,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,iBAAiB,CAAC,cAAc,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC;gBACzF,MAAM,KAAK,GACT,CAAC,CAAC,kBAAkB,KAAK,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,kBAAkB,CAAC,cAAc,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC;gBAC3F,MAAM,MAAM,GAAG,CAAC,CAAC,WAAW,KAAK,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC;gBAC3E,KAAK,CAAC,IAAI,CACR,KAAK,KAAK,MAAM,EAAE,MAAM,IAAI,MAAM,KAAK,MAAM,KAAK,MAAM,MAAM,MAAM,GAAG,MAAM,KAAK,MAAM,MAAM,IAAI,CACnG,CAAC;YACJ,CAAC;QACH,CAAC;QAED,OAAO,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACpD,CAAC;CACF,CAAC,CAAC"}
1
+ {"version":3,"file":"disaster-spending.tool.js","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/disaster-spending.tool.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,O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AAE,CAAC,CAAC,CAAC,KAAK,CAAC;gBACtF,MAAM,SAAS,GAAG,CAAC,CAAC,UAAU,KAAK,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,UAAU,CAAC,cAAc,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC;gBAC3F,MAAM,KAAK,GACT,CAAC,CAAC,kBAAkB,KAAK,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,kBAAkB,CAAC,cAAc,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC;gBAC3F,MAAM,MAAM,GAAG,CAAC,CAAC,WAAW,KAAK,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC;gBAC3E,KAAK,CAAC,IAAI,CACR,KAAK,KAAK,MAAM,EAAE,MAAM,IAAI,MAAM,KAAK,MAAM,KAAK,MAAM,MAAM,MAAM,GAAG,MAAM,UAAU,MAAM,SAAS,MAAM,KAAK,MAAM,MAAM,IAAI,CAClI,CAAC;YACJ,CAAC;QACH,CAAC;QAED,OAAO,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACpD,CAAC;CACF,CAAC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"get-agency.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/get-agency.tool.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAIjE,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cA+OxB,CAAC"}
1
+ {"version":3,"file":"get-agency.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/get-agency.tool.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAIjE,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAsPxB,CAAC"}
@@ -110,6 +110,13 @@ export const getAgencyTool = tool('usaspending_get_agency', {
110
110
  toptierCode = match.toptier_code;
111
111
  }
112
112
  ctx.log.info('usaspending_get_agency', { toptier_code: toptierCode });
113
+ if (!toptierCode) {
114
+ throw ctx.fail('missing_input', 'Either toptier_code or agency_slug is required', {
115
+ recovery: {
116
+ hint: 'Call usaspending_list_agencies to find the correct toptier_code or agency_slug.',
117
+ },
118
+ });
119
+ }
113
120
  const [detail, subAgenciesData] = await Promise.all([
114
121
  svc.getAgency(toptierCode, ctx),
115
122
  svc.getAgencySubAgencies(toptierCode, ctx).catch(() => ({