@cyanheads/usaspending-mcp-server 0.7.0 → 0.7.2

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 (112) hide show
  1. package/AGENTS.md +8 -5
  2. package/CLAUDE.md +8 -5
  3. package/README.md +48 -27
  4. package/changelog/0.7.x/0.7.1.md +26 -0
  5. package/changelog/0.7.x/0.7.2.md +33 -0
  6. package/changelog/template.md +10 -3
  7. package/dist/config/server-config.d.ts +13 -0
  8. package/dist/config/server-config.d.ts.map +1 -1
  9. package/dist/config/server-config.js +24 -0
  10. package/dist/config/server-config.js.map +1 -1
  11. package/dist/index.js +2 -2
  12. package/dist/index.js.map +1 -1
  13. package/dist/mcp-server/tools/definitions/autocomplete-filters.tool.d.ts +14 -2
  14. package/dist/mcp-server/tools/definitions/autocomplete-filters.tool.d.ts.map +1 -1
  15. package/dist/mcp-server/tools/definitions/autocomplete-filters.tool.js +136 -40
  16. package/dist/mcp-server/tools/definitions/autocomplete-filters.tool.js.map +1 -1
  17. package/dist/mcp-server/tools/definitions/count-limit.d.ts +69 -0
  18. package/dist/mcp-server/tools/definitions/count-limit.d.ts.map +1 -0
  19. package/dist/mcp-server/tools/definitions/count-limit.js +87 -0
  20. package/dist/mcp-server/tools/definitions/count-limit.js.map +1 -0
  21. package/dist/mcp-server/tools/definitions/disaster-spending.tool.d.ts +16 -1
  22. package/dist/mcp-server/tools/definitions/disaster-spending.tool.d.ts.map +1 -1
  23. package/dist/mcp-server/tools/definitions/disaster-spending.tool.js +107 -37
  24. package/dist/mcp-server/tools/definitions/disaster-spending.tool.js.map +1 -1
  25. package/dist/mcp-server/tools/definitions/filters.d.ts +63 -1
  26. package/dist/mcp-server/tools/definitions/filters.d.ts.map +1 -1
  27. package/dist/mcp-server/tools/definitions/filters.js +116 -1
  28. package/dist/mcp-server/tools/definitions/filters.js.map +1 -1
  29. package/dist/mcp-server/tools/definitions/get-agency.tool.d.ts +7 -0
  30. package/dist/mcp-server/tools/definitions/get-agency.tool.d.ts.map +1 -1
  31. package/dist/mcp-server/tools/definitions/get-agency.tool.js +94 -50
  32. package/dist/mcp-server/tools/definitions/get-agency.tool.js.map +1 -1
  33. package/dist/mcp-server/tools/definitions/get-award-federal-accounts.tool.d.ts +5 -0
  34. package/dist/mcp-server/tools/definitions/get-award-federal-accounts.tool.d.ts.map +1 -1
  35. package/dist/mcp-server/tools/definitions/get-award-federal-accounts.tool.js +15 -12
  36. package/dist/mcp-server/tools/definitions/get-award-federal-accounts.tool.js.map +1 -1
  37. package/dist/mcp-server/tools/definitions/get-award-subawards.tool.d.ts +5 -0
  38. package/dist/mcp-server/tools/definitions/get-award-subawards.tool.d.ts.map +1 -1
  39. package/dist/mcp-server/tools/definitions/get-award-subawards.tool.js +14 -11
  40. package/dist/mcp-server/tools/definitions/get-award-subawards.tool.js.map +1 -1
  41. package/dist/mcp-server/tools/definitions/get-award-transactions.tool.d.ts +5 -0
  42. package/dist/mcp-server/tools/definitions/get-award-transactions.tool.d.ts.map +1 -1
  43. package/dist/mcp-server/tools/definitions/get-award-transactions.tool.js +17 -11
  44. package/dist/mcp-server/tools/definitions/get-award-transactions.tool.js.map +1 -1
  45. package/dist/mcp-server/tools/definitions/get-award.tool.d.ts +30 -0
  46. package/dist/mcp-server/tools/definitions/get-award.tool.d.ts.map +1 -1
  47. package/dist/mcp-server/tools/definitions/get-award.tool.js +110 -2
  48. package/dist/mcp-server/tools/definitions/get-award.tool.js.map +1 -1
  49. package/dist/mcp-server/tools/definitions/get-federal-account-breakdown.tool.d.ts +5 -0
  50. package/dist/mcp-server/tools/definitions/get-federal-account-breakdown.tool.d.ts.map +1 -1
  51. package/dist/mcp-server/tools/definitions/get-federal-account-breakdown.tool.js +18 -11
  52. package/dist/mcp-server/tools/definitions/get-federal-account-breakdown.tool.js.map +1 -1
  53. package/dist/mcp-server/tools/definitions/get-idv-awards.tool.d.ts +16 -1
  54. package/dist/mcp-server/tools/definitions/get-idv-awards.tool.d.ts.map +1 -1
  55. package/dist/mcp-server/tools/definitions/get-idv-awards.tool.js +29 -19
  56. package/dist/mcp-server/tools/definitions/get-idv-awards.tool.js.map +1 -1
  57. package/dist/mcp-server/tools/definitions/get-recipient.tool.d.ts +40 -1
  58. package/dist/mcp-server/tools/definitions/get-recipient.tool.d.ts.map +1 -1
  59. package/dist/mcp-server/tools/definitions/get-recipient.tool.js +185 -5
  60. package/dist/mcp-server/tools/definitions/get-recipient.tool.js.map +1 -1
  61. package/dist/mcp-server/tools/definitions/index.d.ts +327 -6
  62. package/dist/mcp-server/tools/definitions/index.d.ts.map +1 -1
  63. package/dist/mcp-server/tools/definitions/list-agencies.tool.d.ts.map +1 -1
  64. package/dist/mcp-server/tools/definitions/list-agencies.tool.js +3 -5
  65. package/dist/mcp-server/tools/definitions/list-agencies.tool.js.map +1 -1
  66. package/dist/mcp-server/tools/definitions/locations.d.ts +20 -9
  67. package/dist/mcp-server/tools/definitions/locations.d.ts.map +1 -1
  68. package/dist/mcp-server/tools/definitions/locations.js +106 -84
  69. package/dist/mcp-server/tools/definitions/locations.js.map +1 -1
  70. package/dist/mcp-server/tools/definitions/pagination.d.ts +9 -8
  71. package/dist/mcp-server/tools/definitions/pagination.d.ts.map +1 -1
  72. package/dist/mcp-server/tools/definitions/pagination.js +9 -8
  73. package/dist/mcp-server/tools/definitions/pagination.js.map +1 -1
  74. package/dist/mcp-server/tools/definitions/search-awards.tool.d.ts +50 -3
  75. package/dist/mcp-server/tools/definitions/search-awards.tool.d.ts.map +1 -1
  76. package/dist/mcp-server/tools/definitions/search-awards.tool.js +199 -70
  77. package/dist/mcp-server/tools/definitions/search-awards.tool.js.map +1 -1
  78. package/dist/mcp-server/tools/definitions/search-federal-accounts.tool.d.ts +5 -0
  79. package/dist/mcp-server/tools/definitions/search-federal-accounts.tool.d.ts.map +1 -1
  80. package/dist/mcp-server/tools/definitions/search-federal-accounts.tool.js +18 -16
  81. package/dist/mcp-server/tools/definitions/search-federal-accounts.tool.js.map +1 -1
  82. package/dist/mcp-server/tools/definitions/search-recipients.tool.d.ts +5 -0
  83. package/dist/mcp-server/tools/definitions/search-recipients.tool.d.ts.map +1 -1
  84. package/dist/mcp-server/tools/definitions/search-recipients.tool.js +13 -13
  85. package/dist/mcp-server/tools/definitions/search-recipients.tool.js.map +1 -1
  86. package/dist/mcp-server/tools/definitions/spending-by-category.tool.d.ts +47 -0
  87. package/dist/mcp-server/tools/definitions/spending-by-category.tool.d.ts.map +1 -1
  88. package/dist/mcp-server/tools/definitions/spending-by-category.tool.js +124 -33
  89. package/dist/mcp-server/tools/definitions/spending-by-category.tool.js.map +1 -1
  90. package/dist/mcp-server/tools/definitions/spending-by-geography.tool.d.ts +39 -0
  91. package/dist/mcp-server/tools/definitions/spending-by-geography.tool.d.ts.map +1 -1
  92. package/dist/mcp-server/tools/definitions/spending-by-geography.tool.js +74 -17
  93. package/dist/mcp-server/tools/definitions/spending-by-geography.tool.js.map +1 -1
  94. package/dist/mcp-server/tools/definitions/spending-over-time.tool.d.ts +41 -0
  95. package/dist/mcp-server/tools/definitions/spending-over-time.tool.d.ts.map +1 -1
  96. package/dist/mcp-server/tools/definitions/spending-over-time.tool.js +87 -11
  97. package/dist/mcp-server/tools/definitions/spending-over-time.tool.js.map +1 -1
  98. package/dist/mcp-server/tools/definitions/unavailable-sections.d.ts +42 -0
  99. package/dist/mcp-server/tools/definitions/unavailable-sections.d.ts.map +1 -0
  100. package/dist/mcp-server/tools/definitions/unavailable-sections.js +63 -0
  101. package/dist/mcp-server/tools/definitions/unavailable-sections.js.map +1 -0
  102. package/dist/services/usaspending/types.d.ts +102 -5
  103. package/dist/services/usaspending/types.d.ts.map +1 -1
  104. package/dist/services/usaspending/types.js +5 -1
  105. package/dist/services/usaspending/types.js.map +1 -1
  106. package/dist/services/usaspending/usaspending-service.d.ts +73 -6
  107. package/dist/services/usaspending/usaspending-service.d.ts.map +1 -1
  108. package/dist/services/usaspending/usaspending-service.js +206 -20
  109. package/dist/services/usaspending/usaspending-service.js.map +1 -1
  110. package/package.json +7 -7
  111. package/server.json +3 -3
  112. package/skills/usaspending-guide/SKILL.md +9 -5
package/AGENTS.md CHANGED
@@ -1,9 +1,9 @@
1
1
  # Developer Protocol
2
2
 
3
3
  **Server:** usaspending-mcp-server
4
- **Version:** 0.7.0
5
- **Framework:** [@cyanheads/mcp-ts-core](https://www.npmjs.com/package/@cyanheads/mcp-ts-core) `^0.13.18`
6
- **Engines:** Bun ≥1.4.0, Node ≥24.0.0
4
+ **Version:** 0.7.2
5
+ **Framework:** [@cyanheads/mcp-ts-core](https://www.npmjs.com/package/@cyanheads/mcp-ts-core) `^0.13.22`
6
+ **Engines:** Bun ≥1.4.4, Node ≥24.0.0
7
7
  **MCP SDK:** `@modelcontextprotocol/server` ^2.4.0
8
8
  **Zod:** ^4.6.7
9
9
 
@@ -348,7 +348,7 @@ When you complete a skill's checklist, check the boxes and add a completion time
348
348
  | `bun run audit:fix` | `bun audit fix` — upgrade vulnerable packages to the lowest safe version within existing ranges (`--dry-run` previews, `--latest` rewrites ranges). First response when `devcheck` flags a transitive advisory; then `bun update <name>`, then `bun dedupe` |
349
349
  | `bun run audit:refresh` | Delete `bun.lock` and reinstall. Last resort after `audit:fix`, `bun update <name>`, and `bun dedupe` — re-resolves every ranged dep (the framework pin included) and rewrites the lockfile as `lockfileVersion: 2` |
350
350
  | `bun run lint:mcp` | Run the MCP definition linter standalone (rule catalog: `api-linter` skill) |
351
- | `bun run lint:packaging` | Packaging surface checks — `server.json`/`manifest.json` env-var parity (run by devcheck) |
351
+ | `bun run lint:packaging` | Packaging surface checks — `server.json`/`manifest.json` env-var parity, `.mcpbignore` coverage, plugin manifests, the published `skills/` tree (run by devcheck) |
352
352
  | `bun run list-skills` | Print the skill registry |
353
353
  | `bun run tree` | Generate directory structure doc |
354
354
  | `bun run format` | Auto-fix formatting (safe fixes only) |
@@ -366,7 +366,7 @@ When you complete a skill's checklist, check the boxes and add a completion time
366
366
 
367
367
  ## Bundling
368
368
 
369
- `bun run bundle` produces a `.mcpb` extension bundle for one-click install in Claude Desktop. `mcpb pack` reads `.mcpbignore`, not `.gitignore`, so every root path the bundle must not ship — source, tests, docs, caches, logs, agent docs, plugin manifests, gitignored local files — needs a root-anchored line there (`/docs/`, never `docs/`, which also strips `node_modules/*/docs/`); `lint:packaging` names each missing or unanchored line. Root `skills/` ships on purpose. The pack step is followed by `scripts/clean-mcpb.ts`, which prunes dev dependencies (`mcpb clean`) and strips four classes of `node_modules/**` content that root-anchored `.mcpbignore` patterns cannot reach: dependency-shipped agent docs (`framework-skills/`, `skills/`, `.claude/`, `.agents/`, `SKILL.md`); platform-specific native bindings, which would otherwise lock the bundle to the platform it was packed on; node-gyp build output beside a `binding.gyp` (`config.gypi`, Makefiles, `obj.target/`, `.deps/`, object files and debug symbols), which records the packing machine's paths — compiled `*.node` addons stay; and build-only package files — the framework's `changelog/`, `scripts/`, `templates/`, `CLAUDE.md`, `AGENTS.md`, and config bases (`biome.json`, `vitest.config.base.mjs`, `config/tsconfig.base.json`), and `better-sqlite3`'s `deps/` and `src/` C sources. A server using DataCanvas therefore ships a portable bundle without the DuckDB native — `@duckdb/node-api` is an optional peer loaded lazily, so canvas tools report an actionable install hint and every other tool works normally. MCPB is stdio-only — HTTP and Cloudflare Workers deployments are unaffected. Consumers who don't need it can delete `manifest.json` and `.mcpbignore`; `lint:packaging` skips cleanly.
369
+ `bun run bundle` produces a `.mcpb` extension bundle for one-click install in Claude Desktop. `mcpb pack` reads `.mcpbignore`, not `.gitignore`, so every root path the bundle must not ship — source, tests, docs, caches, logs, agent docs, plugin manifests, gitignored local files — needs a root-anchored line there (`/docs/`, never `docs/`, which also strips `node_modules/*/docs/`); `lint:packaging` names each missing or unanchored line. Root `skills/` ships on purpose. The pack step is followed by `scripts/clean-mcpb.ts`, which prunes dev dependencies (`mcpb clean`) and strips four classes of `node_modules/**` content that root-anchored `.mcpbignore` patterns cannot reach: dependency-shipped agent docs — `framework-skills/`, `skills/`, `.claude/`, `.agents/`, `AGENTS.md`, and `CLAUDE.md` at a package's root, and `SKILL.md` anywhere (a `skills/` deeper in a package is runtime code and stays); platform-specific native bindings, which would otherwise lock the bundle to the platform it was packed on; node-gyp build output beside a `binding.gyp` (`config.gypi`, Makefiles, `obj.target/`, `.deps/`, object files and debug symbols), which records the packing machine's paths — compiled `*.node` addons stay; and build-only package files — the framework's `changelog/`, `scripts/`, `templates/`, and config bases (`biome.json`, `vitest.config.base.mjs`, `config/tsconfig.base.json`), and `better-sqlite3`'s `deps/` and `src/` C sources. A server using DataCanvas therefore ships a portable bundle without the DuckDB native — `@duckdb/node-api` is an optional peer loaded lazily, so canvas tools report an actionable install hint and every other tool works normally. MCPB is stdio-only — HTTP and Cloudflare Workers deployments are unaffected. Consumers who don't need it can delete `manifest.json` and `.mcpbignore`; `lint:packaging` skips cleanly.
370
370
 
371
371
  **Adding an env var requires both files:** `server.json` (registry discovery, `environmentVariables[]`) and `manifest.json` (bundle install UX, `mcp_config.env` + `user_config`). `lint:packaging` (run by `devcheck`) verifies the env var names match, that every `user_config` option is wired into `mcp_config.env` as `"X": "${user_config.X}"` (the host substitutes nothing else — `"${X}"` reaches the server as that literal string), and that an optional string option carries `"default": ""`.
372
372
 
@@ -433,7 +433,10 @@ import { getMyService } from '@/services/my-domain/my-service.js';
433
433
  - [ ] If wrapping external API: tests include at least one sparse payload case with omitted upstream fields
434
434
  - [ ] Registered in `createApp()` arrays (directly or via barrel exports)
435
435
  - [ ] Tests use `createMockContext()` from `@cyanheads/mcp-ts-core/testing`
436
+ - [ ] `plugin.json` + `mcp.json` (Agent Plugins 1.0.0 — read by Codex, Cursor, GitHub Copilot, VS Code, Kiro) populated — `plugin.json` `name` = the unscoped repo name (lowercase `a-z`, `0-9`, `-`, `.` only); `version`, `description`, `author`, `homepage`, `repository`, `license`, `keywords` from `package.json`; no other top-level field, `extensions` included. `mcp.json` holds one `"type": "stdio"` entry keyed by the unscoped name, `npx -y <full package name>`, and the same fixed `env` as `.codex-plugin/mcp.json`. Neither file carries a user-supplied variable (no `""`, no `${…}` besides `${PLUGIN_ROOT}`/`${PLUGIN_DATA}`): keys reach Codex through `.codex-plugin/mcp.json` `env_vars`, which works only while `.codex-plugin/plugin.json` keeps `"mcpServers": "./.codex-plugin/mcp.json"`
436
437
  - [ ] `.codex-plugin/plugin.json` populated — `name`, `version`, `description`, `repository`, `license` from `package.json`; `interface.displayName` = the unscoped repo name (never the npm scope — `lint:packaging` enforces this); `interface.shortDescription` from `package.json` description
437
438
  - [ ] `.codex-plugin/mcp.json` updated — server name key is the unscoped repo name; every user-supplied variable (API key, contact email, instance URL) is listed in `env_vars` so Codex forwards it from the user's environment. Never write `"KEY": ""` into `env` — an empty value replaces the user's exported key and is read as unset
438
439
  - [ ] `.claude-plugin/plugin.json` populated — `name`, `version`, `description`, `author`, `repository`, `license`, `keywords` from `package.json`; inline `mcpServers` entry keyed by the unscoped repo name. Every user-supplied variable is declared under `userConfig` (`type`, `title`, `description`; `sensitive: true` for keys and tokens; `required: true` or `default: ""`) and referenced from `env` as `"KEY": "${user_config.<option>}"` — mirror the `user_config` block in `manifest.json`. Never write `"KEY": ""` into `env`
440
+ - [ ] Any new root dev path has a root-anchored line in `.mcpbignore`; `bun run bundle` and `lint:packaging` pass
441
+ - [ ] If the server publishes a skill in root `skills/`: `lint:packaging` passes, and `field-test` verified every gate and identifier claim in it against live tool behavior
439
442
  - [ ] `npm run devcheck` passes
package/CLAUDE.md CHANGED
@@ -1,9 +1,9 @@
1
1
  # Developer Protocol
2
2
 
3
3
  **Server:** usaspending-mcp-server
4
- **Version:** 0.7.0
5
- **Framework:** [@cyanheads/mcp-ts-core](https://www.npmjs.com/package/@cyanheads/mcp-ts-core) `^0.13.18`
6
- **Engines:** Bun ≥1.4.0, Node ≥24.0.0
4
+ **Version:** 0.7.2
5
+ **Framework:** [@cyanheads/mcp-ts-core](https://www.npmjs.com/package/@cyanheads/mcp-ts-core) `^0.13.22`
6
+ **Engines:** Bun ≥1.4.4, Node ≥24.0.0
7
7
  **MCP SDK:** `@modelcontextprotocol/server` ^2.4.0
8
8
  **Zod:** ^4.6.7
9
9
 
@@ -348,7 +348,7 @@ When you complete a skill's checklist, check the boxes and add a completion time
348
348
  | `bun run audit:fix` | `bun audit fix` — upgrade vulnerable packages to the lowest safe version within existing ranges (`--dry-run` previews, `--latest` rewrites ranges). First response when `devcheck` flags a transitive advisory; then `bun update <name>`, then `bun dedupe` |
349
349
  | `bun run audit:refresh` | Delete `bun.lock` and reinstall. Last resort after `audit:fix`, `bun update <name>`, and `bun dedupe` — re-resolves every ranged dep (the framework pin included) and rewrites the lockfile as `lockfileVersion: 2` |
350
350
  | `bun run lint:mcp` | Run the MCP definition linter standalone (rule catalog: `api-linter` skill) |
351
- | `bun run lint:packaging` | Packaging surface checks — `server.json`/`manifest.json` env-var parity (run by devcheck) |
351
+ | `bun run lint:packaging` | Packaging surface checks — `server.json`/`manifest.json` env-var parity, `.mcpbignore` coverage, plugin manifests, the published `skills/` tree (run by devcheck) |
352
352
  | `bun run list-skills` | Print the skill registry |
353
353
  | `bun run tree` | Generate directory structure doc |
354
354
  | `bun run format` | Auto-fix formatting (safe fixes only) |
@@ -366,7 +366,7 @@ When you complete a skill's checklist, check the boxes and add a completion time
366
366
 
367
367
  ## Bundling
368
368
 
369
- `bun run bundle` produces a `.mcpb` extension bundle for one-click install in Claude Desktop. `mcpb pack` reads `.mcpbignore`, not `.gitignore`, so every root path the bundle must not ship — source, tests, docs, caches, logs, agent docs, plugin manifests, gitignored local files — needs a root-anchored line there (`/docs/`, never `docs/`, which also strips `node_modules/*/docs/`); `lint:packaging` names each missing or unanchored line. Root `skills/` ships on purpose. The pack step is followed by `scripts/clean-mcpb.ts`, which prunes dev dependencies (`mcpb clean`) and strips four classes of `node_modules/**` content that root-anchored `.mcpbignore` patterns cannot reach: dependency-shipped agent docs (`framework-skills/`, `skills/`, `.claude/`, `.agents/`, `SKILL.md`); platform-specific native bindings, which would otherwise lock the bundle to the platform it was packed on; node-gyp build output beside a `binding.gyp` (`config.gypi`, Makefiles, `obj.target/`, `.deps/`, object files and debug symbols), which records the packing machine's paths — compiled `*.node` addons stay; and build-only package files — the framework's `changelog/`, `scripts/`, `templates/`, `CLAUDE.md`, `AGENTS.md`, and config bases (`biome.json`, `vitest.config.base.mjs`, `config/tsconfig.base.json`), and `better-sqlite3`'s `deps/` and `src/` C sources. A server using DataCanvas therefore ships a portable bundle without the DuckDB native — `@duckdb/node-api` is an optional peer loaded lazily, so canvas tools report an actionable install hint and every other tool works normally. MCPB is stdio-only — HTTP and Cloudflare Workers deployments are unaffected. Consumers who don't need it can delete `manifest.json` and `.mcpbignore`; `lint:packaging` skips cleanly.
369
+ `bun run bundle` produces a `.mcpb` extension bundle for one-click install in Claude Desktop. `mcpb pack` reads `.mcpbignore`, not `.gitignore`, so every root path the bundle must not ship — source, tests, docs, caches, logs, agent docs, plugin manifests, gitignored local files — needs a root-anchored line there (`/docs/`, never `docs/`, which also strips `node_modules/*/docs/`); `lint:packaging` names each missing or unanchored line. Root `skills/` ships on purpose. The pack step is followed by `scripts/clean-mcpb.ts`, which prunes dev dependencies (`mcpb clean`) and strips four classes of `node_modules/**` content that root-anchored `.mcpbignore` patterns cannot reach: dependency-shipped agent docs — `framework-skills/`, `skills/`, `.claude/`, `.agents/`, `AGENTS.md`, and `CLAUDE.md` at a package's root, and `SKILL.md` anywhere (a `skills/` deeper in a package is runtime code and stays); platform-specific native bindings, which would otherwise lock the bundle to the platform it was packed on; node-gyp build output beside a `binding.gyp` (`config.gypi`, Makefiles, `obj.target/`, `.deps/`, object files and debug symbols), which records the packing machine's paths — compiled `*.node` addons stay; and build-only package files — the framework's `changelog/`, `scripts/`, `templates/`, and config bases (`biome.json`, `vitest.config.base.mjs`, `config/tsconfig.base.json`), and `better-sqlite3`'s `deps/` and `src/` C sources. A server using DataCanvas therefore ships a portable bundle without the DuckDB native — `@duckdb/node-api` is an optional peer loaded lazily, so canvas tools report an actionable install hint and every other tool works normally. MCPB is stdio-only — HTTP and Cloudflare Workers deployments are unaffected. Consumers who don't need it can delete `manifest.json` and `.mcpbignore`; `lint:packaging` skips cleanly.
370
370
 
371
371
  **Adding an env var requires both files:** `server.json` (registry discovery, `environmentVariables[]`) and `manifest.json` (bundle install UX, `mcp_config.env` + `user_config`). `lint:packaging` (run by `devcheck`) verifies the env var names match, that every `user_config` option is wired into `mcp_config.env` as `"X": "${user_config.X}"` (the host substitutes nothing else — `"${X}"` reaches the server as that literal string), and that an optional string option carries `"default": ""`.
372
372
 
@@ -433,7 +433,10 @@ import { getMyService } from '@/services/my-domain/my-service.js';
433
433
  - [ ] If wrapping external API: tests include at least one sparse payload case with omitted upstream fields
434
434
  - [ ] Registered in `createApp()` arrays (directly or via barrel exports)
435
435
  - [ ] Tests use `createMockContext()` from `@cyanheads/mcp-ts-core/testing`
436
+ - [ ] `plugin.json` + `mcp.json` (Agent Plugins 1.0.0 — read by Codex, Cursor, GitHub Copilot, VS Code, Kiro) populated — `plugin.json` `name` = the unscoped repo name (lowercase `a-z`, `0-9`, `-`, `.` only); `version`, `description`, `author`, `homepage`, `repository`, `license`, `keywords` from `package.json`; no other top-level field, `extensions` included. `mcp.json` holds one `"type": "stdio"` entry keyed by the unscoped name, `npx -y <full package name>`, and the same fixed `env` as `.codex-plugin/mcp.json`. Neither file carries a user-supplied variable (no `""`, no `${…}` besides `${PLUGIN_ROOT}`/`${PLUGIN_DATA}`): keys reach Codex through `.codex-plugin/mcp.json` `env_vars`, which works only while `.codex-plugin/plugin.json` keeps `"mcpServers": "./.codex-plugin/mcp.json"`
436
437
  - [ ] `.codex-plugin/plugin.json` populated — `name`, `version`, `description`, `repository`, `license` from `package.json`; `interface.displayName` = the unscoped repo name (never the npm scope — `lint:packaging` enforces this); `interface.shortDescription` from `package.json` description
437
438
  - [ ] `.codex-plugin/mcp.json` updated — server name key is the unscoped repo name; every user-supplied variable (API key, contact email, instance URL) is listed in `env_vars` so Codex forwards it from the user's environment. Never write `"KEY": ""` into `env` — an empty value replaces the user's exported key and is read as unset
438
439
  - [ ] `.claude-plugin/plugin.json` populated — `name`, `version`, `description`, `author`, `repository`, `license`, `keywords` from `package.json`; inline `mcpServers` entry keyed by the unscoped repo name. Every user-supplied variable is declared under `userConfig` (`type`, `title`, `description`; `sensitive: true` for keys and tokens; `required: true` or `default: ""`) and referenced from `env` as `"KEY": "${user_config.<option>}"` — mirror the `user_config` block in `manifest.json`. Never write `"KEY": ""` into `env`
440
+ - [ ] Any new root dev path has a root-anchored line in `.mcpbignore`; `bun run bundle` and `lint:packaging` pass
441
+ - [ ] If the server publishes a skill in root `skills/`: `lint:packaging` passes, and `field-test` verified every gate and identifier claim in it against live tool behavior
439
442
  - [ ] `npm run devcheck` passes
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.7.0-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-^2.4.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-^7.0.2-3178C6.svg?style=flat-square)](https://www.typescriptlang.org/) [![Bun](https://img.shields.io/badge/Bun-v1.4.4-blueviolet.svg?style=flat-square)](https://bun.sh/)
10
+ [![Version](https://img.shields.io/badge/Version-0.7.2-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-^2.4.0-green.svg?style=flat-square)](https://modelcontextprotocol.io/) [![npm](https://img.shields.io/npm/v/@cyanheads/usaspending-mcp-server?style=flat-square)](https://www.npmjs.com/package/@cyanheads/usaspending-mcp-server) [![TypeScript](https://img.shields.io/badge/TypeScript-^7.0.2-3178C6.svg?style=flat-square)](https://www.typescriptlang.org/) [![Bun](https://img.shields.io/badge/Bun-v1.4.4-blueviolet.svg?style=flat-square)](https://bun.sh/)
11
11
 
12
12
  </div>
13
13
 
@@ -36,18 +36,18 @@ Where federal money goes, from USAspending.gov: awards, recipients, agencies, an
36
36
  | Tool | Description |
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
- | `usaspending_autocomplete_filters` | Look up NAICS, PSC, CFDA, agency, or recipient codes from a free-text description |
39
+ | `usaspending_autocomplete_filters` | Look up NAICS, PSC, CFDA, agency, recipient, or state, county, and district location codes from a free-text description |
40
40
  | `usaspending_search_awards` | Search awards by keyword, recipient, agency, award type, NAICS code, assistance listing, PSC, DEF code, location, or date range |
41
- | `usaspending_get_award` | Fetch one award's full record: amounts, recipient, agencies, codes, parent IDV, DEF-code funding |
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 |
44
44
  | `usaspending_get_award_federal_accounts` | List the Treasury federal accounts that funded an award, with the amount from each |
45
45
  | `usaspending_get_idv_awards` | List the child orders and sub-IDVs placed under an IDV |
46
46
  | `usaspending_search_recipients` | Search recipients by name, UEI, or DUNS |
47
- | `usaspending_get_recipient` | Fetch a recipient's profile: address, business types, parent, and award totals |
48
- | `usaspending_get_agency` | Fetch an agency's mission, latest-year budget totals, sub-agencies, and DEF codes |
47
+ | `usaspending_get_recipient` | Fetch a recipient's profile: address, business types, parents, child recipients, and award totals |
48
+ | `usaspending_get_agency` | Fetch an agency's mission, latest-year budget totals, budget history by fiscal year, sub-agencies, and DEF codes |
49
49
  | `usaspending_spending_by_geography` | Aggregate spending by state, county, or congressional district |
50
- | `usaspending_spending_by_category` | Aggregate spending by NAICS, PSC, agency, CFDA program, or recipient |
50
+ | `usaspending_spending_by_category` | Aggregate spending by NAICS, PSC, agency, CFDA program, recipient, federal account, or DEF code |
51
51
  | `usaspending_spending_over_time` | Aggregate spending by fiscal year, quarter, or month |
52
52
  | `usaspending_disaster_spending` | Break down disaster and emergency supplemental spending by agency, program, recipient, or geography |
53
53
  | `usaspending_search_federal_accounts` | Search federal accounts by title keyword or agency identifier |
@@ -69,18 +69,28 @@ 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`, `awarding_agency`, `recipient`) plus `search_text`; `limit` 1–500, default 10
72
+ - `type` (`naics`, `psc`, `cfda`, `awarding_agency`, `recipient`, `location`) plus `search_text`; `limit` default 10, at most 500 per call
73
73
  - 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
74
74
  - 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. Pass `name` to `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
75
75
  - `naics` matches official NAICS title text: "software" resolves, "cybersecurity" does not, so search with the industry term a title would use
76
+ - `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`
76
77
 
77
78
  ---
78
79
 
79
80
  ### `usaspending_search_awards` <sub>tool</sub>
80
81
 
81
- - Filters: `keyword`, `agency_name`, `recipient_name`, `naics_codes`, `assistance_listings` (Assistance Listing numbers such as `93.866`, from `usaspending_autocomplete_filters` `type: cfda`), `psc_codes` (1–4 characters, where a prefix such as `Y1` covers the codes under it; contracts and IDVs only), `def_codes` (Disaster Emergency Fund Codes such as `Z`; PSC and DEF codes are sent uppercased), `time_period` (`YYYY-MM-DD` from 2007-10-01 on; either end may be given alone), and `location_filter` (`country` defaults to `USA`, and a territory code such as `PRI` becomes `USA` plus its state; `state` as a postal or 2-digit FIPS code, `FM`/`MH`/`PW`/`UM` and armed-forces `AA`/`AE`/`AP` included, or under another country as that country's own 2-letter subdivision code such as `ON` with `CAN`; `county` as 3 digits with `state` or the 5-digit FIPS code alone; echoed as `applied_location`); `award_type_codes` defaults to contracts (`A`–`D`) and must stay in one group: IDVs `IDV_A`–`IDV_E`, grants `02`–`05`/`F001`/`F002`, direct payments `06`/`10`/`F006`/`F007`, loans `07`/`08`/`F003`/`F004`, or other assistance `09`/`11`/`-1`/`F005`/`F008`/`F009`/`F010`; `limit` up to 100
82
- - Rows carry `generated_internal_id` for `usaspending_get_award` and `agency_slug` for `usaspending_get_agency`; loan rows carry `loan_value`, `subsidy_cost`, and `issued_date` in place of amounts and dates. There is no total, and `page_metadata.has_next` is true on any full page. The nested `filters` object takes the analytics tools' `filters` keys, except `recipient_id`, and wins per field over the flat ones. Failures are `assistance_listings_type_mismatch` (listings with a non-assistance group), `psc_codes_type_mismatch` (PSC codes 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)
82
+ - Filters:
83
+ - `keyword`, `agency_name`, `recipient_name`, `naics_codes`
84
+ - `assistance_listings`: Assistance Listing numbers such as `93.866`, from `usaspending_autocomplete_filters` `type: cfda`
85
+ - `psc_codes`: 1–4 characters, where a prefix such as `Y1` covers the codes under it; contracts and IDVs only
86
+ - `def_codes`: Disaster Emergency Fund Codes such as `Z` (PSC and DEF codes are sent uppercased)
87
+ - `time_period`: `YYYY-MM-DD` from 2007-10-01 on; either end may be given alone
88
+ - `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`
89
+ - `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`
90
+ - `limit`: default 10, at most 100 per call
91
+ - 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 in the selected award-type group, 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. 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`, and wins per field over the flat ones. Failures are `assistance_listings_type_mismatch` (listings with a non-assistance group), `psc_codes_type_mismatch` (PSC codes 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)
83
92
  - `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
93
+ - 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`
84
94
 
85
95
  ---
86
96
 
@@ -89,42 +99,44 @@ The [usaspending-guide](./skills/usaspending-guide/SKILL.md) covers recipient re
89
99
  - `award_id` is a `generated_unique_award_id`, the `generated_internal_id` from search; an unknown ID fails as `award_not_found`
90
100
  - Returns `category`, `total_obligation`, `total_outlays`, `total_account_obligation`, `total_account_outlay`, `base_exercised_options`, `subaward_count`, NAICS / PSC codes, `account_obligations_by_defc`, `account_outlays_by_defc`, and, on loans, `total_loan_value` and `total_subsidy_cost`, where supplied
91
101
  - `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`
92
- - `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`, `congressional_code`, and `zip5` on its `location`. `place_of_performance` also carries a country code, county name, and congressional code; a location with no fields upstream is omitted
102
+ - 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`
103
+ - `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
93
104
  - `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`
94
105
 
95
106
  ---
96
107
 
97
108
  ### `usaspending_get_award_transactions` <sub>tool</sub>
98
109
 
99
- - `award_id` plus `sort` (`action_date`, `federal_action_obligation`, `modification_number`); `limit` up to 100
110
+ - `award_id` plus `sort` (`action_date`, `federal_action_obligation`, `modification_number`); `limit` default 10, at most 2,000 per call
100
111
  - 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
101
112
 
102
113
  ---
103
114
 
104
115
  ### `usaspending_get_award_subawards` <sub>tool</sub>
105
116
 
106
- - `award_id` plus `sort` (`subaward_number`, `description`, `action_date`, `amount`, `recipient_name`); `limit` up to 100
117
+ - `award_id` plus `sort` (`subaward_number`, `description`, `action_date`, `amount`, `recipient_name`); `limit` at most 100 per call
107
118
  - Rows carry `id`, `subaward_number`, `description`, `amount`, `action_date`, and `recipient_name`; the upstream listing supplies no recipient UEI or location. `subaward_count` on `usaspending_get_award` says whether any exist
108
119
 
109
120
  ---
110
121
 
111
122
  ### `usaspending_get_award_federal_accounts` <sub>tool</sub>
112
123
 
113
- - `award_id` is a `generated_unique_award_id`; `limit` up to 100, with `page_metadata.count` as the total
124
+ - `award_id` is a `generated_unique_award_id`; `limit` at most 100 per call, with `page_metadata.count` as the total
114
125
  - Rows carry `federal_account` (AGENCY-MAIN, e.g. `080-0120`) for `usaspending_get_federal_account`, `total_transaction_obligated_amount`, and the funding agency with its `funding_agency_slug`
115
126
 
116
127
  ---
117
128
 
118
129
  ### `usaspending_get_idv_awards` <sub>tool</sub>
119
130
 
120
- - Parent IDV `award_id`; `type` is `child_awards` (task and delivery orders, the default), `child_idvs`, or `grandchild_awards`; `limit` up to 100
131
+ - Parent IDV `award_id`; `type` is `child_awards` (task and delivery orders, the default), `child_idvs`, or `grandchild_awards`; `limit` at most 100 per call
132
+ - `sort` is `obligated_amount` (default), `award_type`, `description`, `funding_agency`, `awarding_agency`, `last_date_to_order`, `period_of_performance_current_end_date`, `period_of_performance_start_date`, or `piid`
121
133
  - Rows carry `generated_unique_award_id` for `usaspending_get_award`, `obligated_amount`, and performance dates; there is no total, and `has_next` is true on any full page
122
134
 
123
135
  ---
124
136
 
125
137
  ### `usaspending_search_recipients` <sub>tool</sub>
126
138
 
127
- - `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` up to 100
139
+ - `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
128
140
  - 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
129
141
 
130
142
  ---
@@ -132,22 +144,25 @@ The [usaspending-guide](./skills/usaspending-guide/SKILL.md) covers recipient re
132
144
  ### `usaspending_get_recipient` <sub>tool</sub>
133
145
 
134
146
  - `recipient_id` from `usaspending_search_recipients` or `usaspending_get_award`; optional `fiscal_year` (2001–2030) scopes the totals to that fiscal year, which otherwise cover the trailing 12 months; an unknown ID fails as `recipient_not_found`
135
- - Returns address, `business_types`, `parent_name` / `parent_uei`, `alternate_names`, `total_transaction_amount`, `total_transactions`, and loan face-value totals, with `period` naming the window (`FY2020` or `trailing 12 months`). Totals span every award type; for totals by type, use `usaspending_spending_over_time` with `filters.recipient_id` and `award_type_codes`
147
+ - Returns address, `business_types`, `parent_id`, `parents` (`parent_id`, `parent_name`, `parent_uei`, `parent_duns` for each; `parent_name` / `parent_uei` describe the first), `alternate_names`, `total_transaction_amount`, `total_transactions`, and loan face-value totals, with `period` naming the window (`FY2020` or `trailing 12 months`). Totals span every award type; for totals by type, use `usaspending_spending_over_time` with `filters.recipient_id` and `award_type_codes`
148
+ - A `-P` parent also returns `children` (`recipient_id`, `name`, `uei`, `duns`, `amount`, `state_province`) over the same period, highest amount first, with `children_total`; `children_limit` defaults to 50, at most 500 per call. Children come from a best-effort second request: if it fails the profile still returns and `unavailable_sections` names `children`
136
149
 
137
150
  ---
138
151
 
139
152
  ### `usaspending_get_agency` <sub>tool</sub>
140
153
 
141
- - One of `toptier_code` (e.g. `097`) or `agency_slug` (e.g. `department-of-defense`); `page` walks the sub-agency list 10 at a time. Failures are `missing_input`, `conflicting_input` (both identifiers sent), and `agency_not_found`
154
+ - One of directory `toptier_code` (e.g. `097` or `1601`) or `agency_slug` (e.g. `department-of-defense`); one- and two-digit numeric codes are padded (`80` becomes `080`), while three- and four-digit codes are preserved. `page` walks the sub-agency list 10 at a time. Failures are `missing_input`, `conflicting_input` (both identifiers sent), and `agency_not_found`
142
155
  - Returns `mission`, plus `budgetary_resources_amount`, `obligated_amount`, and `outlay_amount` for the most recent `fiscal_year` with reported budget data (a newly opened year with no amounts yet is skipped), `sub_agencies` with obligations and transaction and new-award counts for that same year (`sub_agency_fiscal_year` names it; without a budget year within 5 seconds the breakdown covers the current fiscal year), and `def_codes`
156
+ - `budget_by_fiscal_year` lists `budgetary_resources_amount`, `obligated_amount`, `outlay_amount`, and `reported_through_period` for every fiscal year with reported data since FY2017, newest first; a `reported_through_period` below 12 is a year to date
143
157
  - A failed budget or sub-agency request still returns the overview: the missing fields are omitted and `unavailable_sections` names each section with its `reason` (`api_unavailable`, `api_timeout`, or `upstream_error`) and whether a retry may load it
144
158
 
145
159
  ---
146
160
 
147
161
  ### `usaspending_spending_by_geography` <sub>tool</sub>
148
162
 
149
- - `scope` (`place_of_performance`, `recipient_location`) and `geo_layer` (`state`, `county`, `district`) are required; `filters` takes `keywords`, `award_type_codes`, `agency_name`, `recipient_id`, `naics_codes`, `assistance_listings`, `psc_codes`, `def_codes` (the same code filters as `usaspending_search_awards`, echoed as `applied_*`), and `time_period_start` / `time_period_end` (`YYYY-MM-DD`; either alone fills the other, as in `usaspending_search_awards`, `applied_time_period_*` echoes the range sent, a start after the end fails as `date_range_inverted`, and a range starting before 2007-10-01 fails as `date_before_earliest`); `limit` 1–500, default 50
163
+ - `scope` (`place_of_performance`, `recipient_location`) and `geo_layer` (`state`, `county`, `district`) are required; `filters` takes `keywords`, `award_type_codes`, `agency_name`, `recipient_id`, `naics_codes`, `assistance_listings`, `psc_codes`, `def_codes` (the same code filters as `usaspending_search_awards`, echoed as `applied_*`), `place_of_performance_location` and `recipient_location` (the location filters of award search, echoed as `applied_location` and `applied_recipient_location`), and `time_period_start` / `time_period_end` (`YYYY-MM-DD`; either alone fills the other, as in `usaspending_search_awards`, `applied_time_period_*` echoes the range sent, a start after the end fails as `date_range_inverted`, and a range starting before 2007-10-01 fails as `date_before_earliest`); `limit` default 50, no maximum
150
164
  - Award types may mix groups. When every one named is a contract or IDV, `assistance_listings` fails as `assistance_listings_type_mismatch`; when every one is assistance, `psc_codes` fails as `psc_codes_type_mismatch`. Code-filtered amounts cover whole matching awards, and DEF-filtered totals can be negative
165
+ - All three analytics tools apply the same keyword and NAICS rules as award search. `recipient_id` is a hexadecimal 8-4-4-4-12 hash with uppercase `-P`, `-C`, or `-R`; malformed active IDs fail as `invalid_recipient_id`, blank IDs remain unset, and hexadecimal case is normalized in `applied_recipient_id`. A well-formed unknown ID returns an empty result
151
166
  - Rows carry `shape_code`, `display_name`, `aggregated_amount`, `population`, and `per_capita`, ranked by amount; `total_areas_available` counts every match before the cap
152
167
  - `shape_codes` (1–500) returns only the listed areas, in the `shape_code` form of the layer: postal code for `state` (`NY`), 5-digit state + county FIPS for `county` (`36117`), 4-digit state FIPS + district for `district` (`3623`). Selection runs over every matched area, so it reaches areas ranked past `limit`; the codes are echoed as `applied_shape_codes`, and a code that matches no area is named in the `notice`
153
168
  - With no filters, every award type is aggregated and `applied_award_type_default` says so; `subawards: true` switches to subaward data
@@ -156,8 +171,9 @@ The [usaspending-guide](./skills/usaspending-guide/SKILL.md) covers recipient re
156
171
 
157
172
  ### `usaspending_spending_by_category` <sub>tool</sub>
158
173
 
159
- - `category` is `naics`, `psc`, `awarding_agency`, `awarding_subagency`, `funding_agency`, `funding_subagency`, `cfda`, or `recipient_duns`; takes the same `filters` object as `usaspending_spending_by_geography`; `limit` up to 100
160
- - Rows carry `id`, `code`, `name`, and `amount`, ranked by obligation; `recipient_duns` rows carry the DUNS as `code` plus `recipient_id` and `uei` when upstream has them, and `recipient_id` chains to `usaspending_get_recipient`
174
+ - `category` is `naics`, `psc`, `awarding_agency`, `awarding_subagency`, `funding_agency`, `funding_subagency`, `cfda`, `recipient_duns`, `federal_account`, or `defc`; takes the same `filters` object as `usaspending_spending_by_geography`; `limit` at most 100 per call
175
+ - Rows carry `id`, `code`, `name`, and `amount`, ranked by obligation, with ranks continuing across pages; `recipient_duns` rows carry the DUNS as `code` plus `recipient_id` and `uei` when upstream has them, and `recipient_id` chains to `usaspending_get_recipient`. The four agency categories add `agency_slug` for `usaspending_get_agency` (a subagency row carries its parent department's slug)
176
+ - `federal_account` rows carry the AGENCY-MAIN account code as `code`, which opens `usaspending_get_federal_account`; `defc` rows carry the DEF code as `code` and no `id`. Both count whole obligations under every account or DEF code an award carries, so rows overlap and never sum to a total, and on `defc` `def_codes` selects awards while rows still list every code those awards carry
161
177
 
162
178
  ---
163
179
 
@@ -165,21 +181,24 @@ The [usaspending-guide](./skills/usaspending-guide/SKILL.md) covers recipient re
165
181
 
166
182
  - `group` is `fiscal_year`, `quarter`, or `month` (fiscal month, where 1 is October); the same `filters` object, with `award_type_codes` defaulting to contracts, so `assistance_listings` needs an assistance group named; `subawards: true` switches to subaward data
167
183
  - Rows carry `time_period`, `aggregated_amount`, and per-type `contracts`, `grants`, `direct_payments`, `idvs`, `loans`, and `other`
184
+ - `applied_award_type_codes` names the scope of every total and breakdown; omitted or empty codes also set `applied_award_type_default: contracts`. A zero in an excluded category does not describe that category's spending outside the selected scope
168
185
 
169
186
  ---
170
187
 
171
188
  ### `usaspending_disaster_spending` <sub>tool</sub>
172
189
 
173
- - `dimension` is `overview`, `agency`, `cfda`, `recipient`, or `geography`; `filters.def_codes` is optional for `overview` and required for every other dimension (`missing_def_codes` when absent/empty). Codes such as `["L", "M", "N", "O", "P"]` isolate COVID-19 funding and are echoed as `applied_def_codes`. `limit` is up to 100 on every dimension but `overview`; `spending_type` (`award`, the default, or `total`) applies to agency only, and geography takes `filters.geo_layer` (`state`, `county`)
190
+ - `dimension` is `overview`, `agency`, `cfda`, `recipient`, or `geography`; `filters.def_codes` is optional for `overview` and required for every other dimension (`missing_def_codes` when absent/empty). Codes such as `["L", "M", "N", "O", "P"]` isolate COVID-19 funding and are echoed as `applied_def_codes`. `limit` is at most 100 per call on every dimension but `overview`, which ignores it; `spending_type` (`award`, the default, or `total`) applies to agency only, and geography takes `filters.geo_layer` (`state`, `county`)
174
191
  - Rows carry `obligation`, `outlay`, and `award_count`, plus `total_budgetary_resources` on agency rows under `spending_type: total`; `overview` returns totals and `funding_by_def_code`. A recipient row's `id` chains to `usaspending_get_recipient`. Recipient `filters.query` narrows by search text; it is trimmed and echoed as `applied_query`, with blanks applying no query. A recipient total of 10,000 is a reachable ceiling and a lower bound on possible matches, flagged `truncated`; narrow with `filters.query` to reach the tail. Geography areas are ranked by `aggregated_amount` and paged with `limit` and `page`, with the full area count as `total`; a page with areas below it is flagged `truncated`, and `truncationCeiling` is the lowest amount shown. Spending with no recorded place of performance ranks as one unattributed area
175
192
  - Agency, cfda, and recipient also return `totals` across every matching row: `obligation`, `outlay`, and either `total_budgetary_resources` (agency, `total`) or `award_count`. Overview can still time out with codes supplied: narrow `filters.def_codes`, retry later, or use the agency breakdown with `spending_type: total` for obligations, outlays, and budgetary resources
193
+ - `amount_coverage.status` is `complete`, `partial`, `unavailable`, or `unknown`, with requested `supported_def_codes` and `unsupported_def_codes` when known. Award breakdowns and geography use the provider's COVID-19 grouping for amounts; matching rows and counts may cover other codes. Overview and agency `spending_type: total` cover all requested codes. Retained zeros outside monetary coverage do not mean zero actual spending; an unavailable reference leaves coverage `unknown` without discarding the primary data
194
+ - Agency, CFDA, and recipient rows rank by obligation before paging. Agency award queries without award-type filters collect the upstream result set before sorting because that upstream path sorts only within a page; the page walk and amount-coverage lookup share one deadline of at most 45 seconds
176
195
  - Notices preserve upstream messages, ignored filters, cap guidance, and empty-page recovery on both output surfaces. `query` is ignored outside recipient, `geo_layer` outside geography, and `award_type_codes` on overview. An empty page whose offset reaches a positive total directs callers to an earlier page with the same filters; an empty interior page reports the total without claiming exhaustion, and an absent total stays unknown
177
196
 
178
197
  ---
179
198
 
180
199
  ### `usaspending_search_federal_accounts` <sub>tool</sub>
181
200
 
182
- - Optional `keyword` and 3-digit `agency_identifier`; `sort_field` is `account_name`, `account_number`, `budgetary_resources` (default), or `managing_agency`; `limit` up to 100
201
+ - Optional `keyword` and `agency_identifier`, using the directory `toptier_code` from `usaspending_list_agencies` (e.g. `1601` for Labor). This input differs from the account-prefix `agency_identifier` in returned rows (`016` for Labor). `sort_field` is `account_name`, `account_number`, `budgetary_resources` (default), or `managing_agency`; `limit` at most 100 per call
183
202
  - Rows carry `account_number` (e.g. `097-8097`) for the federal-account tools, `managing_agency`, and `budgetary_resources`; `page_metadata.count` is the total. Optional `fiscal_year` selects the reporting year; otherwise the provider uses its latest submission year. The returned `fiscal_year` identifies that period
184
203
 
185
204
  ---
@@ -193,7 +212,7 @@ The [usaspending-guide](./skills/usaspending-guide/SKILL.md) covers recipient re
193
212
 
194
213
  ### `usaspending_get_federal_account_breakdown` <sub>tool</sub>
195
214
 
196
- - `account_code` plus `dimension` (`program_activity` or `object_class`); `limit` up to 100, with `page_metadata.total` as the row count
215
+ - `account_code` plus `dimension` (`program_activity` or `object_class`); `limit` at most 100 per call, with `page_metadata.total` as the row count
197
216
  - Rows carry `code`, `name`, and `obligations`; `program_activity` rows add `type`, either `PAC/PAN` or `PARK`
198
217
  - Optional `fiscal_year` scopes financial reporting periods to October 1 through September 30, echoed in `time_period` and `period`. Omission covers `all available periods`
199
218
 
@@ -207,14 +226,15 @@ USAspending-specific:
207
226
 
208
227
  - USAspending.gov API v2, keyless: the data is public under the DATA Act
209
228
  - Award search and the spending analytics tools cover action dates from 2007-10-01 on (an earlier start date fails as `date_before_earliest`), and DoD contract data lags publication by 90 days
210
- - `usaspending_spending_by_category` puts eight category sub-routes behind one `category` enum, and `usaspending_disaster_spending` puts five disaster endpoints behind `dimension`
229
+ - `usaspending_spending_by_category` puts ten category sub-routes behind one `category` enum, and `usaspending_disaster_spending` puts five disaster endpoints behind `dimension`
211
230
  - Each request runs under one wall-clock budget (45 s by default); a slow answer gets the whole budget in one attempt, and only fast failures are retried. Failures surface as `api_timeout` or `api_unavailable` with each tool's recovery hint, and a rejected request carries USAspending's own explanation in the error message
212
231
 
213
232
  Agent-friendly output:
214
233
 
215
- - Chaining IDs as explicit fields: `generated_internal_id`, `agency_slug`, `recipient.recipient_id`, `federal_account`, and `account_number`, so agents follow the money without parsing display strings
234
+ - Count limits clamp instead of failing: a `limit` above a tool's per-call cap is reduced to the cap and disclosed as `limitClamp` plus a notice (`USASPENDING_CLAMP_LIMITS`)
235
+ - 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
216
236
  - 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
217
- - 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 never supplies a total. The ID-keyed list tools (transactions, subawards, funding accounts, IDV children, account breakdown) return an empty list for an unknown ID rather than failing
237
+ - 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
218
238
  - 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`
219
239
 
220
240
  ## Getting started
@@ -255,6 +275,7 @@ No variable is required; the defaults work out of the box.
255
275
  | `USASPENDING_BASE_URL` | USAspending.gov API v2 base URL. | `https://api.usaspending.gov/api/v2/` |
256
276
  | `USASPENDING_TIMEOUT_MS` | Per-attempt HTTP timeout, in ms (1000–120000). Each attempt is cut at this or at the time left in the request budget, whichever is smaller; a timed-out attempt is not retried. | `45000` |
257
277
  | `USASPENDING_RETRY_BUDGET_MS` | Wall-clock budget for one request, every attempt and backoff included, in ms (1000–300000). Fast failures such as a 503 retry inside it. | `45000`, or `USASPENDING_TIMEOUT_MS` when higher |
278
+ | `USASPENDING_CLAMP_LIMITS` | A result-count `limit` above a tool's per-call cap is reduced to the cap and disclosed (`limitClamp` plus a notice). `false` advertises each cap as the schema `maximum` and rejects a larger value. | `true` |
258
279
  | `MCP_TRANSPORT_TYPE` | Transport: `stdio` or `http`. | `stdio` |
259
280
  | `MCP_HTTP_PORT` | HTTP server port. | `3010` |
260
281
  | `MCP_SESSION_MODE` | HTTP session mode: `stateless`, `stateful`, or `auto`. | `stateless` |
@@ -272,7 +293,7 @@ See [`.env.example`](./.env.example) for the full list of optional overrides.
272
293
 
273
294
  ### Local development
274
295
 
275
- Requires [Bun v1.4.0](https://bun.sh/) or higher (or Node.js v24+). No API key or account is required.
296
+ Requires [Bun v1.4.4](https://bun.sh/) or higher (or Node.js v24+). No API key or account is required.
276
297
 
277
298
  ```sh
278
299
  git clone https://github.com/cyanheads/usaspending-mcp-server.git
@@ -0,0 +1,26 @@
1
+ ---
2
+ summary: "Disclose federal spending scope and correct disaster ranking and effective input validation."
3
+ breaking: false
4
+ security: false
5
+ ---
6
+
7
+ # 0.7.1 — 2026-11-03
8
+
9
+ ## Changed
10
+
11
+ - **`usaspending-guide` 1.0 → 1.1** explains disaster monetary coverage and ranking before pagination.
12
+
13
+ ## Fixed
14
+
15
+ - **Time-series scope** echoes effective award types and discloses the contract default; breakdown zeros apply only within that selection. ([#105](https://github.com/cyanheads/usaspending-mcp-server/issues/105))
16
+ - **Disaster amount coverage** distinguishes complete, partial, unavailable, and unknown monetary scope from matching rows and counts; reference failures retain the primary response. ([#106](https://github.com/cyanheads/usaspending-mcp-server/issues/106))
17
+ - **Disaster ranking** orders obligations before pagination, collecting all agency award pages when required under one shared deadline of at most 45 seconds. ([#107](https://github.com/cyanheads/usaspending-mcp-server/issues/107))
18
+ - **Analytics recipient filters** reject malformed hashes, normalize hexadecimal case, and echo the applied recipient ID. ([#115](https://github.com/cyanheads/usaspending-mcp-server/issues/115))
19
+ - **Effective input validation** checks merged keywords and NAICS codes, normalizes numeric NAICS aliases and disaster DEF codes, advertises supported IDV sorts, and pads short agency codes while preserving four-digit identifiers. ([#116](https://github.com/cyanheads/usaspending-mcp-server/issues/116))
20
+
21
+ ## Dependencies
22
+
23
+ - **`@biomejs/biome`** ^2.6.3 → ^2.6.4
24
+ - **`@types/node`** ^26.6.5 → ^26.6.6
25
+ - **`tsc-alias`** ^1.9.9 → ^1.9.10
26
+ - **`vitest`** ^5.0.5 → ^5.1.0
@@ -0,0 +1,33 @@
1
+ ---
2
+ summary: "Resolve place names to location codes and filter category, geography, and time-series results by place; clamp oversized limits; open recipient parents and children; add multi-year agency budgets, award competition detail, and award search totals."
3
+ breaking: false
4
+ security: false
5
+ ---
6
+
7
+ # 0.7.2 — 2026-11-12
8
+
9
+ ## Added
10
+
11
+ - **`usaspending_autocomplete_filters` `type: "location"`** resolves US state, county, and congressional district names to the codes the location filters and `shape_codes` take. `FM`, `MH`, `PW`, and `UM` have no upstream state row and never get a guessed code. ([#108](https://github.com/cyanheads/usaspending-mcp-server/issues/108))
12
+ - **`filters.place_of_performance_location` and `filters.recipient_location`** on `usaspending_spending_by_category`, `usaspending_spending_by_geography`, `usaspending_spending_over_time`, and the nested `filters` of `usaspending_search_awards`, echoed as `applied_location` and `applied_recipient_location`; a bad location fails as `invalid_location`. ([#109](https://github.com/cyanheads/usaspending-mcp-server/issues/109))
13
+ - **`USASPENDING_CLAMP_LIMITS`** (default `true`) reduces a result-count `limit` above a tool's cap to the cap, disclosed as `limitClamp` plus a notice; `false` advertises each cap as the schema `maximum` and rejects above it. Each cap is the tool's former maximum except `usaspending_get_award_transactions` (2,000) and `usaspending_search_recipients` (1,000), both raised from 100 whichever way the switch is set. ([#99](https://github.com/cyanheads/usaspending-mcp-server/issues/99))
14
+ - **`usaspending_get_recipient`** returns `parent_id` and `parents[]`; a `-P` parent also returns `children` and `children_total`, sized by the new `children_limit` (default 50, at most 500 under the same switch). A failed children request leaves the profile intact and is named in `unavailable_sections`, as is a `-P` profile with neither UEI nor DUNS (`upstream_error`, not retryable). ([#110](https://github.com/cyanheads/usaspending-mcp-server/issues/110))
15
+ - **`usaspending_get_agency` `budget_by_fiscal_year`** lists budgetary resources, obligations, outlays, and `reported_through_period` for every fiscal year with data since FY2017, newest first. ([#111](https://github.com/cyanheads/usaspending-mcp-server/issues/111))
16
+ - **`usaspending_get_award`** returns `competition` and `contract_pricing` on contracts and IDVs, `county_code` on both locations, and `total_subaward_amount`. ([#112](https://github.com/cyanheads/usaspending-mcp-server/issues/112))
17
+ - **`usaspending_spending_by_category`** adds `federal_account` and `defc` categories (rows overlap and never sum to a total) and `agency_slug` on agency rows. ([#113](https://github.com/cyanheads/usaspending-mcp-server/issues/113))
18
+ - **`usaspending_search_awards`** rows carry `recipient_id` and `uei`, and `page_metadata.total` (also `totalCount`) comes from a best-effort count request; when it fails, `unavailable_sections` names `total`. ([#114](https://github.com/cyanheads/usaspending-mcp-server/issues/114))
19
+
20
+ ## Changed
21
+
22
+ - **`usaspending_search_awards` `has_next`** is exact on page-number paging once the total is known, and the cursor-pair guidance is dropped whenever page numbers reach every match (a total up to 50,000). The `has_next` output description is corrected to match. ([#114](https://github.com/cyanheads/usaspending-mcp-server/issues/114))
23
+ - **`usaspending_spending_by_category`** ranks continue across pages instead of restarting at 1. ([#113](https://github.com/cyanheads/usaspending-mcp-server/issues/113))
24
+ - **`usaspending_spending_by_geography` `limit`** has no maximum (was 500). ([#99](https://github.com/cyanheads/usaspending-mcp-server/issues/99))
25
+ - **`usaspending_get_idv_awards`** drops its raise-limit hint when `limit` is already at the cap.
26
+ - **`usaspending-guide` 1.1 → 1.2** covers recipient IDs on search rows, multiple parents and child lists, and location lookup and filters.
27
+ - **Framework skills, scripts, and agent docs** resynced to `@cyanheads/mcp-ts-core` 0.13.22.
28
+
29
+ ## Dependencies
30
+
31
+ - **`@cyanheads/mcp-ts-core`** ^0.13.18 → ^0.13.22
32
+ - **`@biomejs/biome`** ^2.6.4 → ^2.6.6 (dev)
33
+ - **`engines.bun`** >=1.4.0 → >=1.4.4
@@ -116,14 +116,21 @@ security: false
116
116
  resolves to whatever real item already owns 42, and timeline previews pull
117
117
  in that unrelated item's metadata.
118
118
 
119
+ Outside reporters: when the issue or PR came from outside the project
120
+ (`git-wrapup` step 5 says how to tell), thank its author in the same
121
+ parenthetical, profile linked by full URL for the same reason:
122
+
123
+ ([#38](https://github.com/cyanheads/mcp-ts-core/issues/38), thanks [@octocat](https://github.com/octocat)!)
124
+
119
125
  TAG ANNOTATIONS — the annotated tag body renders as the GitHub Release body
120
126
  via `gh release create --notes-from-tag`. It is a condensed digest of this
121
127
  entry, never a copy, and its format is owned by the `release-and-publish`
122
128
  skill (step 4, "Create the annotated tag"): a short subject line without the
123
129
  version, flat headline bullets — no Keep-a-Changelog section headers, no
124
- gates line — at most one deps line, issue backlinks, and the changelog link
125
- last. In release-PR mode the `git-wrapup` skill authors those bullets as the
126
- PR body's `## Changes` and the tag copies them.
130
+ gates line — at most one deps line, issue backlinks with any outside-reporter
131
+ thanks, and the changelog link last. In release-PR mode the `git-wrapup`
132
+ skill authors those bullets as the PR body's `## Changes` and the tag copies
133
+ them.
127
134
  -->
128
135
 
129
136
  ## Added
@@ -7,8 +7,21 @@ declare const ServerConfigSchema: z.ZodObject<{
7
7
  baseUrl: z.ZodDefault<z.ZodString>;
8
8
  timeoutMs: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
9
9
  retryBudgetMs: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
10
+ clampLimits: z.ZodOptional<z.ZodCodec<z.ZodString, z.ZodBoolean>>;
10
11
  }, z.core.$strip>;
11
12
  export type ServerConfig = z.infer<typeof ServerConfigSchema>;
13
+ /**
14
+ * The server config, parsed from the environment once. `setup()` reaches it first,
15
+ * so an invalid value stops startup with the banner naming the variable. Never call
16
+ * it at module import: `tool()` emits input schemas when a definition module loads.
17
+ */
12
18
  export declare function getServerConfig(): ServerConfig;
19
+ /**
20
+ * Whether count inputs clamp (`USASPENDING_CLAMP_LIMITS`, default true). Reads the
21
+ * config `getServerConfig()` parsed, or the default before `setup()` runs, and never
22
+ * parses the environment itself: input schemas call it on every parse and every
23
+ * `tools/list` emission, the first of them at import.
24
+ */
25
+ export declare function clampLimitsEnabled(): boolean;
13
26
  export {};
14
27
  //# sourceMappingURL=server-config.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"server-config.d.ts","sourceRoot":"","sources":["../../src/config/server-config.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,wBAAwB,CAAC;AAG3C,QAAA,MAAM,kBAAkB;;;;iBAwBtB,CAAC;AAEH,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAI9D,wBAAgB,eAAe,IAAI,YAAY,CAO9C"}
1
+ {"version":3,"file":"server-config.d.ts","sourceRoot":"","sources":["../../src/config/server-config.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,wBAAwB,CAAC;AAG3C,QAAA,MAAM,kBAAkB;;;;;iBAmCtB,CAAC;AAEH,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAI9D;;;;GAIG;AACH,wBAAgB,eAAe,IAAI,YAAY,CAQ9C;AAED;;;;;GAKG;AACH,wBAAgB,kBAAkB,IAAI,OAAO,CAE5C"}
@@ -24,14 +24,38 @@ const ServerConfigSchema = z.object({
24
24
  .max(300_000)
25
25
  .optional()
26
26
  .describe('Wall-clock budget in milliseconds for one request, every attempt and retry backoff included. Fast transient failures (5xx, network errors) retry inside it. Defaults to 45000, or to the per-attempt timeout when that is higher, so one attempt can always run its full timeout.'),
27
+ /**
28
+ * Optional rather than defaulted: the service reads none of it, and `ServerConfig`
29
+ * values built for the service alone stay complete. `clampLimitsEnabled()` applies
30
+ * the default.
31
+ */
32
+ clampLimits: z
33
+ .stringbool()
34
+ .optional()
35
+ .describe('Reduces a result-count input above its per-call cap to the cap, disclosed on the result, instead of rejecting it. Default true. False advertises each cap as the schema maximum and rejects a larger value.'),
27
36
  });
28
37
  let _config;
38
+ /**
39
+ * The server config, parsed from the environment once. `setup()` reaches it first,
40
+ * so an invalid value stops startup with the banner naming the variable. Never call
41
+ * it at module import: `tool()` emits input schemas when a definition module loads.
42
+ */
29
43
  export function getServerConfig() {
30
44
  _config ??= parseEnvConfig(ServerConfigSchema, {
31
45
  baseUrl: 'USASPENDING_BASE_URL',
32
46
  timeoutMs: 'USASPENDING_TIMEOUT_MS',
33
47
  retryBudgetMs: 'USASPENDING_RETRY_BUDGET_MS',
48
+ clampLimits: 'USASPENDING_CLAMP_LIMITS',
34
49
  });
35
50
  return _config;
36
51
  }
52
+ /**
53
+ * Whether count inputs clamp (`USASPENDING_CLAMP_LIMITS`, default true). Reads the
54
+ * config `getServerConfig()` parsed, or the default before `setup()` runs, and never
55
+ * parses the environment itself: input schemas call it on every parse and every
56
+ * `tools/list` emission, the first of them at import.
57
+ */
58
+ export function clampLimitsEnabled() {
59
+ return _config?.clampLimits ?? true;
60
+ }
37
61
  //# sourceMappingURL=server-config.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"server-config.js","sourceRoot":"","sources":["../../src/config/server-config.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,wBAAwB,CAAC;AAC3C,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAE/D,MAAM,kBAAkB,GAAG,CAAC,CAAC,MAAM,CAAC;IAClC,OAAO,EAAE,CAAC;SACP,MAAM,EAAE;SACR,GAAG,EAAE;SACL,OAAO,CAAC,qCAAqC,CAAC;SAC9C,QAAQ,CAAC,iCAAiC,CAAC;IAC9C,SAAS,EAAE,CAAC,CAAC,MAAM;SAChB,MAAM,EAAE;SACR,GAAG,EAAE;SACL,GAAG,CAAC,IAAI,CAAC;SACT,GAAG,CAAC,OAAO,CAAC;SACZ,OAAO,CAAC,MAAM,CAAC;SACf,QAAQ,CACP,sLAAsL,CACvL;IACH,aAAa,EAAE,CAAC,CAAC,MAAM;SACpB,MAAM,EAAE;SACR,GAAG,EAAE;SACL,GAAG,CAAC,IAAI,CAAC;SACT,GAAG,CAAC,OAAO,CAAC;SACZ,QAAQ,EAAE;SACV,QAAQ,CACP,mRAAmR,CACpR;CACJ,CAAC,CAAC;AAIH,IAAI,OAAiC,CAAC;AAEtC,MAAM,UAAU,eAAe;IAC7B,OAAO,KAAK,cAAc,CAAC,kBAAkB,EAAE;QAC7C,OAAO,EAAE,sBAAsB;QAC/B,SAAS,EAAE,wBAAwB;QACnC,aAAa,EAAE,6BAA6B;KAC7C,CAAC,CAAC;IACH,OAAO,OAAO,CAAC;AACjB,CAAC"}
1
+ {"version":3,"file":"server-config.js","sourceRoot":"","sources":["../../src/config/server-config.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,wBAAwB,CAAC;AAC3C,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAE/D,MAAM,kBAAkB,GAAG,CAAC,CAAC,MAAM,CAAC;IAClC,OAAO,EAAE,CAAC;SACP,MAAM,EAAE;SACR,GAAG,EAAE;SACL,OAAO,CAAC,qCAAqC,CAAC;SAC9C,QAAQ,CAAC,iCAAiC,CAAC;IAC9C,SAAS,EAAE,CAAC,CAAC,MAAM;SAChB,MAAM,EAAE;SACR,GAAG,EAAE;SACL,GAAG,CAAC,IAAI,CAAC;SACT,GAAG,CAAC,OAAO,CAAC;SACZ,OAAO,CAAC,MAAM,CAAC;SACf,QAAQ,CACP,sLAAsL,CACvL;IACH,aAAa,EAAE,CAAC,CAAC,MAAM;SACpB,MAAM,EAAE;SACR,GAAG,EAAE;SACL,GAAG,CAAC,IAAI,CAAC;SACT,GAAG,CAAC,OAAO,CAAC;SACZ,QAAQ,EAAE;SACV,QAAQ,CACP,mRAAmR,CACpR;IACH;;;;OAIG;IACH,WAAW,EAAE,CAAC;SACX,UAAU,EAAE;SACZ,QAAQ,EAAE;SACV,QAAQ,CACP,6MAA6M,CAC9M;CACJ,CAAC,CAAC;AAIH,IAAI,OAAiC,CAAC;AAEtC;;;;GAIG;AACH,MAAM,UAAU,eAAe;IAC7B,OAAO,KAAK,cAAc,CAAC,kBAAkB,EAAE;QAC7C,OAAO,EAAE,sBAAsB;QAC/B,SAAS,EAAE,wBAAwB;QACnC,aAAa,EAAE,6BAA6B;QAC5C,WAAW,EAAE,0BAA0B;KACxC,CAAC,CAAC;IACH,OAAO,OAAO,CAAC;AACjB,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,kBAAkB;IAChC,OAAO,OAAO,EAAE,WAAW,IAAI,IAAI,CAAC;AACtC,CAAC"}
package/dist/index.js CHANGED
@@ -35,10 +35,10 @@ await createApp({
35
35
  */
36
36
  sessionMode: 'stateless',
37
37
  instructions: 'USAspending.gov MCP server — federal award, recipient, agency, and spending data from the US Treasury DATA Act platform.\n' +
38
- '- Start with usaspending_list_agencies or usaspending_autocomplete_filters to discover agency codes, NAICS/PSC codes, and Assistance Listing numbers\n' +
38
+ '- Start with usaspending_list_agencies or usaspending_autocomplete_filters to discover agency codes, NAICS/PSC codes, Assistance Listing numbers, and state, county, and district location codes\n' +
39
39
  '- Use usaspending_search_awards to find awards, then usaspending_get_award for full details\n' +
40
40
  '- Reuse NAICS, PSC, Assistance Listing, and DEF codes as filters on usaspending_search_awards and the usaspending_spending_* tools to see where and when that money went\n' +
41
- '- Chain recipient_id from usaspending_get_award into usaspending_get_recipient for entity profiles\n' +
41
+ '- Chain recipient_id from usaspending_search_awards rows or usaspending_get_award into usaspending_get_recipient for entity profiles\n' +
42
42
  '- Search window: 2007-10-01 onward. DoD contracts have a 90-day publication lag.',
43
43
  setup(core) {
44
44
  const serverConfig = getServerConfig();
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA;;;;GAIG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACnD,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAC5D,OAAO,EAAE,kBAAkB,EAAE,MAAM,yCAAyC,CAAC;AAC7E,OAAO,EAAE,sBAAsB,EAAE,MAAM,+CAA+C,CAAC;AAEvF,MAAM,SAAS,CAAC;IACd,IAAI,EAAE,wBAAwB;IAC9B,KAAK,EAAE,wBAAwB;IAC/B,KAAK,EAAE,CAAC,GAAG,kBAAkB,CAAC;IAC9B,SAAS,EAAE,EAAE;IACb,OAAO,EAAE,EAAE;IACX,MAAM,EAAE,QAAQ;IAChB,OAAO,EAAE,EAAE,WAAW,EAAE,KAAK,EAAE;IAC/B;;;;;;OAMG;IACH,UAAU,EAAE;QACV,YAAY,EAAE,EAAE,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,QAAQ,EAAE;KACzD;IACD;;;;;;OAMG;IACH,WAAW,EAAE,WAAW;IACxB,YAAY,EACV,4HAA4H;QAC5H,wJAAwJ;QACxJ,+FAA+F;QAC/F,4KAA4K;QAC5K,sGAAsG;QACtG,kFAAkF;IACpF,KAAK,CAAC,IAAI;QACR,MAAM,YAAY,GAAG,eAAe,EAAE,CAAC;QACvC,sBAAsB,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,OAAO,EAAE,YAAY,CAAC,CAAC;IAClE,CAAC;CACF,CAAC,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA;;;;GAIG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACnD,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAC5D,OAAO,EAAE,kBAAkB,EAAE,MAAM,yCAAyC,CAAC;AAC7E,OAAO,EAAE,sBAAsB,EAAE,MAAM,+CAA+C,CAAC;AAEvF,MAAM,SAAS,CAAC;IACd,IAAI,EAAE,wBAAwB;IAC9B,KAAK,EAAE,wBAAwB;IAC/B,KAAK,EAAE,CAAC,GAAG,kBAAkB,CAAC;IAC9B,SAAS,EAAE,EAAE;IACb,OAAO,EAAE,EAAE;IACX,MAAM,EAAE,QAAQ;IAChB,OAAO,EAAE,EAAE,WAAW,EAAE,KAAK,EAAE;IAC/B;;;;;;OAMG;IACH,UAAU,EAAE;QACV,YAAY,EAAE,EAAE,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,QAAQ,EAAE;KACzD;IACD;;;;;;OAMG;IACH,WAAW,EAAE,WAAW;IACxB,YAAY,EACV,4HAA4H;QAC5H,oMAAoM;QACpM,+FAA+F;QAC/F,4KAA4K;QAC5K,wIAAwI;QACxI,kFAAkF;IACpF,KAAK,CAAC,IAAI;QACR,MAAM,YAAY,GAAG,eAAe,EAAE,CAAC;QACvC,sBAAsB,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,OAAO,EAAE,YAAY,CAAC,CAAC;IAClE,CAAC;CACF,CAAC,CAAC"}