@cyanheads/congressgov-mcp-server 0.3.19 → 0.3.21
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 +23 -8
- package/CLAUDE.md +23 -8
- package/README.md +12 -6
- package/dist/config/server-config.d.ts +1 -1
- package/dist/config/server-config.d.ts.map +1 -1
- package/dist/config/server-config.js +4 -1
- package/dist/config/server-config.js.map +1 -1
- package/dist/mcp-server/tools/definitions/bill-lookup.tool.d.ts +8 -1
- package/dist/mcp-server/tools/definitions/bill-lookup.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/bill-lookup.tool.js +17 -6
- package/dist/mcp-server/tools/definitions/bill-lookup.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/bill-summaries.tool.d.ts +8 -1
- package/dist/mcp-server/tools/definitions/bill-summaries.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/bill-summaries.tool.js +13 -5
- package/dist/mcp-server/tools/definitions/bill-summaries.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/committee-lookup.tool.d.ts +8 -1
- package/dist/mcp-server/tools/definitions/committee-lookup.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/committee-lookup.tool.js +14 -4
- package/dist/mcp-server/tools/definitions/committee-lookup.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/committee-reports.tool.d.ts +8 -1
- package/dist/mcp-server/tools/definitions/committee-reports.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/committee-reports.tool.js +9 -2
- package/dist/mcp-server/tools/definitions/committee-reports.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/crs-reports.tool.d.ts +8 -1
- package/dist/mcp-server/tools/definitions/crs-reports.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/crs-reports.tool.js +3 -2
- package/dist/mcp-server/tools/definitions/crs-reports.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/daily-record.tool.d.ts +8 -1
- package/dist/mcp-server/tools/definitions/daily-record.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/daily-record.tool.js +11 -4
- package/dist/mcp-server/tools/definitions/daily-record.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/enacted-laws.tool.d.ts +8 -1
- package/dist/mcp-server/tools/definitions/enacted-laws.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/enacted-laws.tool.js +10 -3
- package/dist/mcp-server/tools/definitions/enacted-laws.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/member-lookup.tool.d.ts +8 -1
- package/dist/mcp-server/tools/definitions/member-lookup.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/member-lookup.tool.js +15 -3
- package/dist/mcp-server/tools/definitions/member-lookup.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/roll-votes.tool.d.ts +8 -1
- package/dist/mcp-server/tools/definitions/roll-votes.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/roll-votes.tool.js +43 -22
- package/dist/mcp-server/tools/definitions/roll-votes.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/senate-nominations.tool.d.ts +8 -1
- package/dist/mcp-server/tools/definitions/senate-nominations.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/senate-nominations.tool.js +7 -3
- package/dist/mcp-server/tools/definitions/senate-nominations.tool.js.map +1 -1
- package/dist/mcp-server/tools/format-helpers.d.ts +1 -1
- package/dist/mcp-server/tools/format-helpers.d.ts.map +1 -1
- package/dist/mcp-server/tools/format-helpers.js +228 -23
- package/dist/mcp-server/tools/format-helpers.js.map +1 -1
- package/dist/mcp-server/tools/tool-helpers.d.ts +34 -0
- package/dist/mcp-server/tools/tool-helpers.d.ts.map +1 -1
- package/dist/mcp-server/tools/tool-helpers.js +96 -0
- package/dist/mcp-server/tools/tool-helpers.js.map +1 -1
- package/dist/services/congress-api/congress-api-service.d.ts +1 -1
- package/dist/services/congress-api/congress-api-service.d.ts.map +1 -1
- package/dist/services/congress-api/congress-api-service.js +8 -16
- package/dist/services/congress-api/congress-api-service.js.map +1 -1
- package/package.json +8 -3
- package/server.json +7 -7
package/AGENTS.md
CHANGED
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
# Agent Protocol
|
|
2
2
|
|
|
3
3
|
**Server:** congressgov-mcp-server
|
|
4
|
-
**Version:** 0.3.
|
|
5
|
-
**Framework:** [@cyanheads/mcp-ts-core](https://www.npmjs.com/package/@cyanheads/mcp-ts-core)
|
|
4
|
+
**Version:** 0.3.21
|
|
5
|
+
**Framework:** [@cyanheads/mcp-ts-core](https://www.npmjs.com/package/@cyanheads/mcp-ts-core) `^0.9.6`
|
|
6
|
+
**Engines:** Bun ≥1.3.0, Node ≥24.0.0
|
|
7
|
+
**MCP SDK:** `@modelcontextprotocol/sdk` ^1.29.0
|
|
8
|
+
**Zod:** ^4.4.3
|
|
6
9
|
|
|
7
10
|
> **Read the framework docs first:** `node_modules/@cyanheads/mcp-ts-core/CLAUDE.md` contains the full API reference — builders, Context, error codes, exports, patterns. This file covers server-specific conventions only.
|
|
8
11
|
|
|
@@ -37,7 +40,7 @@ Tailor suggestions to what's actually missing or stale — don't recite the full
|
|
|
37
40
|
|
|
38
41
|
| Env Var | Required | Description |
|
|
39
42
|
|:--------|:---------|:------------|
|
|
40
|
-
| `CONGRESS_API_KEY` |
|
|
43
|
+
| `CONGRESS_API_KEY` | No | Optional. Defaults to `DEMO_KEY` (30 req/hr). Own key from [api.data.gov](https://api.data.gov/signup/): 1,000 req/hr. |
|
|
41
44
|
| `CONGRESS_API_BASE_URL` | No | Defaults to `https://api.congress.gov/v3` |
|
|
42
45
|
|
|
43
46
|
---
|
|
@@ -240,10 +243,14 @@ When you complete a skill's checklist, check the boxes and add a completion time
|
|
|
240
243
|
| `bun run build` | Compile TypeScript |
|
|
241
244
|
| `bun run rebuild` | Clean + build |
|
|
242
245
|
| `bun run clean` | Remove build artifacts |
|
|
243
|
-
| `bun run devcheck` | Lint + format + typecheck + security |
|
|
246
|
+
| `bun run devcheck` | Lint + format + typecheck + security + changelog sync |
|
|
247
|
+
| `bun run audit:refresh` | Delete `bun.lock`, reinstall, re-audit. Use when `devcheck` flags a transitive advisory — stale lockfile can mask already-patched deps. If advisory survives, it's real. |
|
|
244
248
|
| `bun run tree` | Generate directory structure doc |
|
|
249
|
+
| `bun run list-skills` | List available skills from `.claude/skills/` or `skills/` |
|
|
245
250
|
| `bun run format` | Auto-fix formatting |
|
|
246
251
|
| `bun run lint:mcp` | Validate MCP tool/resource/prompt definitions |
|
|
252
|
+
| `bun run lint:packaging` | Validate env var alignment between `manifest.json` and `server.json` |
|
|
253
|
+
| `bun run bundle` | Build and pack as `.mcpb` for one-click Claude Desktop install |
|
|
247
254
|
| `bun run changelog:build` | Regenerate `CHANGELOG.md` from `changelog/*.md` |
|
|
248
255
|
| `bun run changelog:check` | Verify `CHANGELOG.md` is in sync (used by devcheck) |
|
|
249
256
|
| `bun run test` | Run tests |
|
|
@@ -254,6 +261,14 @@ When you complete a skill's checklist, check the boxes and add a completion time
|
|
|
254
261
|
|
|
255
262
|
---
|
|
256
263
|
|
|
264
|
+
## Bundling
|
|
265
|
+
|
|
266
|
+
`bun run bundle` produces a `.mcpb` extension bundle for one-click install in Claude Desktop. MCPB is stdio-only — HTTP deployments are unaffected. The bundle file ships as `dist/congressgov-mcp-server.mcpb`.
|
|
267
|
+
|
|
268
|
+
**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.
|
|
269
|
+
|
|
270
|
+
---
|
|
271
|
+
|
|
257
272
|
## Changelog
|
|
258
273
|
|
|
259
274
|
Directory-based, grouped by minor series using the `.x` semver-wildcard convention. Source of truth is `changelog/<major.minor>.x/<version>.md` (e.g. `changelog/0.3.x/0.3.13.md`) — one file per released version. At release time, author the per-version file with a concrete version and date, then run `bun run changelog:build` to regenerate the rollup. `changelog/template.md` is a **pristine format reference** — never edited, never renamed, never moved. `CHANGELOG.md` is a **navigation index** (header + link + one-line summary per version), regenerated by `bun run changelog:build`. Devcheck hard-fails on drift. Never hand-edit `CHANGELOG.md`.
|
|
@@ -295,14 +310,14 @@ Remind the user to run these after completing a release flow.
|
|
|
295
310
|
## Checklist
|
|
296
311
|
|
|
297
312
|
- [ ] Zod schemas: all fields have `.describe()`, only JSON-Schema-serializable types (no `z.custom()`, `z.date()`, `z.transform()`, `z.bigint()`, `z.symbol()`, `z.void()`, `z.map()`, `z.set()`, `z.function()`, `z.nan()`)
|
|
298
|
-
- [ ] Optional nested objects: handler guards for empty inner values from form-based clients (`if (input.obj?.field && ...)`, not just `if (input.obj)`)
|
|
313
|
+
- [ ] Optional nested objects: handler guards for empty inner values from form-based clients (`if (input.obj?.field && ...)`, not just `if (input.obj)`). When regex/length constraints matter, use `z.union([z.literal(''), z.string().regex(...).describe(...)])` — literal variants are exempt from `describe-on-fields`.
|
|
299
314
|
- [ ] JSDoc `@fileoverview` + `@module` on every file
|
|
300
315
|
- [ ] `ctx.log` for logging, `ctx.state` for storage
|
|
301
316
|
- [ ] Handlers throw on failure — error factories or plain `Error`, no try/catch
|
|
302
317
|
- [ ] `format()` renders all data the LLM needs — different clients forward different surfaces (Claude Code → `structuredContent`, Claude Desktop → `content[]`); both must carry the same data
|
|
303
|
-
- [ ]
|
|
304
|
-
- [ ]
|
|
305
|
-
- [ ]
|
|
318
|
+
- [ ] If wrapping external API: raw/domain/output schemas reviewed against real upstream sparsity/nullability before finalizing required vs optional fields
|
|
319
|
+
- [ ] If wrapping external API: normalization and `format()` preserve uncertainty; do not fabricate facts from missing upstream Congress.gov data
|
|
320
|
+
- [ ] If wrapping external API: tests include at least one sparse payload case with omitted upstream fields
|
|
306
321
|
- [ ] Registered in `createApp()` arrays (directly or via barrel exports)
|
|
307
322
|
- [ ] Tests use `createMockContext()` from `@cyanheads/mcp-ts-core/testing`
|
|
308
323
|
- [ ] `bun run devcheck` passes
|
package/CLAUDE.md
CHANGED
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
# Agent Protocol
|
|
2
2
|
|
|
3
3
|
**Server:** congressgov-mcp-server
|
|
4
|
-
**Version:** 0.3.
|
|
5
|
-
**Framework:** [@cyanheads/mcp-ts-core](https://www.npmjs.com/package/@cyanheads/mcp-ts-core)
|
|
4
|
+
**Version:** 0.3.21
|
|
5
|
+
**Framework:** [@cyanheads/mcp-ts-core](https://www.npmjs.com/package/@cyanheads/mcp-ts-core) `^0.9.6`
|
|
6
|
+
**Engines:** Bun ≥1.3.0, Node ≥24.0.0
|
|
7
|
+
**MCP SDK:** `@modelcontextprotocol/sdk` ^1.29.0
|
|
8
|
+
**Zod:** ^4.4.3
|
|
6
9
|
|
|
7
10
|
> **Read the framework docs first:** `node_modules/@cyanheads/mcp-ts-core/CLAUDE.md` contains the full API reference — builders, Context, error codes, exports, patterns. This file covers server-specific conventions only.
|
|
8
11
|
|
|
@@ -37,7 +40,7 @@ Tailor suggestions to what's actually missing or stale — don't recite the full
|
|
|
37
40
|
|
|
38
41
|
| Env Var | Required | Description |
|
|
39
42
|
|:--------|:---------|:------------|
|
|
40
|
-
| `CONGRESS_API_KEY` |
|
|
43
|
+
| `CONGRESS_API_KEY` | No | Optional. Defaults to `DEMO_KEY` (30 req/hr). Own key from [api.data.gov](https://api.data.gov/signup/): 1,000 req/hr. |
|
|
41
44
|
| `CONGRESS_API_BASE_URL` | No | Defaults to `https://api.congress.gov/v3` |
|
|
42
45
|
|
|
43
46
|
---
|
|
@@ -240,10 +243,14 @@ When you complete a skill's checklist, check the boxes and add a completion time
|
|
|
240
243
|
| `bun run build` | Compile TypeScript |
|
|
241
244
|
| `bun run rebuild` | Clean + build |
|
|
242
245
|
| `bun run clean` | Remove build artifacts |
|
|
243
|
-
| `bun run devcheck` | Lint + format + typecheck + security |
|
|
246
|
+
| `bun run devcheck` | Lint + format + typecheck + security + changelog sync |
|
|
247
|
+
| `bun run audit:refresh` | Delete `bun.lock`, reinstall, re-audit. Use when `devcheck` flags a transitive advisory — stale lockfile can mask already-patched deps. If advisory survives, it's real. |
|
|
244
248
|
| `bun run tree` | Generate directory structure doc |
|
|
249
|
+
| `bun run list-skills` | List available skills from `.claude/skills/` or `skills/` |
|
|
245
250
|
| `bun run format` | Auto-fix formatting |
|
|
246
251
|
| `bun run lint:mcp` | Validate MCP tool/resource/prompt definitions |
|
|
252
|
+
| `bun run lint:packaging` | Validate env var alignment between `manifest.json` and `server.json` |
|
|
253
|
+
| `bun run bundle` | Build and pack as `.mcpb` for one-click Claude Desktop install |
|
|
247
254
|
| `bun run changelog:build` | Regenerate `CHANGELOG.md` from `changelog/*.md` |
|
|
248
255
|
| `bun run changelog:check` | Verify `CHANGELOG.md` is in sync (used by devcheck) |
|
|
249
256
|
| `bun run test` | Run tests |
|
|
@@ -254,6 +261,14 @@ When you complete a skill's checklist, check the boxes and add a completion time
|
|
|
254
261
|
|
|
255
262
|
---
|
|
256
263
|
|
|
264
|
+
## Bundling
|
|
265
|
+
|
|
266
|
+
`bun run bundle` produces a `.mcpb` extension bundle for one-click install in Claude Desktop. MCPB is stdio-only — HTTP deployments are unaffected. The bundle file ships as `dist/congressgov-mcp-server.mcpb`.
|
|
267
|
+
|
|
268
|
+
**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.
|
|
269
|
+
|
|
270
|
+
---
|
|
271
|
+
|
|
257
272
|
## Changelog
|
|
258
273
|
|
|
259
274
|
Directory-based, grouped by minor series using the `.x` semver-wildcard convention. Source of truth is `changelog/<major.minor>.x/<version>.md` (e.g. `changelog/0.3.x/0.3.13.md`) — one file per released version. At release time, author the per-version file with a concrete version and date, then run `bun run changelog:build` to regenerate the rollup. `changelog/template.md` is a **pristine format reference** — never edited, never renamed, never moved. `CHANGELOG.md` is a **navigation index** (header + link + one-line summary per version), regenerated by `bun run changelog:build`. Devcheck hard-fails on drift. Never hand-edit `CHANGELOG.md`.
|
|
@@ -295,14 +310,14 @@ Remind the user to run these after completing a release flow.
|
|
|
295
310
|
## Checklist
|
|
296
311
|
|
|
297
312
|
- [ ] Zod schemas: all fields have `.describe()`, only JSON-Schema-serializable types (no `z.custom()`, `z.date()`, `z.transform()`, `z.bigint()`, `z.symbol()`, `z.void()`, `z.map()`, `z.set()`, `z.function()`, `z.nan()`)
|
|
298
|
-
- [ ] Optional nested objects: handler guards for empty inner values from form-based clients (`if (input.obj?.field && ...)`, not just `if (input.obj)`)
|
|
313
|
+
- [ ] Optional nested objects: handler guards for empty inner values from form-based clients (`if (input.obj?.field && ...)`, not just `if (input.obj)`). When regex/length constraints matter, use `z.union([z.literal(''), z.string().regex(...).describe(...)])` — literal variants are exempt from `describe-on-fields`.
|
|
299
314
|
- [ ] JSDoc `@fileoverview` + `@module` on every file
|
|
300
315
|
- [ ] `ctx.log` for logging, `ctx.state` for storage
|
|
301
316
|
- [ ] Handlers throw on failure — error factories or plain `Error`, no try/catch
|
|
302
317
|
- [ ] `format()` renders all data the LLM needs — different clients forward different surfaces (Claude Code → `structuredContent`, Claude Desktop → `content[]`); both must carry the same data
|
|
303
|
-
- [ ]
|
|
304
|
-
- [ ]
|
|
305
|
-
- [ ]
|
|
318
|
+
- [ ] If wrapping external API: raw/domain/output schemas reviewed against real upstream sparsity/nullability before finalizing required vs optional fields
|
|
319
|
+
- [ ] If wrapping external API: normalization and `format()` preserve uncertainty; do not fabricate facts from missing upstream Congress.gov data
|
|
320
|
+
- [ ] If wrapping external API: tests include at least one sparse payload case with omitted upstream fields
|
|
306
321
|
- [ ] Registered in `createApp()` arrays (directly or via barrel exports)
|
|
307
322
|
- [ ] Tests use `createMockContext()` from `@cyanheads/mcp-ts-core/testing`
|
|
308
323
|
- [ ] `bun run devcheck` passes
|
package/README.md
CHANGED
|
@@ -7,9 +7,15 @@
|
|
|
7
7
|
|
|
8
8
|
<div align="center">
|
|
9
9
|
|
|
10
|
-
[](./CHANGELOG.md) [](./LICENSE) [](https://github.com/users/cyanheads/packages/container/package/congressgov-mcp-server) [](https://modelcontextprotocol.io/) [](https://www.npmjs.com/package/@cyanheads/congressgov-mcp-server) [](https://www.typescriptlang.org/) [](https://bun.sh/)
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
</div>
|
|
13
|
+
|
|
14
|
+
<div align="center">
|
|
15
|
+
|
|
16
|
+
[](https://github.com/cyanheads/congressgov-mcp-server/releases/latest/download/congressgov-mcp-server.mcpb) [](https://cursor.com/en/install-mcp?name=congressgov-mcp-server&config=eyJjb21tYW5kIjoiYnVueCIsImFyZ3MiOlsiQGN5YW5oZWFkcy9jb25ncmVzc2dvdi1tY3Atc2VydmVyQGxhdGVzdCJdLCJlbnYiOnsiTUNQX1RSQU5TUE9SVF9UWVBFIjoic3RkaW8iLCJDT05HUkVTU19BUElfS0VZIjoiIn19) [](https://vscode.dev/redirect?url=vscode:mcp/install?%7B%22name%22%3A%22congressgov-mcp-server%22%2C%22config%22%3A%7B%22command%22%3A%22bunx%22%2C%22args%22%3A%5B%22%40cyanheads%2Fcongressgov-mcp-server%40latest%22%5D%2C%22env%22%3A%7B%22MCP_TRANSPORT_TYPE%22%3A%22stdio%22%2C%22CONGRESS_API_KEY%22%3A%22%22%7D%7D%7D)
|
|
17
|
+
|
|
18
|
+
[](https://www.npmjs.com/package/@cyanheads/mcp-ts-core)
|
|
13
19
|
|
|
14
20
|
</div>
|
|
15
21
|
|
|
@@ -136,9 +142,9 @@ Built on [`@cyanheads/mcp-ts-core`](https://github.com/cyanheads/mcp-ts-core):
|
|
|
136
142
|
Congress.gov-specific:
|
|
137
143
|
|
|
138
144
|
- Type-safe client for the Congress.gov REST API v3
|
|
139
|
-
-
|
|
145
|
+
- Optional API key from [api.data.gov](https://api.data.gov/signup/) — defaults to `DEMO_KEY` (30 req/hr); own key gets 1,000 req/hr
|
|
140
146
|
- Automatic pagination and response normalization
|
|
141
|
-
- Rate limiting awareness
|
|
147
|
+
- Rate limiting awareness
|
|
142
148
|
- All tools are read-only and idempotent
|
|
143
149
|
|
|
144
150
|
## Getting started
|
|
@@ -194,7 +200,7 @@ Or with npx (no Bun required):
|
|
|
194
200
|
}
|
|
195
201
|
```
|
|
196
202
|
|
|
197
|
-
Get a free API key at [api.data.gov/signup](https://api.data.gov/signup/)
|
|
203
|
+
Get a free API key at [api.data.gov/signup](https://api.data.gov/signup/) for 1,000 req/hr. Without a key the server falls back to `DEMO_KEY` (30 req/hr).
|
|
198
204
|
|
|
199
205
|
### Prerequisites
|
|
200
206
|
|
|
@@ -226,7 +232,7 @@ All configuration is validated at startup via Zod schemas in `src/config/server-
|
|
|
226
232
|
|
|
227
233
|
| Variable | Description | Default |
|
|
228
234
|
|:---|:---|:---|
|
|
229
|
-
| `CONGRESS_API_KEY` |
|
|
235
|
+
| `CONGRESS_API_KEY` | Optional. API key from [api.data.gov](https://api.data.gov/signup/). Omit to use `DEMO_KEY` (30 req/hr); own key: 1,000 req/hr. | `DEMO_KEY` |
|
|
230
236
|
| `CONGRESS_API_BASE_URL` | Congress.gov API base URL | `https://api.congress.gov/v3` |
|
|
231
237
|
| `MCP_TRANSPORT_TYPE` | Transport: `stdio` or `http` | `stdio` |
|
|
232
238
|
| `MCP_HTTP_PORT` | HTTP server port | `3010` |
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
*/
|
|
5
5
|
import { z } from '@cyanheads/mcp-ts-core';
|
|
6
6
|
declare const ServerConfigSchema: z.ZodObject<{
|
|
7
|
-
apiKey: z.ZodString
|
|
7
|
+
apiKey: z.ZodDefault<z.ZodString>;
|
|
8
8
|
baseUrl: z.ZodDefault<z.ZodString>;
|
|
9
9
|
}, z.core.$strip>;
|
|
10
10
|
export type ServerConfig = z.infer<typeof ServerConfigSchema>;
|
|
@@ -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;;;iBAYtB,CAAC;AAEH,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAI9D,wBAAgB,eAAe,IAAI,YAAY,CAM9C"}
|
|
@@ -5,7 +5,10 @@
|
|
|
5
5
|
import { z } from '@cyanheads/mcp-ts-core';
|
|
6
6
|
import { parseEnvConfig } from '@cyanheads/mcp-ts-core/config';
|
|
7
7
|
const ServerConfigSchema = z.object({
|
|
8
|
-
apiKey: z
|
|
8
|
+
apiKey: z
|
|
9
|
+
.string()
|
|
10
|
+
.default('DEMO_KEY')
|
|
11
|
+
.describe('Congress.gov API key from api.data.gov — optional (DEMO_KEY: 30 req/hr, own key: 1000 req/hr)'),
|
|
9
12
|
baseUrl: z
|
|
10
13
|
.string()
|
|
11
14
|
.url()
|
|
@@ -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,MAAM,EAAE,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,MAAM,EAAE,CAAC;SACN,MAAM,EAAE;SACR,OAAO,CAAC,UAAU,CAAC;SACnB,QAAQ,CACP,+FAA+F,CAChG;IACH,OAAO,EAAE,CAAC;SACP,MAAM,EAAE;SACR,GAAG,EAAE;SACL,OAAO,CAAC,6BAA6B,CAAC;SACtC,QAAQ,CAAC,2BAA2B,CAAC;CACzC,CAAC,CAAC;AAIH,IAAI,OAAiC,CAAC;AAEtC,MAAM,UAAU,eAAe;IAC7B,OAAO,KAAK,cAAc,CAAC,kBAAkB,EAAE;QAC7C,MAAM,EAAE,kBAAkB;QAC1B,OAAO,EAAE,uBAAuB;KACjC,CAAC,CAAC;IACH,OAAO,OAAO,CAAC;AACjB,CAAC"}
|
|
@@ -37,5 +37,12 @@ export declare const billLookupTool: import("@cyanheads/mcp-ts-core").ToolDefini
|
|
|
37
37
|
}>>;
|
|
38
38
|
limit: z.ZodDefault<z.ZodNumber>;
|
|
39
39
|
offset: z.ZodDefault<z.ZodNumber>;
|
|
40
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
40
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
41
|
+
data: z.ZodOptional<z.ZodArray<z.ZodObject<{}, z.core.$loose>>>;
|
|
42
|
+
pagination: z.ZodOptional<z.ZodObject<{
|
|
43
|
+
count: z.ZodNumber;
|
|
44
|
+
nextOffset: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
45
|
+
}, z.core.$strip>>;
|
|
46
|
+
query: z.ZodOptional<z.ZodString>;
|
|
47
|
+
}, z.core.$loose>, undefined>;
|
|
41
48
|
//# sourceMappingURL=bill-lookup.tool.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bill-lookup.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/bill-lookup.tool.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"bill-lookup.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/bill-lookup.tool.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;AAiCjD,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;6BA0HzB,CAAC"}
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
import { tool, z } from '@cyanheads/mcp-ts-core';
|
|
6
6
|
import { validationError } from '@cyanheads/mcp-ts-core/errors';
|
|
7
7
|
import { formatBills } from '../../../mcp-server/tools/format-helpers.js';
|
|
8
|
-
import { normalizeOptionalString } from '../../../mcp-server/tools/tool-helpers.js';
|
|
8
|
+
import { buildQueryEcho, listOrDetail, normalizeOptionalString, validateIsoDateTime, } from '../../../mcp-server/tools/tool-helpers.js';
|
|
9
9
|
import { getCongressApi } from '../../../services/congress-api/congress-api-service.js';
|
|
10
10
|
import { BILL_TYPE_CODES } from '../../../services/congress-api/types.js';
|
|
11
11
|
const BillTypeEnum = z.enum(BILL_TYPE_CODES);
|
|
@@ -53,12 +53,12 @@ export const billLookupTool = tool('congressgov_bill_lookup', {
|
|
|
53
53
|
limit: z.number().int().min(1).max(250).default(20).describe('Results per page (1-250).'),
|
|
54
54
|
offset: z.number().int().min(0).default(0).describe('Pagination offset.'),
|
|
55
55
|
}),
|
|
56
|
-
output:
|
|
56
|
+
output: listOrDetail('bill', 'Bill record (sponsor, policy area, latest action, CBO estimates, law citation) for `get`; absent for `list` and sub-resources.'),
|
|
57
57
|
format: formatBills,
|
|
58
58
|
async handler(input, ctx) {
|
|
59
59
|
const api = getCongressApi();
|
|
60
|
-
const fromDateTime = normalizeOptionalString(input.fromDateTime);
|
|
61
|
-
const toDateTime = normalizeOptionalString(input.toDateTime);
|
|
60
|
+
const fromDateTime = validateIsoDateTime(normalizeOptionalString(input.fromDateTime), 'fromDateTime');
|
|
61
|
+
const toDateTime = validateIsoDateTime(normalizeOptionalString(input.toDateTime), 'toDateTime');
|
|
62
62
|
if (input.operation === 'list') {
|
|
63
63
|
const result = await api.listBills({
|
|
64
64
|
congress: input.congress,
|
|
@@ -70,7 +70,15 @@ export const billLookupTool = tool('congressgov_bill_lookup', {
|
|
|
70
70
|
offset: input.offset,
|
|
71
71
|
}, ctx);
|
|
72
72
|
ctx.log.info('Bills listed', { congress: input.congress, count: result.data.length });
|
|
73
|
-
return
|
|
73
|
+
return {
|
|
74
|
+
...result,
|
|
75
|
+
query: buildQueryEcho('bills', {
|
|
76
|
+
congress: input.congress,
|
|
77
|
+
billType: input.billType,
|
|
78
|
+
fromDateTime,
|
|
79
|
+
toDateTime,
|
|
80
|
+
}),
|
|
81
|
+
};
|
|
74
82
|
}
|
|
75
83
|
if (!input.billType || !input.billNumber) {
|
|
76
84
|
throw validationError(`The '${input.operation}' operation requires congress, billType, and billNumber. Use 'list' first to find the bill, then request its ${input.operation}.`, { operation: input.operation, billType: input.billType, billNumber: input.billNumber });
|
|
@@ -103,7 +111,10 @@ export const billLookupTool = tool('congressgov_bill_lookup', {
|
|
|
103
111
|
billNumber: input.billNumber,
|
|
104
112
|
subResource,
|
|
105
113
|
});
|
|
106
|
-
return
|
|
114
|
+
return {
|
|
115
|
+
...result,
|
|
116
|
+
query: buildQueryEcho(`${input.operation} for ${input.billType.toUpperCase()} ${input.billNumber} in the ${input.congress}th Congress`),
|
|
117
|
+
};
|
|
107
118
|
},
|
|
108
119
|
});
|
|
109
120
|
//# sourceMappingURL=bill-lookup.tool.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bill-lookup.tool.js","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/bill-lookup.tool.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,IAAI,EAAE,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,WAAW,KAAK,CAAC,QAAQ,aAAa,CACjH;SACF,CAAC;IACJ,CAAC;CACF,CAAC,CAAC"}
|
|
@@ -19,5 +19,12 @@ export declare const billSummariesTool: import("@cyanheads/mcp-ts-core").ToolDef
|
|
|
19
19
|
toDateTime: z.ZodOptional<z.ZodString>;
|
|
20
20
|
limit: z.ZodDefault<z.ZodNumber>;
|
|
21
21
|
offset: z.ZodDefault<z.ZodNumber>;
|
|
22
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
22
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
23
|
+
data: z.ZodArray<z.ZodObject<{}, z.core.$loose>>;
|
|
24
|
+
pagination: z.ZodObject<{
|
|
25
|
+
count: z.ZodNumber;
|
|
26
|
+
nextOffset: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
27
|
+
}, z.core.$strip>;
|
|
28
|
+
query: z.ZodOptional<z.ZodString>;
|
|
29
|
+
}, z.core.$loose>, undefined>;
|
|
23
30
|
//# sourceMappingURL=bill-summaries.tool.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bill-summaries.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/bill-summaries.tool.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"bill-summaries.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/bill-summaries.tool.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;AAejD,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;6BA2E5B,CAAC"}
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
import { tool, z } from '@cyanheads/mcp-ts-core';
|
|
6
6
|
import { validationError } from '@cyanheads/mcp-ts-core/errors';
|
|
7
7
|
import { formatSummaries } from '../../../mcp-server/tools/format-helpers.js';
|
|
8
|
-
import { normalizeOptionalString } from '../../../mcp-server/tools/tool-helpers.js';
|
|
8
|
+
import { buildQueryEcho, listOutput, normalizeOptionalString, validateIsoDateTime, } from '../../../mcp-server/tools/tool-helpers.js';
|
|
9
9
|
import { getCongressApi } from '../../../services/congress-api/congress-api-service.js';
|
|
10
10
|
import { BILL_TYPE_CODES } from '../../../services/congress-api/types.js';
|
|
11
11
|
const DEFAULT_LOOKBACK_MS = 7 * 24 * 60 * 60 * 1000;
|
|
@@ -31,11 +31,11 @@ export const billSummariesTool = tool('congressgov_bill_summaries', {
|
|
|
31
31
|
limit: z.number().int().min(1).max(250).default(20).describe('Results per page (1-250).'),
|
|
32
32
|
offset: z.number().int().min(0).default(0).describe('Pagination offset.'),
|
|
33
33
|
}),
|
|
34
|
-
output:
|
|
34
|
+
output: listOutput,
|
|
35
35
|
format: formatSummaries,
|
|
36
36
|
async handler(input, ctx) {
|
|
37
|
-
const fromDateTimeInput = normalizeOptionalString(input.fromDateTime);
|
|
38
|
-
const toDateTimeInput = normalizeOptionalString(input.toDateTime);
|
|
37
|
+
const fromDateTimeInput = validateIsoDateTime(normalizeOptionalString(input.fromDateTime), 'fromDateTime');
|
|
38
|
+
const toDateTimeInput = validateIsoDateTime(normalizeOptionalString(input.toDateTime), 'toDateTime');
|
|
39
39
|
if (input.billType && !input.congress) {
|
|
40
40
|
throw validationError("The 'billType' filter requires 'congress'. Provide both or omit billType to browse across all types.", { field: 'congress', billType: input.billType });
|
|
41
41
|
}
|
|
@@ -53,7 +53,15 @@ export const billSummariesTool = tool('congressgov_bill_summaries', {
|
|
|
53
53
|
offset: input.offset,
|
|
54
54
|
}, ctx);
|
|
55
55
|
ctx.log.info('Summaries listed', { count: result.data.length });
|
|
56
|
-
return
|
|
56
|
+
return {
|
|
57
|
+
...result,
|
|
58
|
+
query: buildQueryEcho('bill summaries', {
|
|
59
|
+
congress: input.congress,
|
|
60
|
+
billType: input.billType,
|
|
61
|
+
fromDateTime,
|
|
62
|
+
toDateTime: toDateTimeInput,
|
|
63
|
+
}),
|
|
64
|
+
};
|
|
57
65
|
},
|
|
58
66
|
});
|
|
59
67
|
//# sourceMappingURL=bill-summaries.tool.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bill-summaries.tool.js","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/bill-summaries.tool.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAEhE,OAAO,EAAE,eAAe,EAAE,MAAM,sCAAsC,CAAC;AACvE,OAAO,
|
|
1
|
+
{"version":3,"file":"bill-summaries.tool.js","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/bill-summaries.tool.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAEhE,OAAO,EAAE,eAAe,EAAE,MAAM,sCAAsC,CAAC;AACvE,OAAO,EACL,cAAc,EACd,UAAU,EACV,uBAAuB,EACvB,mBAAmB,GACpB,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EAAE,cAAc,EAAE,MAAM,iDAAiD,CAAC;AACjF,OAAO,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAC;AAEnE,MAAM,mBAAmB,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC;AAEpD,MAAM,CAAC,MAAM,iBAAiB,GAAG,IAAI,CAAC,4BAA4B,EAAE;IAClE,WAAW,EAAE,2jBAA2jB;IACxkB,WAAW,EAAE,EAAE,YAAY,EAAE,IAAI,EAAE,cAAc,EAAE,IAAI,EAAE,aAAa,EAAE,IAAI,EAAE;IAC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EAAE,UAAU,EAAE,QAAQ,EAAE,KAAK,CAAC,QAAQ,EAAE,CAChD,CAAC;QACJ,CAAC;QAED,MAAM,YAAY,GAChB,iBAAiB;YACjB,CAAC,CAAC,eAAe;gBACf,CAAC,CAAC,IAAI,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,mBAAmB,CAAC,CAAC,WAAW,EAAE,CAAC,OAAO,CAAC,WAAW,EAAE,GAAG,CAAC;gBACpF,CAAC,CAAC,SAAS,CAAC,CAAC;QAEjB,MAAM,GAAG,GAAG,cAAc,EAAE,CAAC;QAC7B,MAAM,MAAM,GAAG,MAAM,GAAG,CAAC,aAAa,CACpC;YACE,QAAQ,EAAE,KAAK,CAAC,QAAQ;YACxB,QAAQ,EAAE,KAAK,CAAC,QAAQ;YACxB,YAAY;YACZ,UAAU,EAAE,eAAe;YAC3B,KAAK,EAAE,KAAK,CAAC,KAAK;YAClB,MAAM,EAAE,KAAK,CAAC,MAAM;SACrB,EACD,GAAG,CACJ,CAAC;QACF,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,kBAAkB,EAAE,EAAE,KAAK,EAAE,MAAM,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC,CAAC;QAChE,OAAO;YACL,GAAG,MAAM;YACT,KAAK,EAAE,cAAc,CAAC,gBAAgB,EAAE;gBACtC,QAAQ,EAAE,KAAK,CAAC,QAAQ;gBACxB,QAAQ,EAAE,KAAK,CAAC,QAAQ;gBACxB,YAAY;gBACZ,UAAU,EAAE,eAAe;aAC5B,CAAC;SACH,CAAC;IACJ,CAAC;CACF,CAAC,CAAC"}
|
|
@@ -24,5 +24,12 @@ export declare const committeeLookupTool: import("@cyanheads/mcp-ts-core").ToolD
|
|
|
24
24
|
recent: "recent";
|
|
25
25
|
oldest: "oldest";
|
|
26
26
|
}>>;
|
|
27
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
27
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
28
|
+
data: z.ZodOptional<z.ZodArray<z.ZodObject<{}, z.core.$loose>>>;
|
|
29
|
+
pagination: z.ZodOptional<z.ZodObject<{
|
|
30
|
+
count: z.ZodNumber;
|
|
31
|
+
nextOffset: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
32
|
+
}, z.core.$strip>>;
|
|
33
|
+
query: z.ZodOptional<z.ZodString>;
|
|
34
|
+
}, z.core.$loose>, undefined>;
|
|
28
35
|
//# sourceMappingURL=committee-lookup.tool.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"committee-lookup.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/committee-lookup.tool.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"committee-lookup.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/committee-lookup.tool.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;AAiBjD,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;6BAmH9B,CAAC"}
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
import { tool, z } from '@cyanheads/mcp-ts-core';
|
|
6
6
|
import { validationError } from '@cyanheads/mcp-ts-core/errors';
|
|
7
7
|
import { formatCommittees } from '../../../mcp-server/tools/format-helpers.js';
|
|
8
|
+
import { buildQueryEcho, listOrDetail } from '../../../mcp-server/tools/tool-helpers.js';
|
|
8
9
|
import { getCongressApi } from '../../../services/congress-api/congress-api-service.js';
|
|
9
10
|
/** Committee codes carry chamber in the first letter (h=House, s=Senate, j=Joint). */
|
|
10
11
|
function inferChamberFromCode(code) {
|
|
@@ -18,7 +19,7 @@ function inferChamberFromCode(code) {
|
|
|
18
19
|
return;
|
|
19
20
|
}
|
|
20
21
|
export const committeeLookupTool = tool('congressgov_committee_lookup', {
|
|
21
|
-
description: `Browse congressional committees and their legislation, reports, and nominations. Committee codes follow the pattern chamber-prefix (h/s/j) + abbreviation + number — use 'list' to discover codes, then 'get' or drill into 'bills', 'reports', or 'nominations' ('nominations' is Senate-only). 'get' and sub-resources only need committeeCode (chamber is inferred from the prefix); pass chamber explicitly to override. The 'bills' sub-resource defaults to 'recent' order (newest update-date first); pass order='oldest' for ascending update-date order.`,
|
|
22
|
+
description: `Browse congressional committees and their legislation, reports, and nominations. Committee codes follow the pattern chamber-prefix (h/s/j) + abbreviation + number — use 'list' to discover codes, then 'get' or drill into 'bills', 'reports', or 'nominations' ('nominations' is Senate-only). 'get' and sub-resources only need committeeCode (chamber is inferred from the prefix); pass chamber explicitly to override. The 'bills' sub-resource defaults to 'recent' order (newest update-date first); pass order='oldest' for ascending update-date order. Upstream omits bill titles from the 'bills' sub-resource — rows carry only {congress, billType, billNumber, actionDate, relationshipType, url}; chain 'congressgov_bill_lookup get' per row to retrieve titles and policy area.`,
|
|
22
23
|
annotations: { readOnlyHint: true, idempotentHint: true, openWorldHint: true },
|
|
23
24
|
input: z.object({
|
|
24
25
|
operation: z
|
|
@@ -40,7 +41,7 @@ export const committeeLookupTool = tool('congressgov_committee_lookup', {
|
|
|
40
41
|
.default('recent')
|
|
41
42
|
.describe("Sort order for the 'bills' sub-resource. 'recent' (default) returns newest update-date first; 'oldest' returns ascending update-date order. Ignored by other operations."),
|
|
42
43
|
}),
|
|
43
|
-
output:
|
|
44
|
+
output: listOrDetail('committee', 'Committee record for `get` (name, chamber, subcommittees, history, sub-resource counts); absent for `list` and sub-resources.'),
|
|
44
45
|
format: formatCommittees,
|
|
45
46
|
async handler(input, ctx) {
|
|
46
47
|
const api = getCongressApi();
|
|
@@ -52,7 +53,13 @@ export const committeeLookupTool = tool('congressgov_committee_lookup', {
|
|
|
52
53
|
offset: input.offset,
|
|
53
54
|
}, ctx);
|
|
54
55
|
ctx.log.info('Committees listed', { count: result.data.length });
|
|
55
|
-
return
|
|
56
|
+
return {
|
|
57
|
+
...result,
|
|
58
|
+
query: buildQueryEcho('committees', {
|
|
59
|
+
congress: input.congress,
|
|
60
|
+
chamber: input.chamber,
|
|
61
|
+
}),
|
|
62
|
+
};
|
|
56
63
|
}
|
|
57
64
|
if (!input.committeeCode) {
|
|
58
65
|
throw validationError(`The '${input.operation}' operation requires committeeCode. Use 'list' to discover available committees.`, { operation: input.operation, committeeCode: input.committeeCode });
|
|
@@ -88,7 +95,10 @@ export const committeeLookupTool = tool('congressgov_committee_lookup', {
|
|
|
88
95
|
committeeCode: input.committeeCode,
|
|
89
96
|
subResource: input.operation,
|
|
90
97
|
});
|
|
91
|
-
return
|
|
98
|
+
return {
|
|
99
|
+
...result,
|
|
100
|
+
query: buildQueryEcho(`${input.operation} for committee ${input.committeeCode}`),
|
|
101
|
+
};
|
|
92
102
|
},
|
|
93
103
|
});
|
|
94
104
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"committee-lookup.tool.js","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/committee-lookup.tool.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAEhE,OAAO,EAAE,gBAAgB,EAAE,MAAM,sCAAsC,CAAC;AACxE,OAAO,EAAE,cAAc,EAAE,MAAM,iDAAiD,CAAC;AAGjF,sFAAsF;AACtF,SAAS,oBAAoB,CAAC,IAAY;IACxC,MAAM,KAAK,GAAG,IAAI,CAAC,CAAC,CAAC,EAAE,WAAW,EAAE,CAAC;IACrC,IAAI,KAAK,KAAK,GAAG;QAAE,OAAO,QAAQ,CAAC;IACnC,IAAI,KAAK,KAAK,GAAG;QAAE,OAAO,OAAO,CAAC;IAClC,IAAI,KAAK,KAAK,GAAG;QAAE,OAAO,OAAO,CAAC;IAClC,OAAO;AACT,CAAC;AAED,MAAM,CAAC,MAAM,mBAAmB,GAAG,IAAI,CAAC,8BAA8B,EAAE;IACtE,WAAW,EAAE,
|
|
1
|
+
{"version":3,"file":"committee-lookup.tool.js","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/committee-lookup.tool.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAEhE,OAAO,EAAE,gBAAgB,EAAE,MAAM,sCAAsC,CAAC;AACxE,OAAO,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,oCAAoC,CAAC;AAClF,OAAO,EAAE,cAAc,EAAE,MAAM,iDAAiD,CAAC;AAGjF,sFAAsF;AACtF,SAAS,oBAAoB,CAAC,IAAY;IACxC,MAAM,KAAK,GAAG,IAAI,CAAC,CAAC,CAAC,EAAE,WAAW,EAAE,CAAC;IACrC,IAAI,KAAK,KAAK,GAAG;QAAE,OAAO,QAAQ,CAAC;IACnC,IAAI,KAAK,KAAK,GAAG;QAAE,OAAO,OAAO,CAAC;IAClC,IAAI,KAAK,KAAK,GAAG;QAAE,OAAO,OAAO,CAAC;IAClC,OAAO;AACT,CAAC;AAED,MAAM,CAAC,MAAM,mBAAmB,GAAG,IAAI,CAAC,8BAA8B,EAAE;IACtE,WAAW,EAAE,mwBAAmwB;IAChxB,WAAW,EAAE,EAAE,YAAY,EAAE,IAAI,EAAE,cAAc,EAAE,IAAI,EAAE,aAAa,EAAE,IAAI,EAAE;IAC9E,KAAK,EAAE,CAAC,CAAC,MAAM,CAAC;QACd,SAAS,EAAE,CAAC;aACT,IAAI,CAAC,CAAC,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,SAAS,EAAE,aAAa,CAAC,CAAC;aACxD,QAAQ,CAAC,yBAAyB,CAAC;QACtC,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,Q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T,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,UAAU,EAAE;KACzC,CAAC;AACJ,CAAC"}
|
|
@@ -18,5 +18,12 @@ export declare const committeeReportsTool: import("@cyanheads/mcp-ts-core").Tool
|
|
|
18
18
|
reportNumber: z.ZodOptional<z.ZodNumber>;
|
|
19
19
|
limit: z.ZodDefault<z.ZodNumber>;
|
|
20
20
|
offset: z.ZodDefault<z.ZodNumber>;
|
|
21
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
21
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
22
|
+
data: z.ZodOptional<z.ZodArray<z.ZodObject<{}, z.core.$loose>>>;
|
|
23
|
+
pagination: z.ZodOptional<z.ZodObject<{
|
|
24
|
+
count: z.ZodNumber;
|
|
25
|
+
nextOffset: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
26
|
+
}, z.core.$strip>>;
|
|
27
|
+
query: z.ZodOptional<z.ZodString>;
|
|
28
|
+
}, z.core.$loose>, undefined>;
|
|
22
29
|
//# sourceMappingURL=committee-reports.tool.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"committee-reports.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/committee-reports.tool.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"committee-reports.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/committee-reports.tool.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;AAOjD,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;6BA8F/B,CAAC"}
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
import { tool, z } from '@cyanheads/mcp-ts-core';
|
|
6
6
|
import { validationError } from '@cyanheads/mcp-ts-core/errors';
|
|
7
7
|
import { formatCommitteeReports } from '../../../mcp-server/tools/format-helpers.js';
|
|
8
|
+
import { buildQueryEcho, listOrDetail } from '../../../mcp-server/tools/tool-helpers.js';
|
|
8
9
|
import { getCongressApi } from '../../../services/congress-api/congress-api-service.js';
|
|
9
10
|
export const committeeReportsTool = tool('congressgov_committee_reports', {
|
|
10
11
|
description: `Browse and retrieve committee reports from Congress.gov — reports accompany legislation reported out of committee and explain the bill's purpose, committee amendments, dissenting views, and the committee vote. Report types are 'hrpt' (House), 'srpt' (Senate), and 'erpt' (Executive).`,
|
|
@@ -25,7 +26,7 @@ export const committeeReportsTool = tool('congressgov_committee_reports', {
|
|
|
25
26
|
limit: z.number().int().min(1).max(250).default(20).describe('Results per page (1-250).'),
|
|
26
27
|
offset: z.number().int().min(0).default(0).describe('Pagination offset.'),
|
|
27
28
|
}),
|
|
28
|
-
output:
|
|
29
|
+
output: listOrDetail('report', "the committee report (citation, title, committees, associated bill); for `text`, an alternative key 'text' carries an array of {type, url} format links."),
|
|
29
30
|
format: formatCommitteeReports,
|
|
30
31
|
async handler(input, ctx) {
|
|
31
32
|
const api = getCongressApi();
|
|
@@ -40,7 +41,13 @@ export const committeeReportsTool = tool('congressgov_committee_reports', {
|
|
|
40
41
|
congress: input.congress,
|
|
41
42
|
count: result.data.length,
|
|
42
43
|
});
|
|
43
|
-
return
|
|
44
|
+
return {
|
|
45
|
+
...result,
|
|
46
|
+
query: buildQueryEcho('committee reports', {
|
|
47
|
+
congress: input.congress,
|
|
48
|
+
reportType: input.reportType,
|
|
49
|
+
}),
|
|
50
|
+
};
|
|
44
51
|
}
|
|
45
52
|
if (!input.reportType || !input.reportNumber) {
|
|
46
53
|
throw validationError(`The '${input.operation}' operation requires reportType and reportNumber. Use 'list' to browse available reports.`, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"committee-reports.tool.js","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/committee-reports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/mcp-ts-core").ToolDefini
|
|
|
11
11
|
reportNumber: z.ZodOptional<z.ZodString>;
|
|
12
12
|
limit: z.ZodDefault<z.ZodNumber>;
|
|
13
13
|
offset: z.ZodDefault<z.ZodNumber>;
|
|
14
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
14
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
15
|
+
data: z.ZodOptional<z.ZodArray<z.ZodObject<{}, z.core.$loose>>>;
|
|
16
|
+
pagination: z.ZodOptional<z.ZodObject<{
|
|
17
|
+
count: z.ZodNumber;
|
|
18
|
+
nextOffset: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
19
|
+
}, z.core.$strip>>;
|
|
20
|
+
query: z.ZodOptional<z.ZodString>;
|
|
21
|
+
}, z.core.$loose>, undefined>;
|
|
15
22
|
//# sourceMappingURL=crs-reports.tool.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"crs-reports.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/crs-reports.tool.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"crs-reports.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/crs-reports.tool.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;AAOjD,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;6BAsCzB,CAAC"}
|