@cyanheads/congressgov-mcp-server 0.9.0 → 0.9.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (80) hide show
  1. package/AGENTS.md +25 -10
  2. package/CLAUDE.md +25 -10
  3. package/README.md +10 -5
  4. package/changelog/0.9.x/0.9.1.md +31 -0
  5. package/dist/config/server-config.d.ts +0 -7
  6. package/dist/config/server-config.d.ts.map +1 -1
  7. package/dist/config/server-config.js +1 -9
  8. package/dist/config/server-config.js.map +1 -1
  9. package/dist/mcp-server/tools/definitions/bill-lookup.tool.d.ts +9 -2
  10. package/dist/mcp-server/tools/definitions/bill-lookup.tool.d.ts.map +1 -1
  11. package/dist/mcp-server/tools/definitions/bill-summaries.tool.d.ts +9 -2
  12. package/dist/mcp-server/tools/definitions/bill-summaries.tool.d.ts.map +1 -1
  13. package/dist/mcp-server/tools/definitions/committee-lookup.tool.d.ts +9 -2
  14. package/dist/mcp-server/tools/definitions/committee-lookup.tool.d.ts.map +1 -1
  15. package/dist/mcp-server/tools/definitions/committee-reports.tool.d.ts +9 -2
  16. package/dist/mcp-server/tools/definitions/committee-reports.tool.d.ts.map +1 -1
  17. package/dist/mcp-server/tools/definitions/crs-reports.tool.d.ts +9 -2
  18. package/dist/mcp-server/tools/definitions/crs-reports.tool.d.ts.map +1 -1
  19. package/dist/mcp-server/tools/definitions/daily-record.tool.d.ts +9 -2
  20. package/dist/mcp-server/tools/definitions/daily-record.tool.d.ts.map +1 -1
  21. package/dist/mcp-server/tools/definitions/enacted-laws.tool.d.ts +9 -2
  22. package/dist/mcp-server/tools/definitions/enacted-laws.tool.d.ts.map +1 -1
  23. package/dist/mcp-server/tools/definitions/member-lookup.tool.d.ts +9 -2
  24. package/dist/mcp-server/tools/definitions/member-lookup.tool.d.ts.map +1 -1
  25. package/dist/mcp-server/tools/definitions/roll-votes.tool.d.ts +9 -2
  26. package/dist/mcp-server/tools/definitions/roll-votes.tool.d.ts.map +1 -1
  27. package/dist/mcp-server/tools/definitions/roll-votes.tool.js +3 -2
  28. package/dist/mcp-server/tools/definitions/roll-votes.tool.js.map +1 -1
  29. package/dist/mcp-server/tools/definitions/senate-nominations.tool.d.ts +49 -4
  30. package/dist/mcp-server/tools/definitions/senate-nominations.tool.d.ts.map +1 -1
  31. package/dist/mcp-server/tools/definitions/senate-nominations.tool.js +102 -5
  32. package/dist/mcp-server/tools/definitions/senate-nominations.tool.js.map +1 -1
  33. package/dist/mcp-server/tools/format-helpers.d.ts.map +1 -1
  34. package/dist/mcp-server/tools/format-helpers.js +37 -8
  35. package/dist/mcp-server/tools/format-helpers.js.map +1 -1
  36. package/dist/mcp-server/tools/tool-helpers.d.ts +11 -4
  37. package/dist/mcp-server/tools/tool-helpers.d.ts.map +1 -1
  38. package/dist/mcp-server/tools/tool-helpers.js +12 -4
  39. package/dist/mcp-server/tools/tool-helpers.js.map +1 -1
  40. package/dist/services/call-budget.d.ts +77 -0
  41. package/dist/services/call-budget.d.ts.map +1 -0
  42. package/dist/services/call-budget.js +118 -0
  43. package/dist/services/call-budget.js.map +1 -0
  44. package/dist/services/congress-api/congress-api-service.d.ts +4 -0
  45. package/dist/services/congress-api/congress-api-service.d.ts.map +1 -1
  46. package/dist/services/congress-api/congress-api-service.js +60 -32
  47. package/dist/services/congress-api/congress-api-service.js.map +1 -1
  48. package/dist/services/congress-documents/congress-documents-service.d.ts +46 -15
  49. package/dist/services/congress-documents/congress-documents-service.d.ts.map +1 -1
  50. package/dist/services/congress-documents/congress-documents-service.js +95 -24
  51. package/dist/services/congress-documents/congress-documents-service.js.map +1 -1
  52. package/dist/services/congress-documents/document-body-cache.d.ts +66 -0
  53. package/dist/services/congress-documents/document-body-cache.d.ts.map +1 -0
  54. package/dist/services/congress-documents/document-body-cache.js +122 -0
  55. package/dist/services/congress-documents/document-body-cache.js.map +1 -0
  56. package/dist/services/congress-mirror/ingest.d.ts +13 -7
  57. package/dist/services/congress-mirror/ingest.d.ts.map +1 -1
  58. package/dist/services/congress-mirror/ingest.js +33 -10
  59. package/dist/services/congress-mirror/ingest.js.map +1 -1
  60. package/dist/services/congress-mirror/schema.d.ts.map +1 -1
  61. package/dist/services/congress-mirror/schema.js +15 -1
  62. package/dist/services/congress-mirror/schema.js.map +1 -1
  63. package/dist/services/senate-lis/parse.d.ts +23 -0
  64. package/dist/services/senate-lis/parse.d.ts.map +1 -1
  65. package/dist/services/senate-lis/parse.js +49 -5
  66. package/dist/services/senate-lis/parse.js.map +1 -1
  67. package/dist/services/senate-lis/senate-vote-service.d.ts.map +1 -1
  68. package/dist/services/senate-lis/senate-vote-service.js +32 -25
  69. package/dist/services/senate-lis/senate-vote-service.js.map +1 -1
  70. package/dist/utils/congress-calendar.d.ts +15 -0
  71. package/dist/utils/congress-calendar.d.ts.map +1 -0
  72. package/dist/utils/congress-calendar.js +33 -0
  73. package/dist/utils/congress-calendar.js.map +1 -0
  74. package/package.json +3 -3
  75. package/scripts/_mirror-context.ts +15 -9
  76. package/scripts/congress-mirror-init.ts +1 -1
  77. package/scripts/congress-mirror-refresh.ts +1 -1
  78. package/scripts/congress-mirror-verify.ts +5 -4
  79. package/server.json +3 -3
  80. package/skills/congressgov-guide/SKILL.md +1 -1
package/AGENTS.md CHANGED
@@ -1,7 +1,7 @@
1
1
  # Agent Protocol
2
2
 
3
3
  **Server:** congressgov-mcp-server
4
- **Version:** 0.9.0
4
+ **Version:** 0.9.1
5
5
  **Framework:** [@cyanheads/mcp-ts-core](https://www.npmjs.com/package/@cyanheads/mcp-ts-core) `^0.13.18`
6
6
  **Engines:** Bun ≥1.4.0, Node ≥24.0.0
7
7
  **MCP SDK:** `@modelcontextprotocol/server` ^2.4.0
@@ -74,7 +74,7 @@ Tailor suggestions to what's actually missing or stale — don't recite the full
74
74
  | `congressgov_member_lookup` | Discover members by state/district/congress, retrieve legislative portfolios |
75
75
  | `congressgov_committee_lookup` | Browse committees and retrieve legislation, reports, nominations |
76
76
  | `congressgov_roll_votes` | Retrieve House and Senate roll call votes and member voting positions |
77
- | `congressgov_senate_nominations` | Browse presidential nominations, track Senate confirmation pipeline |
77
+ | `congressgov_senate_nominations` | Browse presidential nominations, track Senate confirmation pipeline; an action citing its own Senate record vote (`actions` rows, `latestAction` on `list`/`get`) carries `rollVote`, the `congressgov_roll_votes` arguments for it, from the 101st Congress on |
78
78
  | `congressgov_bill_summaries` | Browse recent CRS bill summaries — the "what's happening" feed, bounded by the shared summary page budget and per-row text window |
79
79
  | `congressgov_crs_reports` | Browse and retrieve nonpartisan CRS policy analysis reports |
80
80
  | `congressgov_committee_reports` | Browse and retrieve committee reports accompanying legislation + bounded report text via `content` |
@@ -111,11 +111,13 @@ src/
111
111
  config/
112
112
  server-config.ts # CONGRESS_API_KEY, base URL (Zod schema)
113
113
  services/
114
+ call-budget.ts # One 50 s upstream budget per tool call / resource read, shared by the three HTTP services
114
115
  congress-api/
115
116
  congress-api-service.ts # API client — auth, pagination, rate limiting
116
117
  types.ts # API response types
117
118
  congress-documents/
118
- congress-documents-service.ts # www.congress.gov document fetch — host allowlist, byte ceiling, character window
119
+ congress-documents-service.ts # www.congress.gov document fetch — host allowlist, byte ceiling, call budget, character window
120
+ document-body-cache.ts # Process-local LRU of decompressed bodies — one fetch per document per TTL
119
121
  document-formats.ts # Format label → URL resolution over upstream format lists
120
122
  extract-text.ts # GPO `<pre>` / XML body → deterministic plain text
121
123
  extract-text-stream.ts # Incremental twin of extract-text.ts — one character window, constant memory
@@ -128,7 +130,7 @@ src/
128
130
  types.ts # Mirror row, search filters, search page types
129
131
  senate-lis/
130
132
  senate-vote-service.ts # Senate LIS XML client — fetch, retry, not-found
131
- parse.ts # pure XML → domain parsers (fast-xml-parser)
133
+ parse.ts # pure XML → domain parsers (fast-xml-parser); Senate vote coverage, session for a date
132
134
  types.ts # Senate vote domain types
133
135
  mcp-server/
134
136
  tools/definitions/
@@ -154,6 +156,7 @@ src/
154
156
  legislative-research.prompt.ts # congressgov_legislative_research
155
157
  utils/
156
158
  character-references.ts # Single-pass HTML/XML character-reference decoding
159
+ congress-calendar.ts # ordinal(), congressFirstYear(), currentCongressNumber() — congress numbering arithmetic
157
160
  scripts/
158
161
  _mirror-context.ts # Shared bootstrap for the mirror lifecycle CLI scripts
159
162
  congress-mirror-init.ts # mirror:init — full out-of-band mirror build
@@ -167,6 +170,12 @@ scripts/
167
170
 
168
171
  Four services. `CongressApiService` backs nine tools and the House branch of `congressgov_roll_votes`; `SenateVoteService` backs only the Senate branch of `congressgov_roll_votes` (the Congress.gov API exposes no Senate vote namespace); `CongressMirrorService` backs `congressgov_search_bills` only; `CongressDocumentsService` backs the `content` operation on `congressgov_bill_lookup`, `congressgov_committee_reports`, and `congressgov_daily_record`.
169
172
 
173
+ **Call budget** (`call-budget.ts`, `withCallBudget`) — every upstream request a tool call or resource read makes through `CongressApiService`, `SenateVoteService`, or `CongressDocumentsService` spends one 50 s budget (`CALL_BUDGET_MS`) counted from the call's start (`ctx.timestamp`), so chained and parallel requests (a roster paged four times, a `content` lookup and then its document) end together before the 60 s default MCP client timeout:
174
+ - Each request's retry ladder gets what is left as `withRetry` `deadlineMs`; each attempt's timeout (10 s API, 12 s Senate, 30 s document) is clamped to the remainder and its I/O carries the budget's signal
175
+ - A backoff the remainder cannot hold fails at once as the expiry; a `Retry-After` wait it cannot hold fails at once with the upstream's own error and `retryAfter`; a request the spent budget cannot cover is never sent
176
+ - Running out is `Timeout`, reason `upstream_timeout`, with `budgetMs` and `retryAttempts`. A caller abort stays `RequestCancelled`, and a 429 is still never retried
177
+ - Services read the budget from the handler's own `ctx` — pass it to every service call, never a context derived from it (that carries a later timestamp). A request with no `ctx` — the mirror ingester and the `mirror:*` scripts — runs the plain per-request ladder, unbudgeted
178
+
170
179
  **`CongressApiService`** — wraps the Congress.gov REST API v3:
171
180
  - API key via `X-Api-Key` header (never logged; kept out of the URL so it can't leak in upstream error messages)
172
181
  - Pagination: `offset` + `limit` query params, max 250 per request
@@ -179,18 +188,22 @@ Four services. `CongressApiService` backs nine tools and the House branch of `co
179
188
  - The whole session menu is one file; each vote's roster ships inline — pagination is client-side
180
189
  - The host returns HTTP 200 with an HTML page for unknown congress/session/vote, so "not found" is detected from the body, not the status code
181
190
  - Party totals are derived from the roster (the feed publishes none)
191
+ - senate.gov's firewall answers automated clients with HTTP 403, and a retry meets the same refusal: a 403 fails on the first attempt as `upstream_error` with `retryable: false` and a hint that House votes are unaffected, while a 5xx or timeout is retried within the call budget
182
192
 
183
193
  **`CongressDocumentsService`** — reads the document bodies behind Congress.gov's format URLs (`www.congress.gov`):
184
194
  - A second host, so a sibling service rather than a method on `CongressApiService` — no API key, no JSON, and enrolled omnibus bills that run to ten megabytes
185
195
  - URLs are resolved from upstream format metadata and checked against a `www.congress.gov` allowlist; a caller never supplies one
186
- - The fetch is bounded: a 25 MB ceiling (refused on `Content-Length`, else mid-stream), a 30s deadline, and a content-type allowlist
187
- - The body is extracted as it streams and only the requested window is retained, so a read's live set is flat in the size of the document (transient allocation is not — peak RSS runs above a buffered read); the ceiling bounds how long a response may run, not how much of one fits in a buffer
196
+ - The fetch is bounded: a 25 MB ceiling (refused on `Content-Length`, else mid-stream), a content-type allowlist, and the call budget (above) — the api.congress.gov format lookup the handler makes first spends from it, and the document attempts and backoff share what is left
197
+ - The body is extracted as it streams and only the requested window is extracted into memory; the ceiling bounds how long a response may run, not how much of one fits in a buffer (transient allocation still scales with the body — peak RSS runs above a buffered read)
198
+ - A document that runs past its window keeps its decompressed body in `DocumentBodyCache` — process-local, one cache for every tenant (each body is public and fetched without credentials), 64 MB LRU, 16 MB per body (a larger one is captured until it passes that and then dropped), 10-minute TTL from insert — and later windows replay those bytes through the same extractor in 128 KiB slices with a macrotask between them: one fetch per document per TTL, and a replay never spends the budget. A window that reaches the end of its document caches nothing, a cancelled read caches nothing, and concurrent cold reads each fetch (no single-flight)
188
199
  - The structured response is bounded by an exact character window — `structuredContent.content.text` and its offsets index the extracted plain text and are never snapped to section breaks, so feeding `nextOffset` back walks a document with no overlap and no gap; `content[]` wraps that unchanged window in a dynamically safe Markdown fence for presentation
189
200
  - `extract-text.ts` unwraps GPO's `<pre>` print output verbatim (whitespace is the document's structure), while no-`<pre>` XML gains one space only at an otherwise-unseparated sibling close→open element boundary; both readings decode character references through `src/utils/character-references.ts` — the one decoder every HTML/XML → text path in the server shares, single-pass so an escaped reference stays escaped — and `extract-text-stream.ts` is their incremental twin, pinned byte-for-byte against the whole-string extractor
190
201
 
191
202
  **`CongressMirrorService`** — local SQLite FTS5 mirror of bill title + CRS summary text, backing `congressgov_search_bills` only:
192
203
  - Opt-in via `CONGRESS_MIRROR_ENABLED` (off by default); built out-of-band via the `mirror:init`/`mirror:refresh` scripts, never on server startup
193
204
  - No live-API fallback — ingests through the existing `CongressApiService`, and a mirror that hasn't finished its initial build returns an empty result with a notice, not an error
205
+ - Every sync re-walks each congress's whole summaries list, requested from January 1 of the congress's first year with no end date (without `fromDateTime`, Congress.gov returns only the last day's summaries); the `updateDate` checkpoint is persisted only once the whole walk finishes; store spec `version: 2` migrates an older store by clearing its checkpoint, so the next sync backfills
206
+ - The `mirror:*` scripts initialize the framework logger: log lines go to stderr as JSON, stdout carries only the script's own output
194
207
  - `createApp({ teardown })` stops the refresh schedule, cancels and awaits an active refresh, then closes the SQLite mirror. With `MCP_SESSION_MODE` unset, HTTP defaults to stateless; an explicit `MCP_SESSION_MODE` value still overrides it. No handler uses `ctx.requestInput`.
195
208
 
196
209
  **Usage in tools:**
@@ -199,7 +212,7 @@ import { getCongressApi } from '@/services/congress-api/congress-api-service.js'
199
212
 
200
213
  async handler(input, ctx) {
201
214
  const api = getCongressApi();
202
- const bills = await api.listBills({ congress: input.congress, limit: input.limit });
215
+ const bills = await api.listBills({ congress: input.congress, limit: input.limit }, ctx);
203
216
  ctx.log.info('Bills fetched', { congress: input.congress, count: bills.bills.length });
204
217
  return bills;
205
218
  }
@@ -216,11 +229,13 @@ All tools share these patterns. The service layer handles them uniformly:
216
229
  | Condition | Error |
217
230
  |:----------|:------|
218
231
  | Rate limit hit | `rateLimited(...)` with `rate_limited`, credential/shared-quota guidance and upstream `Retry-After` when supplied |
219
- | Deadline or HTTP timeout | `Timeout` (-32004), `upstream_timeout`; HTTP responses retain status |
220
- | API unavailable (5xx) | `serviceUnavailable('Congress.gov API returned HTTP {status}.')` |
232
+ | Attempt timeout, call budget spent, or HTTP timeout response | `Timeout` (-32004), `upstream_timeout`; a spent budget names it (`{upstream} did not deliver {request} within this call's 50-second budget for upstream requests (N attempts).`) and carries `budgetMs`/`retryAttempts`; HTTP responses retain status |
233
+ | API unavailable (5xx) | `ServiceUnavailable` (-32000), `upstream_error`: `Congress.gov returned an unexpected error (HTTP {status}).`; a 501 carries `retryable: false` |
221
234
  | Entity not found (404) | `notFound('{entity} not found', { ...identifiers })` |
235
+ | Upstream rejects the request (400, 401, 402, 403, 422) | `invalidParams('Congress.gov rejected the request as malformed (HTTP {status}).')`, `invalid_request` |
236
+ | Rejected API key (401/403 whose body carries an api.data.gov `API_KEY_*` code) | `configurationError(...)` (-32008), `api_key_rejected`, `retryable: false`, gateway code in `data.upstreamCode` and the message; the hint tells the operator to replace or unset `CONGRESS_API_KEY` and never echoes the key. Classified on the body code, since a malformed path segment is also a plain 403 (#34) |
222
237
  | Invalid params | `validationError('...', { field })` |
223
- | Network error | `serviceUnavailable('Unable to reach the Congress.gov API.')` |
238
+ | Network error | `ServiceUnavailable` (-32000), `upstream_error`: `Congress.gov returned an unexpected error.` |
224
239
 
225
240
  The `content` operation adds `documentErrorContracts` (tool-helpers) on top: `document_unavailable`, `format_unavailable`, `document_fetch_failed`, `document_too_large`, and `offset_past_end` — the last of which `congressgov_bill_lookup` also raises from its `summaries` branch when `characterOffset` is past the end of every returned row's text. `CongressDocumentsService` raises each with a matching `data.reason`; the framework fills the declared `recovery` hint when the throw carries none, service throws included. Explicit recovery overrides win. A direct `definition.handler(...)` test sees the throw unchanged; retain `ctx.recoveryFor` where such a test asserts the hint, or assert the filled hint through `runToolContract`.
226
241
 
package/CLAUDE.md CHANGED
@@ -1,7 +1,7 @@
1
1
  # Agent Protocol
2
2
 
3
3
  **Server:** congressgov-mcp-server
4
- **Version:** 0.9.0
4
+ **Version:** 0.9.1
5
5
  **Framework:** [@cyanheads/mcp-ts-core](https://www.npmjs.com/package/@cyanheads/mcp-ts-core) `^0.13.18`
6
6
  **Engines:** Bun ≥1.4.0, Node ≥24.0.0
7
7
  **MCP SDK:** `@modelcontextprotocol/server` ^2.4.0
@@ -74,7 +74,7 @@ Tailor suggestions to what's actually missing or stale — don't recite the full
74
74
  | `congressgov_member_lookup` | Discover members by state/district/congress, retrieve legislative portfolios |
75
75
  | `congressgov_committee_lookup` | Browse committees and retrieve legislation, reports, nominations |
76
76
  | `congressgov_roll_votes` | Retrieve House and Senate roll call votes and member voting positions |
77
- | `congressgov_senate_nominations` | Browse presidential nominations, track Senate confirmation pipeline |
77
+ | `congressgov_senate_nominations` | Browse presidential nominations, track Senate confirmation pipeline; an action citing its own Senate record vote (`actions` rows, `latestAction` on `list`/`get`) carries `rollVote`, the `congressgov_roll_votes` arguments for it, from the 101st Congress on |
78
78
  | `congressgov_bill_summaries` | Browse recent CRS bill summaries — the "what's happening" feed, bounded by the shared summary page budget and per-row text window |
79
79
  | `congressgov_crs_reports` | Browse and retrieve nonpartisan CRS policy analysis reports |
80
80
  | `congressgov_committee_reports` | Browse and retrieve committee reports accompanying legislation + bounded report text via `content` |
@@ -111,11 +111,13 @@ src/
111
111
  config/
112
112
  server-config.ts # CONGRESS_API_KEY, base URL (Zod schema)
113
113
  services/
114
+ call-budget.ts # One 50 s upstream budget per tool call / resource read, shared by the three HTTP services
114
115
  congress-api/
115
116
  congress-api-service.ts # API client — auth, pagination, rate limiting
116
117
  types.ts # API response types
117
118
  congress-documents/
118
- congress-documents-service.ts # www.congress.gov document fetch — host allowlist, byte ceiling, character window
119
+ congress-documents-service.ts # www.congress.gov document fetch — host allowlist, byte ceiling, call budget, character window
120
+ document-body-cache.ts # Process-local LRU of decompressed bodies — one fetch per document per TTL
119
121
  document-formats.ts # Format label → URL resolution over upstream format lists
120
122
  extract-text.ts # GPO `<pre>` / XML body → deterministic plain text
121
123
  extract-text-stream.ts # Incremental twin of extract-text.ts — one character window, constant memory
@@ -128,7 +130,7 @@ src/
128
130
  types.ts # Mirror row, search filters, search page types
129
131
  senate-lis/
130
132
  senate-vote-service.ts # Senate LIS XML client — fetch, retry, not-found
131
- parse.ts # pure XML → domain parsers (fast-xml-parser)
133
+ parse.ts # pure XML → domain parsers (fast-xml-parser); Senate vote coverage, session for a date
132
134
  types.ts # Senate vote domain types
133
135
  mcp-server/
134
136
  tools/definitions/
@@ -154,6 +156,7 @@ src/
154
156
  legislative-research.prompt.ts # congressgov_legislative_research
155
157
  utils/
156
158
  character-references.ts # Single-pass HTML/XML character-reference decoding
159
+ congress-calendar.ts # ordinal(), congressFirstYear(), currentCongressNumber() — congress numbering arithmetic
157
160
  scripts/
158
161
  _mirror-context.ts # Shared bootstrap for the mirror lifecycle CLI scripts
159
162
  congress-mirror-init.ts # mirror:init — full out-of-band mirror build
@@ -167,6 +170,12 @@ scripts/
167
170
 
168
171
  Four services. `CongressApiService` backs nine tools and the House branch of `congressgov_roll_votes`; `SenateVoteService` backs only the Senate branch of `congressgov_roll_votes` (the Congress.gov API exposes no Senate vote namespace); `CongressMirrorService` backs `congressgov_search_bills` only; `CongressDocumentsService` backs the `content` operation on `congressgov_bill_lookup`, `congressgov_committee_reports`, and `congressgov_daily_record`.
169
172
 
173
+ **Call budget** (`call-budget.ts`, `withCallBudget`) — every upstream request a tool call or resource read makes through `CongressApiService`, `SenateVoteService`, or `CongressDocumentsService` spends one 50 s budget (`CALL_BUDGET_MS`) counted from the call's start (`ctx.timestamp`), so chained and parallel requests (a roster paged four times, a `content` lookup and then its document) end together before the 60 s default MCP client timeout:
174
+ - Each request's retry ladder gets what is left as `withRetry` `deadlineMs`; each attempt's timeout (10 s API, 12 s Senate, 30 s document) is clamped to the remainder and its I/O carries the budget's signal
175
+ - A backoff the remainder cannot hold fails at once as the expiry; a `Retry-After` wait it cannot hold fails at once with the upstream's own error and `retryAfter`; a request the spent budget cannot cover is never sent
176
+ - Running out is `Timeout`, reason `upstream_timeout`, with `budgetMs` and `retryAttempts`. A caller abort stays `RequestCancelled`, and a 429 is still never retried
177
+ - Services read the budget from the handler's own `ctx` — pass it to every service call, never a context derived from it (that carries a later timestamp). A request with no `ctx` — the mirror ingester and the `mirror:*` scripts — runs the plain per-request ladder, unbudgeted
178
+
170
179
  **`CongressApiService`** — wraps the Congress.gov REST API v3:
171
180
  - API key via `X-Api-Key` header (never logged; kept out of the URL so it can't leak in upstream error messages)
172
181
  - Pagination: `offset` + `limit` query params, max 250 per request
@@ -179,18 +188,22 @@ Four services. `CongressApiService` backs nine tools and the House branch of `co
179
188
  - The whole session menu is one file; each vote's roster ships inline — pagination is client-side
180
189
  - The host returns HTTP 200 with an HTML page for unknown congress/session/vote, so "not found" is detected from the body, not the status code
181
190
  - Party totals are derived from the roster (the feed publishes none)
191
+ - senate.gov's firewall answers automated clients with HTTP 403, and a retry meets the same refusal: a 403 fails on the first attempt as `upstream_error` with `retryable: false` and a hint that House votes are unaffected, while a 5xx or timeout is retried within the call budget
182
192
 
183
193
  **`CongressDocumentsService`** — reads the document bodies behind Congress.gov's format URLs (`www.congress.gov`):
184
194
  - A second host, so a sibling service rather than a method on `CongressApiService` — no API key, no JSON, and enrolled omnibus bills that run to ten megabytes
185
195
  - URLs are resolved from upstream format metadata and checked against a `www.congress.gov` allowlist; a caller never supplies one
186
- - The fetch is bounded: a 25 MB ceiling (refused on `Content-Length`, else mid-stream), a 30s deadline, and a content-type allowlist
187
- - The body is extracted as it streams and only the requested window is retained, so a read's live set is flat in the size of the document (transient allocation is not — peak RSS runs above a buffered read); the ceiling bounds how long a response may run, not how much of one fits in a buffer
196
+ - The fetch is bounded: a 25 MB ceiling (refused on `Content-Length`, else mid-stream), a content-type allowlist, and the call budget (above) — the api.congress.gov format lookup the handler makes first spends from it, and the document attempts and backoff share what is left
197
+ - The body is extracted as it streams and only the requested window is extracted into memory; the ceiling bounds how long a response may run, not how much of one fits in a buffer (transient allocation still scales with the body — peak RSS runs above a buffered read)
198
+ - A document that runs past its window keeps its decompressed body in `DocumentBodyCache` — process-local, one cache for every tenant (each body is public and fetched without credentials), 64 MB LRU, 16 MB per body (a larger one is captured until it passes that and then dropped), 10-minute TTL from insert — and later windows replay those bytes through the same extractor in 128 KiB slices with a macrotask between them: one fetch per document per TTL, and a replay never spends the budget. A window that reaches the end of its document caches nothing, a cancelled read caches nothing, and concurrent cold reads each fetch (no single-flight)
188
199
  - The structured response is bounded by an exact character window — `structuredContent.content.text` and its offsets index the extracted plain text and are never snapped to section breaks, so feeding `nextOffset` back walks a document with no overlap and no gap; `content[]` wraps that unchanged window in a dynamically safe Markdown fence for presentation
189
200
  - `extract-text.ts` unwraps GPO's `<pre>` print output verbatim (whitespace is the document's structure), while no-`<pre>` XML gains one space only at an otherwise-unseparated sibling close→open element boundary; both readings decode character references through `src/utils/character-references.ts` — the one decoder every HTML/XML → text path in the server shares, single-pass so an escaped reference stays escaped — and `extract-text-stream.ts` is their incremental twin, pinned byte-for-byte against the whole-string extractor
190
201
 
191
202
  **`CongressMirrorService`** — local SQLite FTS5 mirror of bill title + CRS summary text, backing `congressgov_search_bills` only:
192
203
  - Opt-in via `CONGRESS_MIRROR_ENABLED` (off by default); built out-of-band via the `mirror:init`/`mirror:refresh` scripts, never on server startup
193
204
  - No live-API fallback — ingests through the existing `CongressApiService`, and a mirror that hasn't finished its initial build returns an empty result with a notice, not an error
205
+ - Every sync re-walks each congress's whole summaries list, requested from January 1 of the congress's first year with no end date (without `fromDateTime`, Congress.gov returns only the last day's summaries); the `updateDate` checkpoint is persisted only once the whole walk finishes; store spec `version: 2` migrates an older store by clearing its checkpoint, so the next sync backfills
206
+ - The `mirror:*` scripts initialize the framework logger: log lines go to stderr as JSON, stdout carries only the script's own output
194
207
  - `createApp({ teardown })` stops the refresh schedule, cancels and awaits an active refresh, then closes the SQLite mirror. With `MCP_SESSION_MODE` unset, HTTP defaults to stateless; an explicit `MCP_SESSION_MODE` value still overrides it. No handler uses `ctx.requestInput`.
195
208
 
196
209
  **Usage in tools:**
@@ -199,7 +212,7 @@ import { getCongressApi } from '@/services/congress-api/congress-api-service.js'
199
212
 
200
213
  async handler(input, ctx) {
201
214
  const api = getCongressApi();
202
- const bills = await api.listBills({ congress: input.congress, limit: input.limit });
215
+ const bills = await api.listBills({ congress: input.congress, limit: input.limit }, ctx);
203
216
  ctx.log.info('Bills fetched', { congress: input.congress, count: bills.bills.length });
204
217
  return bills;
205
218
  }
@@ -216,11 +229,13 @@ All tools share these patterns. The service layer handles them uniformly:
216
229
  | Condition | Error |
217
230
  |:----------|:------|
218
231
  | Rate limit hit | `rateLimited(...)` with `rate_limited`, credential/shared-quota guidance and upstream `Retry-After` when supplied |
219
- | Deadline or HTTP timeout | `Timeout` (-32004), `upstream_timeout`; HTTP responses retain status |
220
- | API unavailable (5xx) | `serviceUnavailable('Congress.gov API returned HTTP {status}.')` |
232
+ | Attempt timeout, call budget spent, or HTTP timeout response | `Timeout` (-32004), `upstream_timeout`; a spent budget names it (`{upstream} did not deliver {request} within this call's 50-second budget for upstream requests (N attempts).`) and carries `budgetMs`/`retryAttempts`; HTTP responses retain status |
233
+ | API unavailable (5xx) | `ServiceUnavailable` (-32000), `upstream_error`: `Congress.gov returned an unexpected error (HTTP {status}).`; a 501 carries `retryable: false` |
221
234
  | Entity not found (404) | `notFound('{entity} not found', { ...identifiers })` |
235
+ | Upstream rejects the request (400, 401, 402, 403, 422) | `invalidParams('Congress.gov rejected the request as malformed (HTTP {status}).')`, `invalid_request` |
236
+ | Rejected API key (401/403 whose body carries an api.data.gov `API_KEY_*` code) | `configurationError(...)` (-32008), `api_key_rejected`, `retryable: false`, gateway code in `data.upstreamCode` and the message; the hint tells the operator to replace or unset `CONGRESS_API_KEY` and never echoes the key. Classified on the body code, since a malformed path segment is also a plain 403 (#34) |
222
237
  | Invalid params | `validationError('...', { field })` |
223
- | Network error | `serviceUnavailable('Unable to reach the Congress.gov API.')` |
238
+ | Network error | `ServiceUnavailable` (-32000), `upstream_error`: `Congress.gov returned an unexpected error.` |
224
239
 
225
240
  The `content` operation adds `documentErrorContracts` (tool-helpers) on top: `document_unavailable`, `format_unavailable`, `document_fetch_failed`, `document_too_large`, and `offset_past_end` — the last of which `congressgov_bill_lookup` also raises from its `summaries` branch when `characterOffset` is past the end of every returned row's text. `CongressDocumentsService` raises each with a matching `data.reason`; the framework fills the declared `recovery` hint when the throw carries none, service throws included. Explicit recovery overrides win. A direct `definition.handler(...)` test sees the throw unchanged; retain `ctx.recoveryFor` where such a test asserts the hint, or assert the filled hint through `runToolContract`.
226
241
 
package/README.md CHANGED
@@ -7,7 +7,7 @@
7
7
 
8
8
  <div align="center">
9
9
 
10
- [![Version](https://img.shields.io/badge/Version-0.9.0-blue.svg?style=flat-square)](./CHANGELOG.md) [![License](https://img.shields.io/badge/License-Apache%202.0-orange.svg?style=flat-square)](./LICENSE) [![Docker](https://img.shields.io/badge/Docker-ghcr.io-2496ED?style=flat-square&logo=docker&logoColor=white)](https://github.com/users/cyanheads/packages/container/package/congressgov-mcp-server) [![MCP SDK](https://img.shields.io/badge/MCP%20SDK-^2.4.0-green.svg?style=flat-square)](https://modelcontextprotocol.io/) [![npm](https://img.shields.io/npm/v/@cyanheads/congressgov-mcp-server?style=flat-square&logo=npm&logoColor=white)](https://www.npmjs.com/package/@cyanheads/congressgov-mcp-server) [![TypeScript](https://img.shields.io/badge/TypeScript-^7.0.2-3178C6.svg?style=flat-square)](https://www.typescriptlang.org/) [![Bun](https://img.shields.io/badge/Bun-v1.4.4-blueviolet.svg?style=flat-square)](https://bun.sh/)
10
+ [![Version](https://img.shields.io/badge/Version-0.9.1-blue.svg?style=flat-square)](./CHANGELOG.md) [![License](https://img.shields.io/badge/License-Apache%202.0-orange.svg?style=flat-square)](./LICENSE) [![Docker](https://img.shields.io/badge/Docker-ghcr.io-2496ED?style=flat-square&logo=docker&logoColor=white)](https://github.com/users/cyanheads/packages/container/package/congressgov-mcp-server) [![MCP SDK](https://img.shields.io/badge/MCP%20SDK-^2.4.0-green.svg?style=flat-square)](https://modelcontextprotocol.io/) [![npm](https://img.shields.io/npm/v/@cyanheads/congressgov-mcp-server?style=flat-square&logo=npm&logoColor=white)](https://www.npmjs.com/package/@cyanheads/congressgov-mcp-server) [![TypeScript](https://img.shields.io/badge/TypeScript-^7.0.2-3178C6.svg?style=flat-square)](https://www.typescriptlang.org/) [![Bun](https://img.shields.io/badge/Bun-v1.4.4-blueviolet.svg?style=flat-square)](https://bun.sh/)
11
11
 
12
12
  </div>
13
13
 
@@ -107,8 +107,10 @@ Bill, member, and committee data is also reachable through `congressgov_bill_loo
107
107
  ### `congressgov_roll_votes` <sub>tool</sub>
108
108
 
109
109
  - `chamber` is `house` (default, Congress.gov API) or `senate` (the Senate's LIS feed); every call needs `congress` + `session` (1 or 2), and `get`/`members` add `voteNumber`, which resets each session and is specific to one chamber
110
+ - A congress's first year is session 1 and its second year session 2, but a second session can run into January 1–3 of the following year (the 116th Congress's second session voted on 2021-01-01)
110
111
  - `list` is newest first unless `order: 'oldest'`; `get` returns the question, result, tallies, and party breakdown, and `members` returns each member's position
111
112
  - Senate votes start at the 101st Congress (1989), and Senate rows pair the feed's year-less `voteDate` with a derived `voteDateIso`
113
+ - When senate.gov refuses the request (HTTP 403, which its firewall returns to automated clients), a Senate call fails on the first attempt with a non-retryable `upstream_error`; a 5xx or timeout from the feed is retried. House votes are unaffected
112
114
 
113
115
  ---
114
116
 
@@ -116,6 +118,7 @@ Bill, member, and committee data is also reachable through `congressgov_bill_loo
116
118
 
117
119
  - `list` browses one `congress`; `get`, `actions`, `committees`, `hearings`, and `nominees` need a `nominationNumber` (`1000` for PN1000), and `nominees` also needs an `ordinal` from the `nominees` array `get` returns
118
120
  - Multi-part nominations (e.g. PN851) keep their activity on partitioned children (`851-1`, `851-2`, …); an empty sub-resource call on the bare number returns a notice pointing there
121
+ - An action whose text cites its own Senate record vote (`Record Vote Number: 225.`) carries `rollVote` — `{ chamber: 'senate', congress, session, voteNumber }`, the `congressgov_roll_votes` arguments for that vote. Every citing `actions` row gets one, cloture votes included, and so does `latestAction` on `list` rows and `get`; votes before the 101st Congress get none
119
122
 
120
123
  ---
121
124
 
@@ -212,7 +215,8 @@ Congress.gov-specific:
212
215
 
213
216
  - Type-safe client for the Congress.gov REST API v3, plus a client for the Senate's LIS XML feed that backs Senate roll votes
214
217
  - The Congress.gov API has no keyword search, so tools browse by congress, type, date range, chamber, state, and district; list operations page with `limit` 1–250 (default 20) and `offset`
215
- - `content` on bill text, committee reports, and Record articles reads `format` `text` (default) or `xml` in a `characterOffset`/`characterLimit` window (1–100,000 characters, default 25,000), fetched only from `www.congress.gov` under a 25 MB ceiling and a 30s deadline
218
+ - `content` on bill text, committee reports, and Record articles reads `format` `text` (default) or `xml` in a `characterOffset`/`characterLimit` window (1–100,000 characters, default 25,000), fetched only from `www.congress.gov` under a 25 MB ceiling; a document longer than one window (up to 16 MB) is downloaded once and its later windows are served from a 10-minute in-memory cache
219
+ - Each tool call or resource read gets 50 seconds for all of its upstream requests, retries and backoff included, whether it makes one request or chains several (a `content` call's metadata lookup and document fetch, a committee name resolved against the full roster). A stalled upstream ends the call before the 60-second default timeout of MCP clients: `upstream_timeout` from Congress.gov, the retryable `upstream_error` from the Senate LIS feed
216
220
  - Optional API key from [api.data.gov](https://api.data.gov/signup/): `DEMO_KEY` allows 30 requests/hour and 50/day per IP, registered keys 5,000/hour
217
221
  - Opt-in local SQLite FTS5 mirror (`CONGRESS_MIRROR_ENABLED`) adds keyword search over bill titles and CRS summaries
218
222
 
@@ -221,7 +225,7 @@ Agent-friendly output:
221
225
  - Every list response carries `effectiveQuery` and `totalCount`, with a `notice` when nothing matched
222
226
  - `list` rejects detail-only identifiers (`billNumber`, `voteNumber`, `nominationNumber`, `reportNumber`, `volumeNumber`) with an `incompatible_identity` error that names the operation to use instead
223
227
  - `content` returns `offset`, `truncated`, and `nextOffset`, so walking a multi-megabyte bill never skips or repeats a character
224
- - Typed failures (`document_unavailable`, `format_unavailable`, `document_fetch_failed`, `document_too_large`, `offset_past_end`, `not_found`, `rate_limited`, `invalid_request`, `upstream_error`, `upstream_timeout`), each with a recovery hint
228
+ - Typed failures (`document_unavailable`, `format_unavailable`, `document_fetch_failed`, `document_too_large`, `offset_past_end`, `not_found`, `rate_limited`, `invalid_request`, `api_key_rejected`, `upstream_error`, `upstream_timeout`), each with a recovery hint
225
229
 
226
230
  ## Getting started
227
231
 
@@ -332,11 +336,12 @@ The image defaults to HTTP transport, stateless session mode, and logs to `/var/
332
336
  | `src/mcp-server/tools/` | Tool definitions (`definitions/*.tool.ts`) plus shared input, formatting, and summary-window helpers. |
333
337
  | `src/mcp-server/resources/definitions/` | Resource definitions (`*.resource.ts`). |
334
338
  | `src/mcp-server/prompts/definitions/` | Prompt definitions (`*.prompt.ts`). |
339
+ | `src/services/call-budget.ts` | The 50-second budget every tool call's upstream requests share. |
335
340
  | `src/services/congress-api/` | Congress.gov API client: auth, pagination, rate limiting. |
336
- | `src/services/congress-documents/` | Bounded document-text fetch: host allowlist, byte ceiling, character window. |
341
+ | `src/services/congress-documents/` | Bounded document-text fetch: host allowlist, byte ceiling, character window, and a 10-minute cache of document bodies. |
337
342
  | `src/services/congress-mirror/` | Local SQLite FTS5 bill-search mirror: ingest, normalize, schema. |
338
343
  | `src/services/senate-lis/` | Senate LIS XML client for Senate roll call votes. |
339
- | `src/utils/` | HTML/XML character-reference decoding. |
344
+ | `src/utils/` | HTML/XML character-reference decoding and congress-number arithmetic. |
340
345
  | `scripts/` | Build, devcheck, and release tooling, plus the `mirror:init` / `mirror:refresh` / `mirror:verify` CLIs. |
341
346
  | `tests/` | Unit and integration tests, mirroring the `src/` structure. |
342
347
 
@@ -0,0 +1,31 @@
1
+ ---
2
+ summary: "Rejected API keys get a distinct error, each tool call shares a 50-second upstream budget, nomination actions point at their Senate roll votes, and the bill mirror stores summaries."
3
+ breaking: false
4
+ security: false
5
+ ---
6
+
7
+ # 0.9.1 — 2026-11-01
8
+
9
+ ## Added
10
+
11
+ - **`rollVote` on nomination actions** — `congressgov_senate_nominations` `actions` rows, and `latestAction` on `list` and `get`, carry `{ chamber: 'senate', congress, session, voteNumber }`, the `congressgov_roll_votes` arguments for the Senate record vote the action cites (101st Congress onward) (#62).
12
+
13
+ ## Changed
14
+
15
+ - **Upstream call budget** — every tool call or resource read gets one 50-second budget across its upstream requests, retries, and backoff; running out is `Timeout` `upstream_timeout` with `budgetMs` and `retryAttempts`. The shared `upstream_error` and `upstream_timeout` contract descriptions match (#88).
16
+ - **`content` document cache** — a multi-window document is fetched once per 10-minute TTL instead of once per window; bodies up to 16 MB are cached, 64 MB total, process-local (#57).
17
+ - **`congressgov_roll_votes` `session`** — the description no longer states an odd/even-year rule; a second session can run into January 1–3 (#62).
18
+ - **Mirror store spec** — moves to `version: 2`; its migration clears the checkpoint so the next sync backfills summaries (#86).
19
+
20
+ ## Fixed
21
+
22
+ - **Rejected API key** — an api.data.gov `API_KEY_*` code on a 401 or 403 is now `-32008` `api_key_rejected` (not retryable, gateway code in `data.upstreamCode`) with a hint to replace or unset `CONGRESS_API_KEY`, instead of `invalid_request`; other 400/401/403/422 responses keep `invalid_request` (#84).
23
+ - **Senate 403** — a senate.gov HTTP 403 fails on the first attempt as a non-retryable `upstream_error` that says House votes are unaffected; 5xx and timeouts are still retried (#89).
24
+ - **Mirror summaries** — `mirror:init` and `mirror:refresh` request each congress's summaries from January 1 of its first year; without a date window Congress.gov returned only the last day's (#86).
25
+ - **Mirror refresh checkpoint** — persisted only with the final page of a completed walk, so a refresh that fails partway no longer advances it past a later congress (#91).
26
+ - **Mirror CLI output** — `mirror:init`, `mirror:refresh`, and `mirror:verify` log to stderr instead of printing nothing (#87).
27
+
28
+ ## Dependencies
29
+
30
+ - `@biomejs/biome` ^2.6.3 → ^2.6.4.
31
+ - `@types/node` ^26.6.5 → ^26.6.6.
@@ -5,13 +5,6 @@
5
5
  import { z } from '@cyanheads/mcp-ts-core';
6
6
  /** Default on-disk location of the SQLite bill FTS mirror. */
7
7
  export declare const DEFAULT_MIRROR_PATH = ".mirror/bills.sqlite3";
8
- /**
9
- * Congress number covering a given date. The 1st U.S. Congress convened in 1789
10
- * and each Congress spans two years, so `floor((year - 1789) / 2) + 1` yields the
11
- * ordinal (2025–2026 → 119). Used to seed the default mirror window when
12
- * `CONGRESS_MIRROR_CONGRESSES` is unset.
13
- */
14
- export declare function currentCongressNumber(date?: Date): number;
15
8
  declare const ServerConfigSchema: z.ZodObject<{
16
9
  apiKey: z.ZodDefault<z.ZodString>;
17
10
  baseUrl: z.ZodDefault<z.ZodString>;
@@ -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,8DAA8D;AAC9D,eAAO,MAAM,mBAAmB,0BAA0B,CAAC;AAE3D;;;;;GAKG;AACH,wBAAgB,qBAAqB,CAAC,IAAI,GAAE,IAAiB,GAAG,MAAM,CAErE;AAoBD,QAAA,MAAM,kBAAkB;;;;;;;iBA6CtB,CAAC;AAEH,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAI9D,wBAAgB,eAAe,IAAI,YAAY,CAU9C;AAED,2CAA2C;AAC3C,wBAAgB,iBAAiB,IAAI,IAAI,CAExC"}
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;AAI3C,8DAA8D;AAC9D,eAAO,MAAM,mBAAmB,0BAA0B,CAAC;AAoB3D,QAAA,MAAM,kBAAkB;;;;;;;iBA6CtB,CAAC;AAEH,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAI9D,wBAAgB,eAAe,IAAI,YAAY,CAU9C;AAED,2CAA2C;AAC3C,wBAAgB,iBAAiB,IAAI,IAAI,CAExC"}
@@ -4,17 +4,9 @@
4
4
  */
5
5
  import { z } from '@cyanheads/mcp-ts-core';
6
6
  import { parseEnvConfig } from '@cyanheads/mcp-ts-core/config';
7
+ import { currentCongressNumber } from '../utils/congress-calendar.js';
7
8
  /** Default on-disk location of the SQLite bill FTS mirror. */
8
9
  export const DEFAULT_MIRROR_PATH = '.mirror/bills.sqlite3';
9
- /**
10
- * Congress number covering a given date. The 1st U.S. Congress convened in 1789
11
- * and each Congress spans two years, so `floor((year - 1789) / 2) + 1` yields the
12
- * ordinal (2025–2026 → 119). Used to seed the default mirror window when
13
- * `CONGRESS_MIRROR_CONGRESSES` is unset.
14
- */
15
- export function currentCongressNumber(date = new Date()) {
16
- return Math.floor((date.getUTCFullYear() - 1789) / 2) + 1;
17
- }
18
10
  /**
19
11
  * Parse `CONGRESS_MIRROR_CONGRESSES` — a comma-separated list of congress numbers
20
12
  * ("118,119") — into a positive-integer array. Unset/empty falls back to the
@@ -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,8DAA8D;AAC9D,MAAM,CAAC,MAAM,mBAAmB,GAAG,uBAAuB,CAAC;AAE3D;;;;;GAKG;AACH,MAAM,UAAU,qBAAqB,CAAC,IAAI,GAAS,IAAI,IAAI,EAAE;IAC3D,OAAO,IAAI,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,cAAc,EAAE,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC;AAC5D,CAAC;AAED;;;;;;GAMG;AACH,SAAS,eAAe,CAAC,KAAc;IACrC,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC;QACrD,OAAO,KAAK;aACT,KAAK,CAAC,GAAG,CAAC;aACV,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,EAAE,EAAE,EAAE,CAAC,CAAC;aACzC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;IACjD,CAAC;IACD,MAAM,OAAO,GAAG,qBAAqB,EAAE,CAAC;IACxC,OAAO,CAAC,OAAO,EAAE,OAAO,GAAG,CAAC,CAAC,CAAC;AAChC,CAAC;AAED,MAAM,kBAAkB,GAAG,CAAC,CAAC,MAAM,CAAC;IAClC,MAAM,EAAE,CAAC;SACN,MAAM,EAAE;SACR,OAAO,CAAC,UAAU,CAAC;SACnB,QAAQ,CACP,4KAA4K,CAC7K;IACH,OAAO,EAAE,CAAC;SACP,MAAM,EAAE;SACR,GAAG,EAAE;SACL,OAAO,CAAC,6BAA6B,CAAC;SACtC,QAAQ,CAAC,2BAA2B,CAAC;IAExC;;;;OAIG;IACH,aAAa,EAAE,CAAC;SACb,UAAU,EAAE;SACZ,OAAO,CAAC,KAAK,CAAC;SACd,QAAQ,CAAC,4EAA4E,CAAC;IACzF,8FAA8F;IAC9F,UAAU,EAAE,CAAC;SACV,MAAM,EAAE;SACR,GAAG,CAAC,CAAC,CAAC;SACN,OAAO,CAAC,mBAAmB,CAAC;SAC5B,QAAQ,CAAC,kDAAkD,CAAC;IAC/D;;;OAGG;IACH,iBAAiB,EAAE,CAAC;SACjB,MAAM,EAAE;SACR,GAAG,CAAC,CAAC,CAAC;SACN,QAAQ,EAAE;SACV,QAAQ,CAAC,oFAAoF,CAAC;IACjG;;;;OAIG;IACH,UAAU,EAAE,CAAC;SACV,UAAU,CAAC,eAAe,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;SACxE,QAAQ,CAAC,uEAAuE,CAAC;CACrF,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;QAChC,aAAa,EAAE,yBAAyB;QACxC,UAAU,EAAE,sBAAsB;QAClC,iBAAiB,EAAE,8BAA8B;QACjD,UAAU,EAAE,4BAA4B;KACzC,CAAC,CAAC;IACH,OAAO,OAAO,CAAC;AACjB,CAAC;AAED,2CAA2C;AAC3C,MAAM,UAAU,iBAAiB;IAC/B,OAAO,GAAG,SAAS,CAAC;AACtB,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;AAC/D,OAAO,EAAE,qBAAqB,EAAE,MAAM,8BAA8B,CAAC;AAErE,8DAA8D;AAC9D,MAAM,CAAC,MAAM,mBAAmB,GAAG,uBAAuB,CAAC;AAE3D;;;;;;GAMG;AACH,SAAS,eAAe,CAAC,KAAc;IACrC,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC;QACrD,OAAO,KAAK;aACT,KAAK,CAAC,GAAG,CAAC;aACV,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,EAAE,EAAE,EAAE,CAAC,CAAC;aACzC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;IACjD,CAAC;IACD,MAAM,OAAO,GAAG,qBAAqB,EAAE,CAAC;IACxC,OAAO,CAAC,OAAO,EAAE,OAAO,GAAG,CAAC,CAAC,CAAC;AAChC,CAAC;AAED,MAAM,kBAAkB,GAAG,CAAC,CAAC,MAAM,CAAC;IAClC,MAAM,EAAE,CAAC;SACN,MAAM,EAAE;SACR,OAAO,CAAC,UAAU,CAAC;SACnB,QAAQ,CACP,4KAA4K,CAC7K;IACH,OAAO,EAAE,CAAC;SACP,MAAM,EAAE;SACR,GAAG,EAAE;SACL,OAAO,CAAC,6BAA6B,CAAC;SACtC,QAAQ,CAAC,2BAA2B,CAAC;IAExC;;;;OAIG;IACH,aAAa,EAAE,CAAC;SACb,UAAU,EAAE;SACZ,OAAO,CAAC,KAAK,CAAC;SACd,QAAQ,CAAC,4EAA4E,CAAC;IACzF,8FAA8F;IAC9F,UAAU,EAAE,CAAC;SACV,MAAM,EAAE;SACR,GAAG,CAAC,CAAC,CAAC;SACN,OAAO,CAAC,mBAAmB,CAAC;SAC5B,QAAQ,CAAC,kDAAkD,CAAC;IAC/D;;;OAGG;IACH,iBAAiB,EAAE,CAAC;SACjB,MAAM,EAAE;SACR,GAAG,CAAC,CAAC,CAAC;SACN,QAAQ,EAAE;SACV,QAAQ,CAAC,oFAAoF,CAAC;IACjG;;;;OAIG;IACH,UAAU,EAAE,CAAC;SACV,UAAU,CAAC,eAAe,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;SACxE,QAAQ,CAAC,uEAAuE,CAAC;CACrF,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;QAChC,aAAa,EAAE,yBAAyB;QACxC,UAAU,EAAE,sBAAsB;QAClC,iBAAiB,EAAE,8BAA8B;QACjD,UAAU,EAAE,4BAA4B;KACzC,CAAC,CAAC;IACH,OAAO,OAAO,CAAC;AACjB,CAAC;AAED,2CAA2C;AAC3C,MAAM,UAAU,iBAAiB;IAC/B,OAAO,GAAG,SAAS,CAAC;AACtB,CAAC"}
@@ -75,19 +75,26 @@ export declare const billLookupTool: import("@cyanheads/mcp-ts-core").ToolDefini
75
75
  readonly retryable: false;
76
76
  readonly when: 'Congress.gov rejected the request as malformed — a bad date range or an identifier with an unexpected shape.';
77
77
  readonly recovery: 'Check parameter formats: dates must be ISO 8601 like 2026-05-01T00:00:00Z and identifiers must match their documented shape.';
78
+ }, {
79
+ readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.ConfigurationError;
80
+ readonly reason: 'api_key_rejected';
81
+ readonly thrownBy: 'service';
82
+ readonly retryable: false;
83
+ readonly when: "The api.data.gov gateway rejected the server's configured CONGRESS_API_KEY (missing, invalid, disabled, unauthorized, or unverified); the gateway code is in data.upstreamCode. No change to the call's arguments can fix it.";
84
+ readonly recovery: 'This is a server configuration problem, not a request problem: the operator must replace CONGRESS_API_KEY with a valid api.data.gov key (https://api.data.gov/signup/) or unset it to fall back to the rate-limited DEMO_KEY, then restart the server.';
78
85
  }, {
79
86
  readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.ServiceUnavailable;
80
87
  readonly reason: 'upstream_error';
81
88
  readonly thrownBy: 'service';
82
89
  readonly retryable: true;
83
- readonly when: 'Congress.gov returned an unexpected error (5xx or another non-2xx status).';
90
+ readonly when: 'Congress.gov returned an unexpected error (5xx or another non-2xx status) or could not be reached, or the Senate LIS feed failed (5xx, a timeout, or a senate.gov HTTP 403 refusal, which carries retryable: false).';
84
91
  readonly recovery: 'Retry after a short delay; if the failure persists the Congress.gov service may be temporarily degraded.';
85
92
  }, {
86
93
  readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.Timeout;
87
94
  readonly reason: 'upstream_timeout';
88
95
  readonly thrownBy: 'service';
89
96
  readonly retryable: true;
90
- readonly when: 'The Congress.gov request deadline expired or the upstream returned an HTTP timeout response.';
97
+ readonly when: "A Congress.gov request or a congress.gov document fetch timed out or returned an HTTP timeout response, or the call's upstream requests could not finish inside its 50-second budget.";
91
98
  readonly recovery: 'Retry after a short delay; if the failure persists the Congress.gov service may be temporarily degraded.';
92
99
  }, {
93
100
  readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.NotFound;
@@ -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;AA6DjD,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA4WzB,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;AA6DjD,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA4WzB,CAAC"}
@@ -46,19 +46,26 @@ export declare const billSummariesTool: import("@cyanheads/mcp-ts-core").ToolDef
46
46
  readonly retryable: false;
47
47
  readonly when: 'Congress.gov rejected the request as malformed — a bad date range or an identifier with an unexpected shape.';
48
48
  readonly recovery: 'Check parameter formats: dates must be ISO 8601 like 2026-05-01T00:00:00Z and identifiers must match their documented shape.';
49
+ }, {
50
+ readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.ConfigurationError;
51
+ readonly reason: 'api_key_rejected';
52
+ readonly thrownBy: 'service';
53
+ readonly retryable: false;
54
+ readonly when: "The api.data.gov gateway rejected the server's configured CONGRESS_API_KEY (missing, invalid, disabled, unauthorized, or unverified); the gateway code is in data.upstreamCode. No change to the call's arguments can fix it.";
55
+ readonly recovery: 'This is a server configuration problem, not a request problem: the operator must replace CONGRESS_API_KEY with a valid api.data.gov key (https://api.data.gov/signup/) or unset it to fall back to the rate-limited DEMO_KEY, then restart the server.';
49
56
  }, {
50
57
  readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.ServiceUnavailable;
51
58
  readonly reason: 'upstream_error';
52
59
  readonly thrownBy: 'service';
53
60
  readonly retryable: true;
54
- readonly when: 'Congress.gov returned an unexpected error (5xx or another non-2xx status).';
61
+ readonly when: 'Congress.gov returned an unexpected error (5xx or another non-2xx status) or could not be reached, or the Senate LIS feed failed (5xx, a timeout, or a senate.gov HTTP 403 refusal, which carries retryable: false).';
55
62
  readonly recovery: 'Retry after a short delay; if the failure persists the Congress.gov service may be temporarily degraded.';
56
63
  }, {
57
64
  readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.Timeout;
58
65
  readonly reason: 'upstream_timeout';
59
66
  readonly thrownBy: 'service';
60
67
  readonly retryable: true;
61
- readonly when: 'The Congress.gov request deadline expired or the upstream returned an HTTP timeout response.';
68
+ readonly when: "A Congress.gov request or a congress.gov document fetch timed out or returned an HTTP timeout response, or the call's upstream requests could not finish inside its 50-second budget.";
62
69
  readonly recovery: 'Retry after a short delay; if the failure persists the Congress.gov service may be temporarily degraded.';
63
70
  }], {
64
71
  effectiveQuery: z.ZodString;
@@ -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;AAwBjD,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAmH5B,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;AAwBjD,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAmH5B,CAAC"}
@@ -53,19 +53,26 @@ export declare const committeeLookupTool: import("@cyanheads/mcp-ts-core").ToolD
53
53
  readonly retryable: false;
54
54
  readonly when: 'Congress.gov rejected the request as malformed — a bad date range or an identifier with an unexpected shape.';
55
55
  readonly recovery: 'Check parameter formats: dates must be ISO 8601 like 2026-05-01T00:00:00Z and identifiers must match their documented shape.';
56
+ }, {
57
+ readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.ConfigurationError;
58
+ readonly reason: 'api_key_rejected';
59
+ readonly thrownBy: 'service';
60
+ readonly retryable: false;
61
+ readonly when: "The api.data.gov gateway rejected the server's configured CONGRESS_API_KEY (missing, invalid, disabled, unauthorized, or unverified); the gateway code is in data.upstreamCode. No change to the call's arguments can fix it.";
62
+ readonly recovery: 'This is a server configuration problem, not a request problem: the operator must replace CONGRESS_API_KEY with a valid api.data.gov key (https://api.data.gov/signup/) or unset it to fall back to the rate-limited DEMO_KEY, then restart the server.';
56
63
  }, {
57
64
  readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.ServiceUnavailable;
58
65
  readonly reason: 'upstream_error';
59
66
  readonly thrownBy: 'service';
60
67
  readonly retryable: true;
61
- readonly when: 'Congress.gov returned an unexpected error (5xx or another non-2xx status).';
68
+ readonly when: 'Congress.gov returned an unexpected error (5xx or another non-2xx status) or could not be reached, or the Senate LIS feed failed (5xx, a timeout, or a senate.gov HTTP 403 refusal, which carries retryable: false).';
62
69
  readonly recovery: 'Retry after a short delay; if the failure persists the Congress.gov service may be temporarily degraded.';
63
70
  }, {
64
71
  readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.Timeout;
65
72
  readonly reason: 'upstream_timeout';
66
73
  readonly thrownBy: 'service';
67
74
  readonly retryable: true;
68
- readonly when: 'The Congress.gov request deadline expired or the upstream returned an HTTP timeout response.';
75
+ readonly when: "A Congress.gov request or a congress.gov document fetch timed out or returned an HTTP timeout response, or the call's upstream requests could not finish inside its 50-second budget.";
69
76
  readonly recovery: 'Retry after a short delay; if the failure persists the Congress.gov service may be temporarily degraded.';
70
77
  }], {
71
78
  effectiveQuery: z.ZodString;
@@ -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;AAgHjD,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA8N9B,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;AAgHjD,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA8N9B,CAAC"}
@@ -55,19 +55,26 @@ export declare const committeeReportsTool: import("@cyanheads/mcp-ts-core").Tool
55
55
  readonly retryable: false;
56
56
  readonly when: 'Congress.gov rejected the request as malformed — a bad date range or an identifier with an unexpected shape.';
57
57
  readonly recovery: 'Check parameter formats: dates must be ISO 8601 like 2026-05-01T00:00:00Z and identifiers must match their documented shape.';
58
+ }, {
59
+ readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.ConfigurationError;
60
+ readonly reason: 'api_key_rejected';
61
+ readonly thrownBy: 'service';
62
+ readonly retryable: false;
63
+ readonly when: "The api.data.gov gateway rejected the server's configured CONGRESS_API_KEY (missing, invalid, disabled, unauthorized, or unverified); the gateway code is in data.upstreamCode. No change to the call's arguments can fix it.";
64
+ readonly recovery: 'This is a server configuration problem, not a request problem: the operator must replace CONGRESS_API_KEY with a valid api.data.gov key (https://api.data.gov/signup/) or unset it to fall back to the rate-limited DEMO_KEY, then restart the server.';
58
65
  }, {
59
66
  readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.ServiceUnavailable;
60
67
  readonly reason: 'upstream_error';
61
68
  readonly thrownBy: 'service';
62
69
  readonly retryable: true;
63
- readonly when: 'Congress.gov returned an unexpected error (5xx or another non-2xx status).';
70
+ readonly when: 'Congress.gov returned an unexpected error (5xx or another non-2xx status) or could not be reached, or the Senate LIS feed failed (5xx, a timeout, or a senate.gov HTTP 403 refusal, which carries retryable: false).';
64
71
  readonly recovery: 'Retry after a short delay; if the failure persists the Congress.gov service may be temporarily degraded.';
65
72
  }, {
66
73
  readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.Timeout;
67
74
  readonly reason: 'upstream_timeout';
68
75
  readonly thrownBy: 'service';
69
76
  readonly retryable: true;
70
- readonly when: 'The Congress.gov request deadline expired or the upstream returned an HTTP timeout response.';
77
+ readonly when: "A Congress.gov request or a congress.gov document fetch timed out or returned an HTTP timeout response, or the call's upstream requests could not finish inside its 50-second budget.";
71
78
  readonly recovery: 'Retry after a short delay; if the failure persists the Congress.gov service may be temporarily degraded.';
72
79
  }, {
73
80
  readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.NotFound;
@@ -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;AAkCjD,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAqL/B,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;AAkCjD,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAqL/B,CAAC"}
@@ -39,19 +39,26 @@ export declare const crsReportsTool: import("@cyanheads/mcp-ts-core").ToolDefini
39
39
  readonly retryable: false;
40
40
  readonly when: 'Congress.gov rejected the request as malformed — a bad date range or an identifier with an unexpected shape.';
41
41
  readonly recovery: 'Check parameter formats: dates must be ISO 8601 like 2026-05-01T00:00:00Z and identifiers must match their documented shape.';
42
+ }, {
43
+ readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.ConfigurationError;
44
+ readonly reason: 'api_key_rejected';
45
+ readonly thrownBy: 'service';
46
+ readonly retryable: false;
47
+ readonly when: "The api.data.gov gateway rejected the server's configured CONGRESS_API_KEY (missing, invalid, disabled, unauthorized, or unverified); the gateway code is in data.upstreamCode. No change to the call's arguments can fix it.";
48
+ readonly recovery: 'This is a server configuration problem, not a request problem: the operator must replace CONGRESS_API_KEY with a valid api.data.gov key (https://api.data.gov/signup/) or unset it to fall back to the rate-limited DEMO_KEY, then restart the server.';
42
49
  }, {
43
50
  readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.ServiceUnavailable;
44
51
  readonly reason: 'upstream_error';
45
52
  readonly thrownBy: 'service';
46
53
  readonly retryable: true;
47
- readonly when: 'Congress.gov returned an unexpected error (5xx or another non-2xx status).';
54
+ readonly when: 'Congress.gov returned an unexpected error (5xx or another non-2xx status) or could not be reached, or the Senate LIS feed failed (5xx, a timeout, or a senate.gov HTTP 403 refusal, which carries retryable: false).';
48
55
  readonly recovery: 'Retry after a short delay; if the failure persists the Congress.gov service may be temporarily degraded.';
49
56
  }, {
50
57
  readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.Timeout;
51
58
  readonly reason: 'upstream_timeout';
52
59
  readonly thrownBy: 'service';
53
60
  readonly retryable: true;
54
- readonly when: 'The Congress.gov request deadline expired or the upstream returned an HTTP timeout response.';
61
+ readonly when: "A Congress.gov request or a congress.gov document fetch timed out or returned an HTTP timeout response, or the call's upstream requests could not finish inside its 50-second budget.";
55
62
  readonly recovery: 'Retry after a short delay; if the failure persists the Congress.gov service may be temporarily degraded.';
56
63
  }, {
57
64
  readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.ValidationError;
@@ -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;AAcjD,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA0DzB,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;AAcjD,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA0DzB,CAAC"}