@cyanheads/congressgov-mcp-server 0.7.0 → 0.7.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AGENTS.md +31 -19
- package/CLAUDE.md +31 -19
- package/Dockerfile +2 -2
- package/README.md +216 -92
- package/changelog/0.1.x/0.1.0.md +36 -0
- package/changelog/0.2.x/0.2.0.md +26 -0
- package/changelog/0.2.x/0.2.1.md +16 -0
- package/changelog/0.3.x/0.3.0.md +26 -0
- package/changelog/0.3.x/0.3.1.md +14 -0
- package/changelog/0.3.x/0.3.10.md +15 -0
- package/changelog/0.3.x/0.3.11.md +18 -0
- package/changelog/0.3.x/0.3.12.md +15 -0
- package/changelog/0.3.x/0.3.13.md +20 -0
- package/changelog/0.3.x/0.3.14.md +30 -0
- package/changelog/0.3.x/0.3.15.md +28 -0
- package/changelog/0.3.x/0.3.16.md +34 -0
- package/changelog/0.3.x/0.3.17.md +28 -0
- package/changelog/0.3.x/0.3.18.md +18 -0
- package/changelog/0.3.x/0.3.19.md +36 -0
- package/changelog/0.3.x/0.3.2.md +12 -0
- package/changelog/0.3.x/0.3.20.md +22 -0
- package/changelog/0.3.x/0.3.21.md +15 -0
- package/changelog/0.3.x/0.3.22.md +29 -0
- package/changelog/0.3.x/0.3.23.md +25 -0
- package/changelog/0.3.x/0.3.24.md +20 -0
- package/changelog/0.3.x/0.3.25.md +12 -0
- package/changelog/0.3.x/0.3.26.md +25 -0
- package/changelog/0.3.x/0.3.27.md +16 -0
- package/changelog/0.3.x/0.3.28.md +18 -0
- package/changelog/0.3.x/0.3.29.md +13 -0
- package/changelog/0.3.x/0.3.3.md +11 -0
- package/changelog/0.3.x/0.3.30.md +28 -0
- package/changelog/0.3.x/0.3.31.md +28 -0
- package/changelog/0.3.x/0.3.32.md +21 -0
- package/changelog/0.3.x/0.3.4.md +18 -0
- package/changelog/0.3.x/0.3.5.md +23 -0
- package/changelog/0.3.x/0.3.6.md +10 -0
- package/changelog/0.3.x/0.3.7.md +15 -0
- package/changelog/0.3.x/0.3.8.md +29 -0
- package/changelog/0.3.x/0.3.9.md +21 -0
- package/changelog/0.4.x/0.4.0.md +28 -0
- package/changelog/0.4.x/0.4.1.md +17 -0
- package/changelog/0.4.x/0.4.2.md +39 -0
- package/changelog/0.4.x/0.4.3.md +16 -0
- package/changelog/0.5.x/0.5.0.md +22 -0
- package/changelog/0.5.x/0.5.1.md +16 -0
- package/changelog/0.5.x/0.5.2.md +29 -0
- package/changelog/0.6.x/0.6.0.md +24 -0
- package/changelog/0.7.x/0.7.0.md +13 -0
- package/changelog/0.7.x/0.7.1.md +35 -0
- package/changelog/0.7.x/0.7.2.md +20 -0
- package/changelog/template.md +151 -0
- package/dist/config/server-config.d.ts +3 -3
- package/dist/config/server-config.d.ts.map +1 -1
- package/dist/config/server-config.js +6 -3
- package/dist/config/server-config.js.map +1 -1
- package/dist/index.js +23 -3
- package/dist/index.js.map +1 -1
- package/dist/mcp-server/tools/definitions/bill-lookup.tool.d.ts +12 -4
- package/dist/mcp-server/tools/definitions/bill-lookup.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/bill-lookup.tool.js +94 -3
- package/dist/mcp-server/tools/definitions/bill-lookup.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/bill-summaries.tool.d.ts +4 -0
- package/dist/mcp-server/tools/definitions/bill-summaries.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/bill-summaries.tool.js +34 -6
- package/dist/mcp-server/tools/definitions/bill-summaries.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/committee-lookup.tool.d.ts +4 -0
- package/dist/mcp-server/tools/definitions/committee-lookup.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/committee-lookup.tool.js +2 -2
- package/dist/mcp-server/tools/definitions/committee-reports.tool.d.ts +9 -2
- package/dist/mcp-server/tools/definitions/committee-reports.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/committee-reports.tool.js +2 -2
- package/dist/mcp-server/tools/definitions/crs-reports.tool.d.ts +4 -0
- package/dist/mcp-server/tools/definitions/crs-reports.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/crs-reports.tool.js +2 -2
- package/dist/mcp-server/tools/definitions/daily-record.tool.d.ts +9 -2
- package/dist/mcp-server/tools/definitions/daily-record.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/daily-record.tool.js +2 -2
- package/dist/mcp-server/tools/definitions/enacted-laws.tool.d.ts +4 -0
- package/dist/mcp-server/tools/definitions/enacted-laws.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/enacted-laws.tool.js +2 -2
- package/dist/mcp-server/tools/definitions/member-lookup.tool.d.ts +4 -0
- package/dist/mcp-server/tools/definitions/member-lookup.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/member-lookup.tool.js +2 -2
- package/dist/mcp-server/tools/definitions/roll-votes.tool.d.ts +4 -0
- package/dist/mcp-server/tools/definitions/roll-votes.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/roll-votes.tool.js +2 -2
- package/dist/mcp-server/tools/definitions/search-bills.tool.d.ts +1 -1
- package/dist/mcp-server/tools/definitions/search-bills.tool.js +3 -3
- package/dist/mcp-server/tools/definitions/senate-nominations.tool.d.ts +4 -0
- package/dist/mcp-server/tools/definitions/senate-nominations.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/senate-nominations.tool.js +2 -2
- package/dist/mcp-server/tools/format-helpers.d.ts.map +1 -1
- package/dist/mcp-server/tools/format-helpers.js +85 -30
- package/dist/mcp-server/tools/format-helpers.js.map +1 -1
- package/dist/mcp-server/tools/summary-window.d.ts +112 -0
- package/dist/mcp-server/tools/summary-window.d.ts.map +1 -0
- package/dist/mcp-server/tools/summary-window.js +182 -0
- package/dist/mcp-server/tools/summary-window.js.map +1 -0
- package/dist/mcp-server/tools/tool-helpers.d.ts +26 -2
- package/dist/mcp-server/tools/tool-helpers.d.ts.map +1 -1
- package/dist/mcp-server/tools/tool-helpers.js +26 -2
- package/dist/mcp-server/tools/tool-helpers.js.map +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 -11
- package/dist/services/congress-api/congress-api-service.js.map +1 -1
- package/dist/services/congress-documents/congress-documents-service.d.ts.map +1 -1
- package/dist/services/congress-documents/congress-documents-service.js +10 -9
- package/dist/services/congress-documents/congress-documents-service.js.map +1 -1
- package/dist/services/congress-documents/extract-text-stream.js +1 -1
- package/dist/services/congress-documents/extract-text-stream.js.map +1 -1
- package/dist/services/congress-documents/extract-text.d.ts +0 -6
- package/dist/services/congress-documents/extract-text.d.ts.map +1 -1
- package/dist/services/congress-documents/extract-text.js +4 -37
- package/dist/services/congress-documents/extract-text.js.map +1 -1
- package/dist/services/congress-mirror/congress-mirror-service.js +1 -1
- package/dist/services/congress-mirror/ingest.d.ts +1 -1
- package/dist/services/congress-mirror/normalize.d.ts +4 -1
- package/dist/services/congress-mirror/normalize.d.ts.map +1 -1
- package/dist/services/congress-mirror/normalize.js +8 -12
- package/dist/services/congress-mirror/normalize.js.map +1 -1
- package/dist/services/congress-mirror/types.d.ts +1 -1
- package/dist/services/senate-lis/parse.d.ts.map +1 -1
- package/dist/services/senate-lis/parse.js +74 -2
- package/dist/services/senate-lis/parse.js.map +1 -1
- package/dist/services/senate-lis/senate-vote-service.d.ts.map +1 -1
- package/dist/services/senate-lis/senate-vote-service.js +9 -7
- package/dist/services/senate-lis/senate-vote-service.js.map +1 -1
- package/dist/services/senate-lis/types.d.ts +8 -1
- package/dist/services/senate-lis/types.d.ts.map +1 -1
- package/dist/utils/character-references.d.ts +27 -0
- package/dist/utils/character-references.d.ts.map +1 -0
- package/dist/utils/character-references.js +60 -0
- package/dist/utils/character-references.js.map +1 -0
- package/package.json +11 -9
- package/server.json +3 -3
package/dist/index.js
CHANGED
|
@@ -29,6 +29,8 @@ import { initCongressDocuments } from './services/congress-documents/congress-do
|
|
|
29
29
|
import { getCongressMirror, initCongressMirror, } from './services/congress-mirror/congress-mirror-service.js';
|
|
30
30
|
import { initSenateVoteService } from './services/senate-lis/senate-vote-service.js';
|
|
31
31
|
const REPO_ROOT = 'https://github.com/cyanheads/congressgov-mcp-server';
|
|
32
|
+
const refreshController = new AbortController();
|
|
33
|
+
let activeRefresh;
|
|
32
34
|
/**
|
|
33
35
|
* File names strip the `congressgov_` name prefix (e.g. `congressgov_bill_lookup` →
|
|
34
36
|
* `bill-lookup.tool.ts`), so the framework's kebab-of-name derivation doesn't match.
|
|
@@ -61,6 +63,7 @@ const cacheHints = {
|
|
|
61
63
|
await createApp({
|
|
62
64
|
name: 'congressgov-mcp-server',
|
|
63
65
|
title: 'congressgov-mcp-server',
|
|
66
|
+
sessionMode: 'stateless',
|
|
64
67
|
cacheHints,
|
|
65
68
|
tools: [
|
|
66
69
|
withSource(billLookupTool, 'tools', 'bill-lookup.tool.ts'),
|
|
@@ -92,7 +95,7 @@ await createApp({
|
|
|
92
95
|
tagline: 'U.S. legislative data — bills, votes, members, committees — via MCP.',
|
|
93
96
|
requireAuth: false,
|
|
94
97
|
},
|
|
95
|
-
setup(core) {
|
|
98
|
+
async setup(core) {
|
|
96
99
|
initCongressApi();
|
|
97
100
|
initSenateVoteService();
|
|
98
101
|
initCongressDocuments();
|
|
@@ -107,16 +110,33 @@ await createApp({
|
|
|
107
110
|
if (config.mirrorEnabled) {
|
|
108
111
|
initCongressMirror({ mirrorPath: config.mirrorPath, congresses: config.congresses });
|
|
109
112
|
if (core.config.mcpTransportType === 'http' && config.mirrorRefreshCron) {
|
|
110
|
-
|
|
113
|
+
await scheduleMirrorRefresh(config.mirrorRefreshCron);
|
|
111
114
|
}
|
|
112
115
|
}
|
|
113
116
|
},
|
|
117
|
+
async teardown(core) {
|
|
118
|
+
const config = getServerConfig();
|
|
119
|
+
if (!config.mirrorEnabled)
|
|
120
|
+
return;
|
|
121
|
+
if (core.config.mcpTransportType === 'http' && config.mirrorRefreshCron) {
|
|
122
|
+
schedulerService.stop('congress-bills-refresh');
|
|
123
|
+
}
|
|
124
|
+
refreshController.abort();
|
|
125
|
+
// The scheduler reports sync failures; wait for cancellation before closing SQLite.
|
|
126
|
+
await activeRefresh?.catch(() => undefined);
|
|
127
|
+
await getCongressMirror().mirrorInstance.close();
|
|
128
|
+
},
|
|
114
129
|
});
|
|
115
130
|
/** Register and start the in-process incremental mirror refresh job. */
|
|
116
131
|
async function scheduleMirrorRefresh(cron) {
|
|
117
132
|
await schedulerService.schedule('congress-bills-refresh', cron, async (jobCtx) => {
|
|
118
133
|
logger.info('Starting scheduled Congress bill mirror refresh', jobCtx);
|
|
119
|
-
const
|
|
134
|
+
const refresh = getCongressMirror().mirrorInstance.runSync({
|
|
135
|
+
mode: 'refresh',
|
|
136
|
+
signal: refreshController.signal,
|
|
137
|
+
});
|
|
138
|
+
activeRefresh = refresh;
|
|
139
|
+
const result = await refresh;
|
|
120
140
|
logger.info(`Scheduled Congress bill mirror refresh complete: ${result.recordsApplied} records applied (total ${result.total})`, jobCtx);
|
|
121
141
|
}, 'Incremental refresh of the local Congress bill FTS mirror from Congress.gov.');
|
|
122
142
|
schedulerService.start('congress-bills-refresh');
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAEA;;;GAGG;AAQH,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACnD,OAAO,EAAE,MAAM,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AACxE,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAC5D,OAAO,EAAE,kBAAkB,EAAE,MAAM,0DAA0D,CAAC;AAC9F,OAAO,EAAE,yBAAyB,EAAE,MAAM,iEAAiE,CAAC;AAC5G,OAAO,EAAE,YAAY,EAAE,MAAM,qDAAqD,CAAC;AACnF,OAAO,EAAE,iBAAiB,E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G,OAAO,CAAC;QACxB,MAAM,MAAM,GAAG,MAAM,OAAO,CAAC;QAC7B,MAAM,CAAC,IAAI,CACT,oDAAoD,MAAM,CAAC,cAAc,2BAA2B,MAAM,CAAC,KAAK,GAAG,EACnH,MAAM,CACP,CAAC;IACJ,CAAC,EACD,8EAA8E,CAC/E,CAAC;IACF,gBAAgB,CAAC,KAAK,CAAC,wBAAwB,CAAC,CAAC;AACnD,CAAC"}
|
|
@@ -8,8 +8,6 @@ export declare const billLookupTool: import("@cyanheads/mcp-ts-core").ToolDefini
|
|
|
8
8
|
text: "text";
|
|
9
9
|
xml: "xml";
|
|
10
10
|
}>>;
|
|
11
|
-
characterOffset: z.ZodDefault<z.ZodNumber>;
|
|
12
|
-
characterLimit: z.ZodDefault<z.ZodNumber>;
|
|
13
11
|
operation: z.ZodEnum<{
|
|
14
12
|
actions: "actions";
|
|
15
13
|
amendments: "amendments";
|
|
@@ -45,6 +43,9 @@ export declare const billLookupTool: import("@cyanheads/mcp-ts-core").ToolDefini
|
|
|
45
43
|
limit: z.ZodDefault<z.ZodNumber>;
|
|
46
44
|
offset: z.ZodDefault<z.ZodNumber>;
|
|
47
45
|
textVersionIndex: z.ZodDefault<z.ZodNumber>;
|
|
46
|
+
versionCode: z.ZodOptional<z.ZodString>;
|
|
47
|
+
characterOffset: z.ZodDefault<z.ZodNumber>;
|
|
48
|
+
characterLimit: z.ZodDefault<z.ZodNumber>;
|
|
48
49
|
}, z.core.$strip>, z.ZodObject<{
|
|
49
50
|
data: z.ZodOptional<z.ZodArray<z.ZodObject<{}, z.core.$loose>>>;
|
|
50
51
|
pagination: z.ZodOptional<z.ZodObject<{
|
|
@@ -56,24 +57,28 @@ export declare const billLookupTool: import("@cyanheads/mcp-ts-core").ToolDefini
|
|
|
56
57
|
}, z.core.$loose>, readonly [{
|
|
57
58
|
readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.NotFound;
|
|
58
59
|
readonly reason: 'not_found';
|
|
60
|
+
readonly thrownBy: 'service';
|
|
59
61
|
readonly retryable: false;
|
|
60
62
|
readonly when: 'A requested bill, member, committee, report, vote, or nomination does not exist in Congress.gov.';
|
|
61
63
|
readonly recovery: "Use the tool's list or browse operation to discover valid identifiers, then retry with one that exists.";
|
|
62
64
|
}, {
|
|
63
65
|
readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.RateLimited;
|
|
64
66
|
readonly reason: 'rate_limited';
|
|
67
|
+
readonly thrownBy: 'service';
|
|
65
68
|
readonly retryable: true;
|
|
66
69
|
readonly when: 'The Congress.gov API rate limit (5,000 requests/hour per key) was exceeded.';
|
|
67
70
|
readonly recovery: 'Wait for the hourly rate-limit window to reset before retrying, or reduce the request frequency.';
|
|
68
71
|
}, {
|
|
69
72
|
readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.InvalidParams;
|
|
70
73
|
readonly reason: 'invalid_request';
|
|
74
|
+
readonly thrownBy: 'service';
|
|
71
75
|
readonly retryable: false;
|
|
72
76
|
readonly when: 'Congress.gov rejected the request as malformed — a bad date range or an identifier with an unexpected shape.';
|
|
73
77
|
readonly recovery: 'Check parameter formats: dates must be ISO 8601 like 2026-05-01T00:00:00Z and identifiers must match their documented shape.';
|
|
74
78
|
}, {
|
|
75
79
|
readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.ServiceUnavailable;
|
|
76
80
|
readonly reason: 'upstream_error';
|
|
81
|
+
readonly thrownBy: 'service';
|
|
77
82
|
readonly retryable: true;
|
|
78
83
|
readonly when: 'Congress.gov returned an unexpected error (5xx or another non-2xx status).';
|
|
79
84
|
readonly recovery: 'Retry after a short delay; if the failure persists the Congress.gov service may be temporarily degraded.';
|
|
@@ -92,21 +97,24 @@ export declare const billLookupTool: import("@cyanheads/mcp-ts-core").ToolDefini
|
|
|
92
97
|
}, {
|
|
93
98
|
readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.ServiceUnavailable;
|
|
94
99
|
readonly reason: 'document_fetch_failed';
|
|
100
|
+
readonly thrownBy: 'service';
|
|
95
101
|
readonly retryable: true;
|
|
96
102
|
readonly when: 'www.congress.gov did not return a readable document — a non-2xx status, a network failure, an empty body, or a content type that is not text or XML.';
|
|
97
103
|
readonly recovery: 'Retry after a short delay; if the failure persists, request a different format or read the document at the sourceUrl the text operation returns.';
|
|
98
104
|
}, {
|
|
99
105
|
readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.InvalidParams;
|
|
100
106
|
readonly reason: 'document_too_large';
|
|
107
|
+
readonly thrownBy: 'service';
|
|
101
108
|
readonly retryable: false;
|
|
102
109
|
readonly when: 'The document is larger than the byte ceiling this server retrieves, so no character window can be served from it.';
|
|
103
110
|
readonly recovery: 'Read the document at the sourceUrl the text operation returns. A document this size clears the ceiling in every format it publishes, so switching format reaches the same limit.';
|
|
104
111
|
}, {
|
|
105
112
|
readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.InvalidParams;
|
|
106
113
|
readonly reason: 'offset_past_end';
|
|
114
|
+
readonly thrownBy: 'service';
|
|
107
115
|
readonly retryable: false;
|
|
108
|
-
readonly when:
|
|
109
|
-
readonly recovery:
|
|
116
|
+
readonly when: "characterOffset is at or beyond the last character of every text the call would window — the document on 'content', or every returned row's summary text on 'summaries' — so the window would be empty.";
|
|
117
|
+
readonly recovery: "Restart the walk at characterOffset 0 and follow the response's nextOffset (or a summary row's textNextOffset), which goes null once the text has been read to the end.";
|
|
110
118
|
}], {
|
|
111
119
|
effectiveQuery: z.ZodString;
|
|
112
120
|
totalCount: z.ZodNumber;
|
|
@@ -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;AAqDjD,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAoWzB,CAAC"}
|
|
@@ -4,8 +4,9 @@
|
|
|
4
4
|
*/
|
|
5
5
|
import { tool, z } from '@cyanheads/mcp-ts-core';
|
|
6
6
|
import { validationError } from '@cyanheads/mcp-ts-core/errors';
|
|
7
|
-
import { formatBills } from '
|
|
8
|
-
import {
|
|
7
|
+
import { formatBills } from '../format-helpers.js';
|
|
8
|
+
import { summaryContinuationCall, summaryWindowNotice, windowSummaryPage, } from '../summary-window.js';
|
|
9
|
+
import { buildEffectiveQuery, congressErrorContracts, documentErrorContracts, documentWindowInput, listEnrichment, listOrDetail, MAX_CONTENT_CHARACTERS, normalizeOptionalString, notifyIfNoMatches, numericIdentifier, toIdentifierNumber, validateDateTimeRange, validateIsoDateTime, } from '../tool-helpers.js';
|
|
9
10
|
import { getCongressApi } from '../../../services/congress-api/congress-api-service.js';
|
|
10
11
|
import { BILL_TYPE_CODES } from '../../../services/congress-api/types.js';
|
|
11
12
|
import { getCongressDocuments } from '../../../services/congress-documents/congress-documents-service.js';
|
|
@@ -30,7 +31,7 @@ const SUB_RESOURCE_MAP = {
|
|
|
30
31
|
};
|
|
31
32
|
export const billLookupTool = tool('congressgov_bill_lookup', {
|
|
32
33
|
title: 'Congress.gov Bill Lookup',
|
|
33
|
-
description: `Browse and retrieve U.S. legislative bill data from Congress.gov. Discover bills by filtering on congress, bill type, and date range — there is no keyword search. Use 'list' to browse (requires congress, defaults to most-recently-updated first), 'get' for full bill detail (sponsor, policy area, CBO estimates, law info), or drill into a specific bill with 'actions', 'amendments', 'cosponsors', 'committees', 'subjects', 'summaries', 'text', 'titles', or 'related' (each requires congress + billType + billNumber). 'text' lists the published versions and their format URLs; 'content' then reads one version's actual text, a bounded character window at a time.`,
|
|
34
|
+
description: `Browse and retrieve U.S. legislative bill data from Congress.gov. Discover bills by filtering on congress, bill type, and date range — there is no keyword search. Use 'list' to browse (requires congress, defaults to most-recently-updated first), 'get' for full bill detail (sponsor, policy area, CBO estimates, law info), or drill into a specific bill with 'actions', 'amendments', 'cosponsors', 'committees', 'subjects', 'summaries', 'text', 'titles', or 'related' (each requires congress + billType + billNumber). 'text' lists the published versions and their format URLs; 'content' then reads one version's actual text, a bounded character window at a time. 'summaries' takes an optional versionCode selector and returns each row's text a bounded character window at a time — a row past the window carries textTotalCharacters/textTruncated/textNextOffset, and characterOffset reads on from there.`,
|
|
34
35
|
annotations: { readOnlyHint: true, idempotentHint: true, openWorldHint: true },
|
|
35
36
|
errors: [...congressErrorContracts, ...documentErrorContracts],
|
|
36
37
|
input: z.object({
|
|
@@ -58,7 +59,13 @@ export const billLookupTool = tool('congressgov_bill_lookup', {
|
|
|
58
59
|
.min(0)
|
|
59
60
|
.default(0)
|
|
60
61
|
.describe("Which text version 'content' reads, 0-based against the same order 'text' returns — 0 is the most recent version. Ignored by other operations."),
|
|
62
|
+
versionCode: z
|
|
63
|
+
.string()
|
|
64
|
+
.optional()
|
|
65
|
+
.describe("Which summary version 'summaries' returns — the versionCode a summary row carries ('00' introduced, '49' public law). Selection runs over the bill's whole summary list, which Congress.gov publishes no filter for, and limit/offset then page the matching rows. Omit to return every version. Ignored by other operations."),
|
|
61
66
|
...documentWindowInput,
|
|
67
|
+
characterOffset: documentWindowInput.characterOffset.describe("First character to return, 0-based — of the document on 'content', and of every returned row's summary text on 'summaries'. Offsets are exact and are never snapped to a section or paragraph break, so feeding back the response's nextOffset (or a summary row's textNextOffset) walks the whole text with every character returned exactly once."),
|
|
68
|
+
characterLimit: documentWindowInput.characterLimit.describe(`Maximum characters to return (1-${MAX_CONTENT_CHARACTERS}) — for the document window on 'content', and for each row's summary text on 'summaries'. Legislative documents run past a million characters and an enacted bill's summary past two hundred thousand, so either takes several windows.`),
|
|
62
69
|
}),
|
|
63
70
|
output: listOrDetail({ bill: 'record', content: 'record' }, "Bill record (sponsor, policy area, latest action, CBO estimates, law citation) for `get`; absent for `list` and sub-resources. For `content`, an alternative key 'content' carries {text, format, sourceUrl, documentTitle, totalCharacters, offset, truncated, nextOffset} — one exact character window of the document."),
|
|
64
71
|
enrichment: listEnrichment,
|
|
@@ -167,6 +174,90 @@ export const billLookupTool = tool('congressgov_bill_lookup', {
|
|
|
167
174
|
},
|
|
168
175
|
};
|
|
169
176
|
}
|
|
177
|
+
if (input.operation === 'summaries') {
|
|
178
|
+
/** Narrowed above; a closure below reads it, where the narrowing is lost. */
|
|
179
|
+
const billType = input.billType;
|
|
180
|
+
const versionCode = normalizeOptionalString(input.versionCode);
|
|
181
|
+
/**
|
|
182
|
+
* Congress.gov publishes no version filter on the summaries sub-resource,
|
|
183
|
+
* so a selection reads the bill's whole list — the API's own page ceiling
|
|
184
|
+
* — and matches client-side. Without one the caller's own page is fetched
|
|
185
|
+
* unchanged.
|
|
186
|
+
*/
|
|
187
|
+
const result = await api.getBillSubResource({
|
|
188
|
+
congress: input.congress,
|
|
189
|
+
billType: input.billType,
|
|
190
|
+
billNumber,
|
|
191
|
+
subResource: 'summaries',
|
|
192
|
+
limit: versionCode ? 250 : input.limit,
|
|
193
|
+
offset: versionCode ? 0 : input.offset,
|
|
194
|
+
}, ctx);
|
|
195
|
+
let page = result;
|
|
196
|
+
if (versionCode) {
|
|
197
|
+
const matched = result.data.filter((row) => row.versionCode === versionCode);
|
|
198
|
+
const selected = matched.slice(input.offset, input.offset + input.limit);
|
|
199
|
+
page = {
|
|
200
|
+
...result,
|
|
201
|
+
data: selected,
|
|
202
|
+
pagination: {
|
|
203
|
+
count: matched.length,
|
|
204
|
+
nextOffset: input.offset + selected.length < matched.length
|
|
205
|
+
? input.offset + selected.length
|
|
206
|
+
: null,
|
|
207
|
+
},
|
|
208
|
+
};
|
|
209
|
+
}
|
|
210
|
+
const bounded = windowSummaryPage(page, {
|
|
211
|
+
offset: input.offset,
|
|
212
|
+
characterOffset: input.characterOffset,
|
|
213
|
+
characterLimit: input.characterLimit,
|
|
214
|
+
});
|
|
215
|
+
if (bounded.offsetPastEnd) {
|
|
216
|
+
throw ctx.fail('offset_past_end', `characterOffset ${input.characterOffset} is at or past the end of every summary returned for ${input.billType.toUpperCase()} ${billNumber}.`, {
|
|
217
|
+
...ctx.recoveryFor('offset_past_end'),
|
|
218
|
+
characterOffset: input.characterOffset,
|
|
219
|
+
versionCode,
|
|
220
|
+
});
|
|
221
|
+
}
|
|
222
|
+
ctx.log.info('Bill summaries retrieved', {
|
|
223
|
+
congress: input.congress,
|
|
224
|
+
billType: input.billType,
|
|
225
|
+
billNumber,
|
|
226
|
+
versionCode,
|
|
227
|
+
count: bounded.page.data.length,
|
|
228
|
+
droppedRows: bounded.droppedRows,
|
|
229
|
+
windowedRows: bounded.windowed.length,
|
|
230
|
+
});
|
|
231
|
+
ctx.enrich.echo(buildEffectiveQuery(`summaries for ${input.billType.toUpperCase()} ${billNumber} in the ${input.congress}th Congress`, { versionCode }));
|
|
232
|
+
ctx.enrich.total(bounded.page.pagination.count);
|
|
233
|
+
/**
|
|
234
|
+
* `count` is the matched-row total, so gating on it says "no such version"
|
|
235
|
+
* only when there is none — a page whose own offset ran past the matching
|
|
236
|
+
* rows renders as past-the-end, the same split `notifyIfNoMatches` keeps.
|
|
237
|
+
*/
|
|
238
|
+
if (versionCode && bounded.page.pagination.count === 0) {
|
|
239
|
+
const available = [
|
|
240
|
+
...new Set(result.data
|
|
241
|
+
.map((row) => row.versionCode)
|
|
242
|
+
.filter((code) => typeof code === 'string')),
|
|
243
|
+
];
|
|
244
|
+
ctx.enrich.notice(`No summary with versionCode '${versionCode}' for ${input.billType.toUpperCase()} ${billNumber}.${available.length > 0
|
|
245
|
+
? ` Versions published: ${available.join(', ')}.`
|
|
246
|
+
: ' Congress.gov publishes no summaries for this bill.'}`);
|
|
247
|
+
return bounded.page;
|
|
248
|
+
}
|
|
249
|
+
notifyIfNoMatches(ctx, bounded.page, `No summaries found for ${input.billType.toUpperCase()} ${billNumber}.`);
|
|
250
|
+
const notice = summaryWindowNotice(bounded, input.limit, (row) => summaryContinuationCall({
|
|
251
|
+
congress: input.congress,
|
|
252
|
+
billType,
|
|
253
|
+
billNumber,
|
|
254
|
+
versionCode: typeof row.row.versionCode === 'string' ? row.row.versionCode : versionCode,
|
|
255
|
+
characterOffset: row.nextOffset ?? 0,
|
|
256
|
+
}));
|
|
257
|
+
if (notice)
|
|
258
|
+
ctx.enrich.notice(notice);
|
|
259
|
+
return bounded.page;
|
|
260
|
+
}
|
|
170
261
|
const subResource = SUB_RESOURCE_MAP[input.operation] ?? input.operation;
|
|
171
262
|
const result = await api.getBillSubResource({
|
|
172
263
|
congress: input.congress,
|
|
@@ -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,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAEhE,OAAO,EAAE,WAAW,EAAE,MAAM,sCAAsC,CAAC;AACnE,OAAO,EACL,mBAAmB,EACnB,sBAAsB,EACtB,sBAAsB,EACtB,mBAAmB,EACnB,cAAc,EACd,YAAY,EACZ,uBAAuB,EACvB,iBAAiB,EACjB,iBAAiB,EACjB,kBAAkB,EAClB,qBAAqB,EACrB,mBAAmB,GACpB,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EAAE,cAAc,EAAE,MAAM,iDAAiD,CAAC;AACjF,OAAO,EAAE,eAAe,EAAwB,MAAM,kCAAkC,CAAC;AACz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K,CAAC,QAAQ;YACxB,UAAU;YACV,WAAW;SACZ,CAAC,CAAC;QACH,GAAG,CAAC,MAAM,CAAC,IAAI,CACb,GAAG,KAAK,CAAC,SAAS,QAAQ,KAAK,CAAC,QAAQ,CAAC,WAAW,EAAE,IAAI,UAAU,WAAW,KAAK,CAAC,QAAQ,aAAa,CAC3G,CAAC;QACF,GAAG,CAAC,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC;QAC1C,iBAAiB,CACf,GAAG,EACH,MAAM,EACN,MAAM,KAAK,CAAC,SAAS,cAAc,KAAK,CAAC,QAAQ,CAAC,WAAW,EAAE,IAAI,UAAU,GAAG,CACjF,CAAC;QACF,OAAO,MAAM,CAAC;IAChB,CAAC;CACF,CAAC,CAAC"}
|
|
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,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAEhE,OAAO,EAAE,WAAW,EAAE,MAAM,sCAAsC,CAAC;AACnE,OAAO,EACL,uBAAuB,EACvB,mBAAmB,EACnB,iBAAiB,GAClB,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EACL,mBAAmB,EACnB,sBAAsB,EACtB,sBAAsB,EACtB,mBAAmB,EACnB,cAAc,EACd,YAAY,EACZ,sBAAsB,EACtB,uBAAuB,EACvB,iBAAiB,EACjB,iBAAiB,EACjB,kBAAkB,EAClB,qBAAqB,EACrB,mBAAmB,GACpB,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EAAE,cAAc,EAAE,MAAM,iDAAiD,CAAC;AACjF,OAAO,EAAE,eAAe,EAAwB,MAAM,kCAAkC,CAAC;AACzF,OAAO,EAAE,oBAAoB,EAAE,MAAM,6DAA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AE,KAAK,CAAC,MAAM;SACrB,EACD,GAAG,CACJ,CAAC;QACF,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,6BAA6B,EAAE;YAC1C,QAAQ,EAAE,KAAK,CAAC,QAAQ;YACxB,QAAQ,EAAE,KAAK,CAAC,QAAQ;YACxB,UAAU;YACV,WAAW;SACZ,CAAC,CAAC;QACH,GAAG,CAAC,MAAM,CAAC,IAAI,CACb,GAAG,KAAK,CAAC,SAAS,QAAQ,KAAK,CAAC,QAAQ,CAAC,WAAW,EAAE,IAAI,UAAU,WAAW,KAAK,CAAC,QAAQ,aAAa,CAC3G,CAAC;QACF,GAAG,CAAC,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC;QAC1C,iBAAiB,CACf,GAAG,EACH,MAAM,EACN,MAAM,KAAK,CAAC,SAAS,cAAc,KAAK,CAAC,QAAQ,CAAC,WAAW,EAAE,IAAI,UAAU,GAAG,CACjF,CAAC;QACF,OAAO,MAAM,CAAC;IAChB,CAAC;CACF,CAAC,CAAC"}
|
|
@@ -28,24 +28,28 @@ export declare const billSummariesTool: import("@cyanheads/mcp-ts-core").ToolDef
|
|
|
28
28
|
}, z.core.$loose>, readonly [{
|
|
29
29
|
readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.NotFound;
|
|
30
30
|
readonly reason: 'not_found';
|
|
31
|
+
readonly thrownBy: 'service';
|
|
31
32
|
readonly retryable: false;
|
|
32
33
|
readonly when: 'A requested bill, member, committee, report, vote, or nomination does not exist in Congress.gov.';
|
|
33
34
|
readonly recovery: "Use the tool's list or browse operation to discover valid identifiers, then retry with one that exists.";
|
|
34
35
|
}, {
|
|
35
36
|
readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.RateLimited;
|
|
36
37
|
readonly reason: 'rate_limited';
|
|
38
|
+
readonly thrownBy: 'service';
|
|
37
39
|
readonly retryable: true;
|
|
38
40
|
readonly when: 'The Congress.gov API rate limit (5,000 requests/hour per key) was exceeded.';
|
|
39
41
|
readonly recovery: 'Wait for the hourly rate-limit window to reset before retrying, or reduce the request frequency.';
|
|
40
42
|
}, {
|
|
41
43
|
readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.InvalidParams;
|
|
42
44
|
readonly reason: 'invalid_request';
|
|
45
|
+
readonly thrownBy: 'service';
|
|
43
46
|
readonly retryable: false;
|
|
44
47
|
readonly when: 'Congress.gov rejected the request as malformed — a bad date range or an identifier with an unexpected shape.';
|
|
45
48
|
readonly recovery: 'Check parameter formats: dates must be ISO 8601 like 2026-05-01T00:00:00Z and identifiers must match their documented shape.';
|
|
46
49
|
}, {
|
|
47
50
|
readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.ServiceUnavailable;
|
|
48
51
|
readonly reason: 'upstream_error';
|
|
52
|
+
readonly thrownBy: 'service';
|
|
49
53
|
readonly retryable: true;
|
|
50
54
|
readonly when: 'Congress.gov returned an unexpected error (5xx or another non-2xx status).';
|
|
51
55
|
readonly recovery: 'Retry after a short delay; if the failure persists the Congress.gov service may be temporarily degraded.';
|
|
@@ -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;AAwBjD,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAmH5B,CAAC"}
|
|
@@ -4,14 +4,15 @@
|
|
|
4
4
|
*/
|
|
5
5
|
import { tool, z } from '@cyanheads/mcp-ts-core';
|
|
6
6
|
import { validationError } from '@cyanheads/mcp-ts-core/errors';
|
|
7
|
-
import { formatSummaries } from '
|
|
8
|
-
import {
|
|
7
|
+
import { formatSummaries } from '../format-helpers.js';
|
|
8
|
+
import { summaryContinuationCall, summaryWindowNotice, windowSummaryPage, } from '../summary-window.js';
|
|
9
|
+
import { buildEffectiveQuery, congressErrorContracts, listEnrichment, listOutput, normalizeOptionalString, notifyIfNoMatches, validateDateTimeRange, validateIsoDateTime, } from '../tool-helpers.js';
|
|
9
10
|
import { getCongressApi } from '../../../services/congress-api/congress-api-service.js';
|
|
10
11
|
import { BILL_TYPE_CODES } from '../../../services/congress-api/types.js';
|
|
11
12
|
const DEFAULT_LOOKBACK_MS = 7 * 24 * 60 * 60 * 1000;
|
|
12
13
|
export const billSummariesTool = tool('congressgov_bill_summaries', {
|
|
13
14
|
title: 'Congress.gov Bill Summaries',
|
|
14
|
-
description: `Browse recent CRS (Congressional Research Service) bill summaries — plain-language summaries of bills at each legislative stage, useful for answering "what's happening in Congress?". The fromDateTime/toDateTime filters apply to the summary's update time, not the bill's action date, so results include recently rewritten summaries of older bills. Defaults to summaries updated in the last 7 days. Each item shows both the bill's action date and the summary update date. For summaries of one specific bill
|
|
15
|
+
description: `Browse recent CRS (Congressional Research Service) bill summaries — plain-language summaries of bills at each legislative stage, useful for answering "what's happening in Congress?". The fromDateTime/toDateTime filters apply to the summary's update time, not the bill's action date, so results include recently rewritten summaries of older bills. Defaults to summaries updated in the last 7 days. Each item shows both the bill's action date and the summary update date. A page stops adding rows once it reaches a fixed response-character budget, and a summary longer than the per-row window arrives as an exact character window carrying textTotalCharacters/textTruncated/textNextOffset; pagination.nextOffset continues the page and a row's textNextOffset continues its text. For summaries of one specific bill — and to read a windowed summary to the end — use congressgov_bill_lookup with operation='summaries' instead.`,
|
|
15
16
|
annotations: { readOnlyHint: true, idempotentHint: true, openWorldHint: true },
|
|
16
17
|
errors: congressErrorContracts,
|
|
17
18
|
input: z.object({
|
|
@@ -59,7 +60,12 @@ export const billSummariesTool = tool('congressgov_bill_summaries', {
|
|
|
59
60
|
limit: input.limit,
|
|
60
61
|
offset: input.offset,
|
|
61
62
|
}, ctx);
|
|
62
|
-
|
|
63
|
+
const bounded = windowSummaryPage(result, { offset: input.offset });
|
|
64
|
+
ctx.log.info('Summaries listed', {
|
|
65
|
+
count: bounded.page.data.length,
|
|
66
|
+
droppedRows: bounded.droppedRows,
|
|
67
|
+
windowedRows: bounded.windowed.length,
|
|
68
|
+
});
|
|
63
69
|
ctx.enrich.echo(buildEffectiveQuery('bill summaries', {
|
|
64
70
|
congress: input.congress,
|
|
65
71
|
billType: input.billType,
|
|
@@ -67,8 +73,30 @@ export const billSummariesTool = tool('congressgov_bill_summaries', {
|
|
|
67
73
|
toDateTime: toDateTimeInput,
|
|
68
74
|
}));
|
|
69
75
|
ctx.enrich.total(result.pagination.count);
|
|
70
|
-
notifyIfNoMatches(ctx,
|
|
71
|
-
|
|
76
|
+
notifyIfNoMatches(ctx, bounded.page, 'No summaries found. Try broadening the date range or removing billType/congress filters.');
|
|
77
|
+
/**
|
|
78
|
+
* A windowed row's continuation is a single-bill call, so it names the bill
|
|
79
|
+
* the row itself carries — `bill.type` arrives upper-cased upstream and the
|
|
80
|
+
* builder lower-cases it to the code the input enum takes.
|
|
81
|
+
*/
|
|
82
|
+
const notice = summaryWindowNotice(bounded, input.limit, (row) => {
|
|
83
|
+
const bill = row.row.bill;
|
|
84
|
+
if (!bill || typeof bill !== 'object' || Array.isArray(bill))
|
|
85
|
+
return;
|
|
86
|
+
const { congress, type, number } = bill;
|
|
87
|
+
if (congress == null || type == null || number == null)
|
|
88
|
+
return;
|
|
89
|
+
return summaryContinuationCall({
|
|
90
|
+
congress: Number(congress),
|
|
91
|
+
billType: String(type),
|
|
92
|
+
billNumber: String(number),
|
|
93
|
+
versionCode: typeof row.row.versionCode === 'string' ? row.row.versionCode : undefined,
|
|
94
|
+
characterOffset: row.nextOffset ?? 0,
|
|
95
|
+
});
|
|
96
|
+
});
|
|
97
|
+
if (notice)
|
|
98
|
+
ctx.enrich.notice(notice);
|
|
99
|
+
return bounded.page;
|
|
72
100
|
},
|
|
73
101
|
});
|
|
74
102
|
//# 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,EACL,mBAAmB,EACnB,sBAAsB,EACtB,cAAc,EACd,UAAU,EACV,uBAAuB,EACvB,iBAAiB,EACjB,qBAAqB,EACrB,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,KAAK,EAAE,6BAA6B;IACpC,WAAW,EAAE,
|
|
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,CAA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A+B,CAAC;YACnE,IAAI,QAAQ,IAAI,IAAI,IAAI,IAAI,IAAI,IAAI,IAAI,MAAM,IAAI,IAAI;gBAAE,OAAO;YAC/D,OAAO,uBAAuB,CAAC;gBAC7B,QAAQ,EAAE,MAAM,CAAC,QAAQ,CAAC;gBAC1B,QAAQ,EAAE,MAAM,CAAC,IAAI,CAAC;gBACtB,UAAU,EAAE,MAAM,CAAC,MAAM,CAAC;gBAC1B,WAAW,EAAE,OAAO,GAAG,CAAC,GAAG,CAAC,WAAW,KAAK,QAAQ,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC,CAAC,SAAS;gBACtF,eAAe,EAAE,GAAG,CAAC,UAAU,IAAI,CAAC;aACrC,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;QACH,IAAI,MAAM;YAAE,GAAG,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;QAEtC,OAAO,OAAO,CAAC,IAAI,CAAC;IACtB,CAAC;CACF,CAAC,CAAC"}
|
|
@@ -35,24 +35,28 @@ export declare const committeeLookupTool: import("@cyanheads/mcp-ts-core").ToolD
|
|
|
35
35
|
}, z.core.$loose>, readonly [{
|
|
36
36
|
readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.NotFound;
|
|
37
37
|
readonly reason: 'not_found';
|
|
38
|
+
readonly thrownBy: 'service';
|
|
38
39
|
readonly retryable: false;
|
|
39
40
|
readonly when: 'A requested bill, member, committee, report, vote, or nomination does not exist in Congress.gov.';
|
|
40
41
|
readonly recovery: "Use the tool's list or browse operation to discover valid identifiers, then retry with one that exists.";
|
|
41
42
|
}, {
|
|
42
43
|
readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.RateLimited;
|
|
43
44
|
readonly reason: 'rate_limited';
|
|
45
|
+
readonly thrownBy: 'service';
|
|
44
46
|
readonly retryable: true;
|
|
45
47
|
readonly when: 'The Congress.gov API rate limit (5,000 requests/hour per key) was exceeded.';
|
|
46
48
|
readonly recovery: 'Wait for the hourly rate-limit window to reset before retrying, or reduce the request frequency.';
|
|
47
49
|
}, {
|
|
48
50
|
readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.InvalidParams;
|
|
49
51
|
readonly reason: 'invalid_request';
|
|
52
|
+
readonly thrownBy: 'service';
|
|
50
53
|
readonly retryable: false;
|
|
51
54
|
readonly when: 'Congress.gov rejected the request as malformed — a bad date range or an identifier with an unexpected shape.';
|
|
52
55
|
readonly recovery: 'Check parameter formats: dates must be ISO 8601 like 2026-05-01T00:00:00Z and identifiers must match their documented shape.';
|
|
53
56
|
}, {
|
|
54
57
|
readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.ServiceUnavailable;
|
|
55
58
|
readonly reason: 'upstream_error';
|
|
59
|
+
readonly thrownBy: 'service';
|
|
56
60
|
readonly retryable: true;
|
|
57
61
|
readonly when: 'Congress.gov returned an unexpected error (5xx or another non-2xx status).';
|
|
58
62
|
readonly recovery: 'Retry after a short delay; if the failure persists the Congress.gov service may be temporarily degraded.';
|
|
@@ -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;AAkHjD,eAAO,MAAM,mBAAmB
|
|
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;AAkHjD,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA8N9B,CAAC"}
|
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
*/
|
|
5
5
|
import { tool, z } from '@cyanheads/mcp-ts-core';
|
|
6
6
|
import { validationError } from '@cyanheads/mcp-ts-core/errors';
|
|
7
|
-
import { formatCommittees } from '
|
|
8
|
-
import { buildEffectiveQuery, congressErrorContracts, listEnrichment, listOrDetail, notifyIfNoMatches, } from '
|
|
7
|
+
import { formatCommittees } from '../format-helpers.js';
|
|
8
|
+
import { buildEffectiveQuery, congressErrorContracts, listEnrichment, listOrDetail, notifyIfNoMatches, } from '../tool-helpers.js';
|
|
9
9
|
import { getCongressApi } from '../../../services/congress-api/congress-api-service.js';
|
|
10
10
|
// ── Client-side committee name filter ────────────────────────────────────────
|
|
11
11
|
/** Normalize a string for matching: lowercase, strip punctuation/diacritics, collapse whitespace. */
|
|
@@ -37,24 +37,28 @@ export declare const committeeReportsTool: import("@cyanheads/mcp-ts-core").Tool
|
|
|
37
37
|
}, z.core.$loose>, readonly [{
|
|
38
38
|
readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.NotFound;
|
|
39
39
|
readonly reason: 'not_found';
|
|
40
|
+
readonly thrownBy: 'service';
|
|
40
41
|
readonly retryable: false;
|
|
41
42
|
readonly when: 'A requested bill, member, committee, report, vote, or nomination does not exist in Congress.gov.';
|
|
42
43
|
readonly recovery: "Use the tool's list or browse operation to discover valid identifiers, then retry with one that exists.";
|
|
43
44
|
}, {
|
|
44
45
|
readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.RateLimited;
|
|
45
46
|
readonly reason: 'rate_limited';
|
|
47
|
+
readonly thrownBy: 'service';
|
|
46
48
|
readonly retryable: true;
|
|
47
49
|
readonly when: 'The Congress.gov API rate limit (5,000 requests/hour per key) was exceeded.';
|
|
48
50
|
readonly recovery: 'Wait for the hourly rate-limit window to reset before retrying, or reduce the request frequency.';
|
|
49
51
|
}, {
|
|
50
52
|
readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.InvalidParams;
|
|
51
53
|
readonly reason: 'invalid_request';
|
|
54
|
+
readonly thrownBy: 'service';
|
|
52
55
|
readonly retryable: false;
|
|
53
56
|
readonly when: 'Congress.gov rejected the request as malformed — a bad date range or an identifier with an unexpected shape.';
|
|
54
57
|
readonly recovery: 'Check parameter formats: dates must be ISO 8601 like 2026-05-01T00:00:00Z and identifiers must match their documented shape.';
|
|
55
58
|
}, {
|
|
56
59
|
readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.ServiceUnavailable;
|
|
57
60
|
readonly reason: 'upstream_error';
|
|
61
|
+
readonly thrownBy: 'service';
|
|
58
62
|
readonly retryable: true;
|
|
59
63
|
readonly when: 'Congress.gov returned an unexpected error (5xx or another non-2xx status).';
|
|
60
64
|
readonly recovery: 'Retry after a short delay; if the failure persists the Congress.gov service may be temporarily degraded.';
|
|
@@ -73,21 +77,24 @@ export declare const committeeReportsTool: import("@cyanheads/mcp-ts-core").Tool
|
|
|
73
77
|
}, {
|
|
74
78
|
readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.ServiceUnavailable;
|
|
75
79
|
readonly reason: 'document_fetch_failed';
|
|
80
|
+
readonly thrownBy: 'service';
|
|
76
81
|
readonly retryable: true;
|
|
77
82
|
readonly when: 'www.congress.gov did not return a readable document — a non-2xx status, a network failure, an empty body, or a content type that is not text or XML.';
|
|
78
83
|
readonly recovery: 'Retry after a short delay; if the failure persists, request a different format or read the document at the sourceUrl the text operation returns.';
|
|
79
84
|
}, {
|
|
80
85
|
readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.InvalidParams;
|
|
81
86
|
readonly reason: 'document_too_large';
|
|
87
|
+
readonly thrownBy: 'service';
|
|
82
88
|
readonly retryable: false;
|
|
83
89
|
readonly when: 'The document is larger than the byte ceiling this server retrieves, so no character window can be served from it.';
|
|
84
90
|
readonly recovery: 'Read the document at the sourceUrl the text operation returns. A document this size clears the ceiling in every format it publishes, so switching format reaches the same limit.';
|
|
85
91
|
}, {
|
|
86
92
|
readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.InvalidParams;
|
|
87
93
|
readonly reason: 'offset_past_end';
|
|
94
|
+
readonly thrownBy: 'service';
|
|
88
95
|
readonly retryable: false;
|
|
89
|
-
readonly when:
|
|
90
|
-
readonly recovery:
|
|
96
|
+
readonly when: "characterOffset is at or beyond the last character of every text the call would window — the document on 'content', or every returned row's summary text on 'summaries' — so the window would be empty.";
|
|
97
|
+
readonly recovery: "Restart the walk at characterOffset 0 and follow the response's nextOffset (or a summary row's textNextOffset), which goes null once the text has been read to the end.";
|
|
91
98
|
}], {
|
|
92
99
|
effectiveQuery: z.ZodString;
|
|
93
100
|
totalCount: z.ZodNumber;
|
|
@@ -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;AAiCjD,eAAO,MAAM,oBAAoB
|
|
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;AAiCjD,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA+K/B,CAAC"}
|
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
*/
|
|
5
5
|
import { tool, z } from '@cyanheads/mcp-ts-core';
|
|
6
6
|
import { validationError } from '@cyanheads/mcp-ts-core/errors';
|
|
7
|
-
import { formatCommitteeReports } from '
|
|
8
|
-
import { buildEffectiveQuery, congressErrorContracts, documentErrorContracts, documentWindowInput, listEnrichment, listOrDetail, notifyIfNoMatches, } from '
|
|
7
|
+
import { formatCommitteeReports } from '../format-helpers.js';
|
|
8
|
+
import { buildEffectiveQuery, congressErrorContracts, documentErrorContracts, documentWindowInput, listEnrichment, listOrDetail, notifyIfNoMatches, } from '../tool-helpers.js';
|
|
9
9
|
import { getCongressApi } from '../../../services/congress-api/congress-api-service.js';
|
|
10
10
|
import { getCongressDocuments } from '../../../services/congress-documents/congress-documents-service.js';
|
|
11
11
|
import { describeFormat, selectDocumentUrl, } from '../../../services/congress-documents/document-formats.js';
|