@cyanheads/usaspending-mcp-server 0.7.1 → 0.7.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AGENTS.md +8 -5
- package/CLAUDE.md +8 -5
- package/README.md +49 -31
- package/changelog/0.7.x/0.7.2.md +33 -0
- package/changelog/0.7.x/0.7.3.md +29 -0
- package/changelog/template.md +10 -3
- package/dist/config/server-config.d.ts +13 -0
- package/dist/config/server-config.d.ts.map +1 -1
- package/dist/config/server-config.js +24 -0
- package/dist/config/server-config.js.map +1 -1
- package/dist/index.js +1 -6
- package/dist/index.js.map +1 -1
- package/dist/mcp-server/tools/definitions/agency-filters.d.ts +36 -0
- package/dist/mcp-server/tools/definitions/agency-filters.d.ts.map +1 -0
- package/dist/mcp-server/tools/definitions/agency-filters.js +123 -0
- package/dist/mcp-server/tools/definitions/agency-filters.js.map +1 -0
- package/dist/mcp-server/tools/definitions/autocomplete-filters.tool.d.ts +18 -3
- package/dist/mcp-server/tools/definitions/autocomplete-filters.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/autocomplete-filters.tool.js +176 -45
- package/dist/mcp-server/tools/definitions/autocomplete-filters.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/count-limit.d.ts +69 -0
- package/dist/mcp-server/tools/definitions/count-limit.d.ts.map +1 -0
- package/dist/mcp-server/tools/definitions/count-limit.js +87 -0
- package/dist/mcp-server/tools/definitions/count-limit.js.map +1 -0
- package/dist/mcp-server/tools/definitions/dates.d.ts +2 -0
- package/dist/mcp-server/tools/definitions/dates.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/dates.js +2 -0
- package/dist/mcp-server/tools/definitions/dates.js.map +1 -1
- package/dist/mcp-server/tools/definitions/disaster-spending.tool.d.ts +6 -1
- package/dist/mcp-server/tools/definitions/disaster-spending.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/disaster-spending.tool.js +28 -22
- package/dist/mcp-server/tools/definitions/disaster-spending.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/filters.d.ts +60 -10
- package/dist/mcp-server/tools/definitions/filters.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/filters.js +67 -12
- package/dist/mcp-server/tools/definitions/filters.js.map +1 -1
- package/dist/mcp-server/tools/definitions/get-agency.tool.d.ts +9 -0
- package/dist/mcp-server/tools/definitions/get-agency.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/get-agency.tool.js +114 -55
- package/dist/mcp-server/tools/definitions/get-agency.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/get-award-federal-accounts.tool.d.ts +5 -0
- package/dist/mcp-server/tools/definitions/get-award-federal-accounts.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/get-award-federal-accounts.tool.js +14 -11
- package/dist/mcp-server/tools/definitions/get-award-federal-accounts.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/get-award-subawards.tool.d.ts +5 -0
- package/dist/mcp-server/tools/definitions/get-award-subawards.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/get-award-subawards.tool.js +14 -11
- package/dist/mcp-server/tools/definitions/get-award-subawards.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/get-award-transactions.tool.d.ts +5 -0
- package/dist/mcp-server/tools/definitions/get-award-transactions.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/get-award-transactions.tool.js +17 -11
- package/dist/mcp-server/tools/definitions/get-award-transactions.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/get-award.tool.d.ts +30 -0
- package/dist/mcp-server/tools/definitions/get-award.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/get-award.tool.js +110 -2
- package/dist/mcp-server/tools/definitions/get-award.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/get-federal-account-breakdown.tool.d.ts +5 -0
- package/dist/mcp-server/tools/definitions/get-federal-account-breakdown.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/get-federal-account-breakdown.tool.js +18 -11
- package/dist/mcp-server/tools/definitions/get-federal-account-breakdown.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/get-idv-awards.tool.d.ts +5 -0
- package/dist/mcp-server/tools/definitions/get-idv-awards.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/get-idv-awards.tool.js +18 -18
- package/dist/mcp-server/tools/definitions/get-idv-awards.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/get-recipient.tool.d.ts +41 -2
- package/dist/mcp-server/tools/definitions/get-recipient.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/get-recipient.tool.js +201 -11
- package/dist/mcp-server/tools/definitions/get-recipient.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/index.d.ts +264 -15
- package/dist/mcp-server/tools/definitions/index.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/list-agencies.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/list-agencies.tool.js +2 -4
- package/dist/mcp-server/tools/definitions/list-agencies.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/locations.d.ts +20 -9
- package/dist/mcp-server/tools/definitions/locations.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/locations.js +106 -84
- package/dist/mcp-server/tools/definitions/locations.js.map +1 -1
- package/dist/mcp-server/tools/definitions/pagination.d.ts +9 -8
- package/dist/mcp-server/tools/definitions/pagination.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/pagination.js +9 -8
- package/dist/mcp-server/tools/definitions/pagination.js.map +1 -1
- package/dist/mcp-server/tools/definitions/search-awards.tool.d.ts +46 -6
- package/dist/mcp-server/tools/definitions/search-awards.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/search-awards.tool.js +203 -83
- package/dist/mcp-server/tools/definitions/search-awards.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/search-federal-accounts.tool.d.ts +5 -0
- package/dist/mcp-server/tools/definitions/search-federal-accounts.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/search-federal-accounts.tool.js +15 -13
- package/dist/mcp-server/tools/definitions/search-federal-accounts.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/search-recipients.tool.d.ts +6 -0
- package/dist/mcp-server/tools/definitions/search-recipients.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/search-recipients.tool.js +19 -17
- package/dist/mcp-server/tools/definitions/search-recipients.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/spending-by-category.tool.d.ts +33 -2
- package/dist/mcp-server/tools/definitions/spending-by-category.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/spending-by-category.tool.js +100 -40
- package/dist/mcp-server/tools/definitions/spending-by-category.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/spending-by-geography.tool.d.ts +25 -2
- package/dist/mcp-server/tools/definitions/spending-by-geography.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/spending-by-geography.tool.js +50 -26
- package/dist/mcp-server/tools/definitions/spending-by-geography.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/spending-over-time.tool.d.ts +24 -2
- package/dist/mcp-server/tools/definitions/spending-over-time.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/spending-over-time.tool.js +36 -14
- package/dist/mcp-server/tools/definitions/spending-over-time.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/unavailable-sections.d.ts +42 -0
- package/dist/mcp-server/tools/definitions/unavailable-sections.d.ts.map +1 -0
- package/dist/mcp-server/tools/definitions/unavailable-sections.js +63 -0
- package/dist/mcp-server/tools/definitions/unavailable-sections.js.map +1 -0
- package/dist/services/usaspending/types.d.ts +91 -7
- package/dist/services/usaspending/types.d.ts.map +1 -1
- package/dist/services/usaspending/types.js +5 -1
- package/dist/services/usaspending/types.js.map +1 -1
- package/dist/services/usaspending/usaspending-service.d.ts +85 -7
- package/dist/services/usaspending/usaspending-service.d.ts.map +1 -1
- package/dist/services/usaspending/usaspending-service.js +205 -32
- package/dist/services/usaspending/usaspending-service.js.map +1 -1
- package/package.json +4 -4
- package/server.json +3 -3
- package/skills/usaspending-guide/SKILL.md +12 -6
package/AGENTS.md
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
# Developer Protocol
|
|
2
2
|
|
|
3
3
|
**Server:** usaspending-mcp-server
|
|
4
|
-
**Version:** 0.7.
|
|
5
|
-
**Framework:** [@cyanheads/mcp-ts-core](https://www.npmjs.com/package/@cyanheads/mcp-ts-core) `^0.13.
|
|
6
|
-
**Engines:** Bun ≥1.4.
|
|
4
|
+
**Version:** 0.7.3
|
|
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
|
|
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.
|
|
5
|
-
**Framework:** [@cyanheads/mcp-ts-core](https://www.npmjs.com/package/@cyanheads/mcp-ts-core) `^0.13.
|
|
6
|
-
**Engines:** Bun ≥1.4.
|
|
4
|
+
**Version:** 0.7.3
|
|
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
|
|
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
|
-
[](./CHANGELOG.md) [](./LICENSE) [](https://github.com/users/cyanheads/packages/container/package/usaspending-mcp-server) [](https://modelcontextprotocol.io/) [](https://www.npmjs.com/package/@cyanheads/usaspending-mcp-server) [](https://www.typescriptlang.org/) [](https://bun.sh/)
|
|
11
11
|
|
|
12
12
|
</div>
|
|
13
13
|
|
|
@@ -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
|
|
39
|
+
| `usaspending_autocomplete_filters` | Look up NAICS, PSC, CFDA, DEF, agency, recipient, or state, county, and district location codes from a free-text description |
|
|
40
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,
|
|
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
|
|
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,25 +69,27 @@ 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`
|
|
72
|
+
- `type` (`naics`, `psc`, `cfda`, `def_code`, `awarding_agency`, `recipient`, `location`) plus `search_text`; `limit` default 10, at most 500 per call
|
|
73
|
+
- `def_code` matches an exact code or text in the appropriation title or public law, case-insensitively. Rows carry `code`, `name`, and `public_law` / `disaster_group` when supplied; exact code matches come first. Use the returned code in spending and disaster filters
|
|
73
74
|
- Rows carry `code` and `name`, and `uei` / `duns` for recipients; no match fails as `no_match`. A `cfda` code goes in `assistance_listings` and a `psc` code in `psc_codes` on `usaspending_search_awards` and the three spending analytics tools
|
|
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
|
+
- 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` or `funding_agency_name` on award search or spending analytics to match that agency; pass `toptier_name` for the whole department. Agency results combine top-tier then sub-tier matches under one `limit`; office matches are excluded
|
|
75
76
|
- `naics` matches official NAICS title text: "software" resolves, "cybersecurity" does not, so search with the industry term a title would use
|
|
77
|
+
- `location` matches US states, then counties, then congressional districts by name. Rows carry `kind` (`state`, `county`, or `district`), the upstream's uppercase `name`, and `code`: a postal code for a state, the 5-digit state + county FIPS code for a county, the state FIPS + district number (e.g. `5307`) for a district; county and district rows add the `state` postal code. Upstream returns at most 100 rows of each kind, and a notice says when one hits it. Countries, cities, and ZIP codes are not returned; `no_match` names the three kinds. The freely associated states (`FM`, `MH`, `PW`) and the Minor Outlying Islands (`UM`) have no upstream state row and get no code. Pass a code to `usaspending_search_awards` and the spending analytics location filters, or to `shape_codes` on `usaspending_spending_by_geography`
|
|
76
78
|
|
|
77
79
|
---
|
|
78
80
|
|
|
79
81
|
### `usaspending_search_awards` <sub>tool</sub>
|
|
80
82
|
|
|
81
83
|
- Filters:
|
|
82
|
-
- `keyword`, `agency_name`, `recipient_name`, `naics_codes`
|
|
84
|
+
- `keyword`, `agency_name` (awarding), `funding_agency_name`, `recipient_name`, `naics_codes`
|
|
83
85
|
- `assistance_listings`: Assistance Listing numbers such as `93.866`, from `usaspending_autocomplete_filters` `type: cfda`
|
|
84
86
|
- `psc_codes`: 1–4 characters, where a prefix such as `Y1` covers the codes under it; contracts and IDVs only
|
|
85
87
|
- `def_codes`: Disaster Emergency Fund Codes such as `Z` (PSC and DEF codes are sent uppercased)
|
|
86
88
|
- `time_period`: `YYYY-MM-DD` from 2007-10-01 on; either end may be given alone
|
|
87
|
-
- `location_filter
|
|
89
|
+
- `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`
|
|
88
90
|
- `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`
|
|
89
|
-
- `limit`:
|
|
90
|
-
- 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.
|
|
91
|
+
- `limit`: default 10, at most 100 per call
|
|
92
|
+
- Rows carry `generated_internal_id` for `usaspending_get_award`, `recipient_id` for `usaspending_get_recipient` and `uei` when upstream has them, and `agency_slug` for `usaspending_get_agency`; loan rows carry `loan_value`, `subsidy_cost`, and `issued_date` in place of amounts and dates. `page_metadata.total` (also `totalCount`) counts every match 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)
|
|
91
93
|
- `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
|
|
92
94
|
- 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`
|
|
93
95
|
|
|
@@ -98,35 +100,36 @@ The [usaspending-guide](./skills/usaspending-guide/SKILL.md) covers recipient re
|
|
|
98
100
|
- `award_id` is a `generated_unique_award_id`, the `generated_internal_id` from search; an unknown ID fails as `award_not_found`
|
|
99
101
|
- 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
|
|
100
102
|
- `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`
|
|
101
|
-
-
|
|
103
|
+
- Contracts and IDVs also return a `competition` block (`extent_competed`, `solicitation_procedures`, `type_set_aside`, `other_than_full_and_open`, `fair_opportunity_limited`, each a `{code, description}`, plus `number_of_offers_received`) and `contract_pricing`; `total_subaward_amount` sits beside `subaward_count`
|
|
104
|
+
- `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
|
|
102
105
|
- `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`
|
|
103
106
|
|
|
104
107
|
---
|
|
105
108
|
|
|
106
109
|
### `usaspending_get_award_transactions` <sub>tool</sub>
|
|
107
110
|
|
|
108
|
-
- `award_id` plus `sort` (`action_date`, `federal_action_obligation`, `modification_number`); `limit`
|
|
111
|
+
- `award_id` plus `sort` (`action_date`, `federal_action_obligation`, `modification_number`); `limit` default 10, at most 2,000 per call
|
|
109
112
|
- 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
|
|
110
113
|
|
|
111
114
|
---
|
|
112
115
|
|
|
113
116
|
### `usaspending_get_award_subawards` <sub>tool</sub>
|
|
114
117
|
|
|
115
|
-
- `award_id` plus `sort` (`subaward_number`, `description`, `action_date`, `amount`, `recipient_name`); `limit`
|
|
118
|
+
- `award_id` plus `sort` (`subaward_number`, `description`, `action_date`, `amount`, `recipient_name`); `limit` at most 100 per call
|
|
116
119
|
- 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
|
|
117
120
|
|
|
118
121
|
---
|
|
119
122
|
|
|
120
123
|
### `usaspending_get_award_federal_accounts` <sub>tool</sub>
|
|
121
124
|
|
|
122
|
-
- `award_id` is a `generated_unique_award_id`; `limit`
|
|
125
|
+
- `award_id` is a `generated_unique_award_id`; `limit` at most 100 per call, with `page_metadata.count` as the total
|
|
123
126
|
- 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`
|
|
124
127
|
|
|
125
128
|
---
|
|
126
129
|
|
|
127
130
|
### `usaspending_get_idv_awards` <sub>tool</sub>
|
|
128
131
|
|
|
129
|
-
- Parent IDV `award_id`; `type` is `child_awards` (task and delivery orders, the default), `child_idvs`, or `grandchild_awards`; `limit`
|
|
132
|
+
- 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
|
|
130
133
|
- `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`
|
|
131
134
|
- 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
|
|
132
135
|
|
|
@@ -134,15 +137,17 @@ The [usaspending-guide](./skills/usaspending-guide/SKILL.md) covers recipient re
|
|
|
134
137
|
|
|
135
138
|
### `usaspending_search_recipients` <sub>tool</sub>
|
|
136
139
|
|
|
137
|
-
- `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`
|
|
140
|
+
- `keyword` matches names, UEI, or DUNS, partial matches included; surrounding whitespace is trimmed, and blank text applies no keyword filter with a notice. Optional `award_type` still scopes the totals; `limit` at most 1,000 per call
|
|
138
141
|
- Rows carry `id` (a hash suffixed `-P` parent, `-C` child, or `-R` standalone) for `usaspending_get_recipient`, plus `uei`, `duns`, `recipient_level`, and `amount`; `page_metadata.total` is the full match count
|
|
142
|
+
- `amount` is the selected award types' precomputed trailing-12-month obligations; `period: "trailing 12 months"` labels every page. Snapshot totals can differ from the profile's live trailing-12-month totals
|
|
139
143
|
|
|
140
144
|
---
|
|
141
145
|
|
|
142
146
|
### `usaspending_get_recipient` <sub>tool</sub>
|
|
143
147
|
|
|
144
|
-
- `recipient_id` from `usaspending_search_recipients` or `usaspending_get_award`; optional `fiscal_year` (2001–2030)
|
|
145
|
-
- Returns address, `business_types`, `parent_name` / `parent_uei
|
|
148
|
+
- `recipient_id` from `usaspending_search_recipients` or `usaspending_get_award`; optional `fiscal_year` (2001–2030 or `"all"`) selects one fiscal year or all available fiscal years. Omission covers the trailing 12 months; an unknown ID fails as `recipient_not_found`
|
|
149
|
+
- 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`, `all fiscal years`, 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`
|
|
150
|
+
- 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`
|
|
146
151
|
|
|
147
152
|
---
|
|
148
153
|
|
|
@@ -150,13 +155,15 @@ The [usaspending-guide](./skills/usaspending-guide/SKILL.md) covers recipient re
|
|
|
150
155
|
|
|
151
156
|
- 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`
|
|
152
157
|
- 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`
|
|
158
|
+
- `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
|
|
159
|
+
- `def_codes_fiscal_year` identifies the DEF list's year, aligned with the returned budget year when available. A failed year-specific lookup omits the DEF data and names `def_codes` in `unavailable_sections`; without a budget year, the overview's DEF year is used
|
|
153
160
|
- 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
|
|
154
161
|
|
|
155
162
|
---
|
|
156
163
|
|
|
157
164
|
### `usaspending_spending_by_geography` <sub>tool</sub>
|
|
158
165
|
|
|
159
|
-
- `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`
|
|
166
|
+
- `scope` (`place_of_performance`, `recipient_location`) and `geo_layer` (`state`, `county`, `district`) are required; `filters` takes `keywords`, `award_type_codes`, `agency_name`, `funding_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
|
|
160
167
|
- 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
|
|
161
168
|
- 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
|
|
162
169
|
- Rows carry `shape_code`, `display_name`, `aggregated_amount`, `population`, and `per_capita`, ranked by amount; `total_areas_available` counts every match before the cap
|
|
@@ -167,8 +174,9 @@ The [usaspending-guide](./skills/usaspending-guide/SKILL.md) covers recipient re
|
|
|
167
174
|
|
|
168
175
|
### `usaspending_spending_by_category` <sub>tool</sub>
|
|
169
176
|
|
|
170
|
-
- `category` is `naics`, `psc`, `awarding_agency`, `awarding_subagency`, `funding_agency`, `funding_subagency`, `cfda`, or `
|
|
171
|
-
- 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`
|
|
177
|
+
- `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
|
|
178
|
+
- 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)
|
|
179
|
+
- `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
|
|
172
180
|
|
|
173
181
|
---
|
|
174
182
|
|
|
@@ -178,11 +186,19 @@ The [usaspending-guide](./skills/usaspending-guide/SKILL.md) covers recipient re
|
|
|
178
186
|
- Rows carry `time_period`, `aggregated_amount`, and per-type `contracts`, `grants`, `direct_payments`, `idvs`, `loans`, and `other`
|
|
179
187
|
- `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
|
|
180
188
|
|
|
189
|
+
### Shared spending scope
|
|
190
|
+
|
|
191
|
+
Award search and all three spending analytics tools accept `funding_agency_name` beside the awarding `agency_name`. Both roles together select their intersection, and each name matches either agency tier. Exact names and unambiguous abbreviations are resolved through agency discovery; inconclusive or unavailable lookup preserves the supplied name with an unresolved-name notice. Effective names are echoed as `applied_agency_name` and `applied_funding_agency_name`.
|
|
192
|
+
|
|
193
|
+
Award search, category, and geography disclose when no date filter was supplied and results use USAspending's available coverage. They echo the `applied_award_type_codes` actually sent; award search also echoes `applied_recipient_name`. Explicit date bounds retain their existing filling and validation rules.
|
|
194
|
+
|
|
195
|
+
Analytics using a `-P` recipient ID disclose that amounts cover awards attributed to that parent. Historical parent attribution can vary. For an entity's own awards, use returned `-C` or `-R` IDs; check both if search returns both rather than constructing a new ID by changing a suffix.
|
|
196
|
+
|
|
181
197
|
---
|
|
182
198
|
|
|
183
199
|
### `usaspending_disaster_spending` <sub>tool</sub>
|
|
184
200
|
|
|
185
|
-
- `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
|
|
201
|
+
- `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`)
|
|
186
202
|
- 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
|
|
187
203
|
- 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
|
|
188
204
|
- `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
|
|
@@ -193,7 +209,7 @@ The [usaspending-guide](./skills/usaspending-guide/SKILL.md) covers recipient re
|
|
|
193
209
|
|
|
194
210
|
### `usaspending_search_federal_accounts` <sub>tool</sub>
|
|
195
211
|
|
|
196
|
-
- 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`
|
|
212
|
+
- 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
|
|
197
213
|
- 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
|
|
198
214
|
|
|
199
215
|
---
|
|
@@ -207,7 +223,7 @@ The [usaspending-guide](./skills/usaspending-guide/SKILL.md) covers recipient re
|
|
|
207
223
|
|
|
208
224
|
### `usaspending_get_federal_account_breakdown` <sub>tool</sub>
|
|
209
225
|
|
|
210
|
-
- `account_code` plus `dimension` (`program_activity` or `object_class`); `limit`
|
|
226
|
+
- `account_code` plus `dimension` (`program_activity` or `object_class`); `limit` at most 100 per call, with `page_metadata.total` as the row count
|
|
211
227
|
- Rows carry `code`, `name`, and `obligations`; `program_activity` rows add `type`, either `PAC/PAN` or `PARK`
|
|
212
228
|
- Optional `fiscal_year` scopes financial reporting periods to October 1 through September 30, echoed in `time_period` and `period`. Omission covers `all available periods`
|
|
213
229
|
|
|
@@ -220,15 +236,16 @@ Built on [`@cyanheads/mcp-ts-core`](https://github.com/cyanheads/mcp-ts-core): s
|
|
|
220
236
|
USAspending-specific:
|
|
221
237
|
|
|
222
238
|
- USAspending.gov API v2, keyless: the data is public under the DATA Act
|
|
223
|
-
- Award search and the spending analytics tools
|
|
224
|
-
- `usaspending_spending_by_category` puts
|
|
239
|
+
- Award search and the spending analytics tools accept explicit action-date ranges from 2007-10-01 on (an earlier start fails as `date_before_earliest`), and DoD contract data lags publication by 90 days
|
|
240
|
+
- `usaspending_spending_by_category` puts ten category sub-routes behind one `category` enum, and `usaspending_disaster_spending` puts five disaster endpoints behind `dimension`
|
|
225
241
|
- 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
|
|
226
242
|
|
|
227
243
|
Agent-friendly output:
|
|
228
244
|
|
|
229
|
-
-
|
|
245
|
+
- 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`)
|
|
246
|
+
- 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
|
|
230
247
|
- 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
|
|
231
|
-
- 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
|
|
248
|
+
- 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
|
|
232
249
|
- Typed failures with recovery hints: `award_not_found`, `recipient_not_found`, `agency_not_found`, `account_not_found`, `no_match`, `conflicting_input`, `date_before_earliest`, `date_range_inverted`, `unsupported_sort`, `assistance_listings_type_mismatch`, `psc_codes_type_mismatch`, `invalid_location`, `pagination_limit_exceeded`, `incomplete_cursor`, `missing_def_codes`
|
|
233
250
|
|
|
234
251
|
## Getting started
|
|
@@ -269,6 +286,7 @@ No variable is required; the defaults work out of the box.
|
|
|
269
286
|
| `USASPENDING_BASE_URL` | USAspending.gov API v2 base URL. | `https://api.usaspending.gov/api/v2/` |
|
|
270
287
|
| `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` |
|
|
271
288
|
| `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 |
|
|
289
|
+
| `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` |
|
|
272
290
|
| `MCP_TRANSPORT_TYPE` | Transport: `stdio` or `http`. | `stdio` |
|
|
273
291
|
| `MCP_HTTP_PORT` | HTTP server port. | `3010` |
|
|
274
292
|
| `MCP_SESSION_MODE` | HTTP session mode: `stateless`, `stateful`, or `auto`. | `stateless` |
|
|
@@ -286,7 +304,7 @@ See [`.env.example`](./.env.example) for the full list of optional overrides.
|
|
|
286
304
|
|
|
287
305
|
### Local development
|
|
288
306
|
|
|
289
|
-
Requires [Bun v1.4.
|
|
307
|
+
Requires [Bun v1.4.4](https://bun.sh/) or higher (or Node.js v24+). No API key or account is required.
|
|
290
308
|
|
|
291
309
|
```sh
|
|
292
310
|
git clone https://github.com/cyanheads/usaspending-mcp-server.git
|
|
@@ -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
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
---
|
|
2
|
+
summary: "Filter awards and spending by funding agency, look up DEF codes by title or public law, and get all-year recipient totals. Agency detail aligns DEF codes with the budget year, and spending results explain their applied scope."
|
|
3
|
+
breaking: false
|
|
4
|
+
security: false
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# 0.7.3 — 2026-11-13
|
|
8
|
+
|
|
9
|
+
## Added
|
|
10
|
+
|
|
11
|
+
- **`funding_agency_name`** filters award search and all three spending analytics tools. Supply both agency roles to match their intersection ([#127](https://github.com/cyanheads/usaspending-mcp-server/issues/127)).
|
|
12
|
+
- **`usaspending_autocomplete_filters`** accepts `type: "def_code"` to find Disaster Emergency Fund codes by exact code, title, or public law ([#123](https://github.com/cyanheads/usaspending-mcp-server/issues/123)).
|
|
13
|
+
- **`usaspending_get_recipient`** accepts `fiscal_year: "all"` for profile totals and child recipients over all available fiscal years ([#126](https://github.com/cyanheads/usaspending-mcp-server/issues/126)).
|
|
14
|
+
|
|
15
|
+
## Changed
|
|
16
|
+
|
|
17
|
+
- **`usaspending-guide` 1.2 → 1.3** covers agency-name verification, parent attribution, recipient periods, and DEF code discovery.
|
|
18
|
+
|
|
19
|
+
## Fixed
|
|
20
|
+
|
|
21
|
+
- **`usaspending_get_agency`** aligns DEF codes with the returned budget year, labels it with `def_codes_fiscal_year`, and reports when the year-specific list is unavailable ([#120](https://github.com/cyanheads/usaspending-mcp-server/issues/120)).
|
|
22
|
+
- **Award search and spending analytics** resolve case-insensitive agency names and unambiguous abbreviations. Responses echo the names sent and disclose when a name could not be verified ([#121](https://github.com/cyanheads/usaspending-mcp-server/issues/121)).
|
|
23
|
+
- **`usaspending_search_recipients`** labels the precomputed obligations on every page as trailing 12 months ([#122](https://github.com/cyanheads/usaspending-mcp-server/issues/122)).
|
|
24
|
+
- **Spending analytics** explain the attribution scope of parent recipient IDs and point callers to returned child or standalone IDs for the entity's own awards ([#124](https://github.com/cyanheads/usaspending-mcp-server/issues/124)).
|
|
25
|
+
- **Award search, category, and geography spending** disclose when no date filter was sent and echo applied award-type codes. Award search also echoes the applied recipient name ([#128](https://github.com/cyanheads/usaspending-mcp-server/issues/128)).
|
|
26
|
+
|
|
27
|
+
## Dependencies
|
|
28
|
+
|
|
29
|
+
- **`@biomejs/biome`** ^2.6.6 → ^2.6.7 (dev)
|
package/changelog/template.md
CHANGED
|
@@ -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
|
|
125
|
-
last. In release-PR mode the `git-wrapup`
|
|
126
|
-
PR body's `## Changes` and the tag copies
|
|
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
|
|
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;
|
|
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
|
@@ -34,12 +34,7 @@ await createApp({
|
|
|
34
34
|
* carries a meaningful value.
|
|
35
35
|
*/
|
|
36
36
|
sessionMode: 'stateless',
|
|
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' +
|
|
39
|
-
'- Use usaspending_search_awards to find awards, then usaspending_get_award for full details\n' +
|
|
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' +
|
|
42
|
-
'- Search window: 2007-10-01 onward. DoD contracts have a 90-day publication lag.',
|
|
37
|
+
instructions: 'USAspending.gov MCP server — federal award, recipient, agency, and spending data from the US Treasury DATA Act platform.\n- Start with usaspending_list_agencies or usaspending_autocomplete_filters to discover agency codes, NAICS/PSC/DEF codes, Assistance Listing numbers, and state, county, and district location codes\n- Use usaspending_search_awards to find awards, then usaspending_get_award for full details\n- 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- Chain recipient_id from usaspending_search_awards rows or usaspending_get_award into usaspending_get_recipient for entity profiles\n- Explicit award-search and analytics date ranges start no earlier than 2007-10-01. Check response notices for the applied scope. DoD contracts have a 90-day publication lag.',
|
|
43
38
|
setup(core) {
|
|
44
39
|
const serverConfig = getServerConfig();
|
|
45
40
|
initUSASpendingService(core.config, core.storage, serverConfig);
|
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,
|
|
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,63BAA63B;IAC/3B,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"}
|