@cyanheads/congressgov-mcp-server 0.3.22 → 0.3.24
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 +2 -2
- package/CLAUDE.md +2 -2
- package/README.md +1 -1
- package/dist/mcp-server/tools/definitions/bill-lookup.tool.d.ts +29 -2
- package/dist/mcp-server/tools/definitions/bill-lookup.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/bill-lookup.tool.js +20 -14
- package/dist/mcp-server/tools/definitions/bill-lookup.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/bill-summaries.tool.d.ts +29 -2
- package/dist/mcp-server/tools/definitions/bill-summaries.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/bill-summaries.tool.js +13 -10
- package/dist/mcp-server/tools/definitions/bill-summaries.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/committee-lookup.tool.d.ts +29 -2
- package/dist/mcp-server/tools/definitions/committee-lookup.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/committee-lookup.tool.js +21 -13
- package/dist/mcp-server/tools/definitions/committee-lookup.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/committee-reports.tool.d.ts +29 -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 +15 -8
- package/dist/mcp-server/tools/definitions/committee-reports.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/crs-reports.tool.d.ts +29 -2
- package/dist/mcp-server/tools/definitions/crs-reports.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/crs-reports.tool.js +10 -2
- package/dist/mcp-server/tools/definitions/crs-reports.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/daily-record.tool.d.ts +29 -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 +18 -10
- package/dist/mcp-server/tools/definitions/daily-record.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/enacted-laws.tool.d.ts +29 -2
- package/dist/mcp-server/tools/definitions/enacted-laws.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/enacted-laws.tool.js +10 -8
- package/dist/mcp-server/tools/definitions/enacted-laws.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/member-lookup.tool.d.ts +29 -2
- package/dist/mcp-server/tools/definitions/member-lookup.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/member-lookup.tool.js +20 -14
- package/dist/mcp-server/tools/definitions/member-lookup.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/roll-votes.tool.d.ts +29 -2
- package/dist/mcp-server/tools/definitions/roll-votes.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/roll-votes.tool.js +28 -8
- package/dist/mcp-server/tools/definitions/roll-votes.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/senate-nominations.tool.d.ts +29 -2
- package/dist/mcp-server/tools/definitions/senate-nominations.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/senate-nominations.tool.js +22 -15
- package/dist/mcp-server/tools/definitions/senate-nominations.tool.js.map +1 -1
- package/dist/mcp-server/tools/format-helpers.d.ts +0 -1
- package/dist/mcp-server/tools/format-helpers.d.ts.map +1 -1
- package/dist/mcp-server/tools/format-helpers.js +16 -27
- package/dist/mcp-server/tools/format-helpers.js.map +1 -1
- package/dist/mcp-server/tools/tool-helpers.d.ts +58 -6
- package/dist/mcp-server/tools/tool-helpers.d.ts.map +1 -1
- package/dist/mcp-server/tools/tool-helpers.js +90 -15
- 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 +81 -11
- package/dist/services/congress-api/congress-api-service.js.map +1 -1
- package/package.json +4 -3
- package/server.json +3 -3
package/AGENTS.md
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
# Agent Protocol
|
|
2
2
|
|
|
3
3
|
**Server:** congressgov-mcp-server
|
|
4
|
-
**Version:** 0.3.
|
|
5
|
-
**Framework:** [@cyanheads/mcp-ts-core](https://www.npmjs.com/package/@cyanheads/mcp-ts-core) `^0.9.
|
|
4
|
+
**Version:** 0.3.24
|
|
5
|
+
**Framework:** [@cyanheads/mcp-ts-core](https://www.npmjs.com/package/@cyanheads/mcp-ts-core) `^0.9.16`
|
|
6
6
|
**Engines:** Bun ≥1.3.0, Node ≥24.0.0
|
|
7
7
|
**MCP SDK:** `@modelcontextprotocol/sdk` ^1.29.0
|
|
8
8
|
**Zod:** ^4.4.3
|
package/CLAUDE.md
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
# Agent Protocol
|
|
2
2
|
|
|
3
3
|
**Server:** congressgov-mcp-server
|
|
4
|
-
**Version:** 0.3.
|
|
5
|
-
**Framework:** [@cyanheads/mcp-ts-core](https://www.npmjs.com/package/@cyanheads/mcp-ts-core) `^0.9.
|
|
4
|
+
**Version:** 0.3.24
|
|
5
|
+
**Framework:** [@cyanheads/mcp-ts-core](https://www.npmjs.com/package/@cyanheads/mcp-ts-core) `^0.9.16`
|
|
6
6
|
**Engines:** Bun ≥1.3.0, Node ≥24.0.0
|
|
7
7
|
**MCP SDK:** `@modelcontextprotocol/sdk` ^1.29.0
|
|
8
8
|
**Zod:** ^4.4.3
|
package/README.md
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
|
|
8
8
|
<div align="center">
|
|
9
9
|
|
|
10
|
-
[](./CHANGELOG.md) [](./LICENSE) [](https://github.com/users/cyanheads/packages/container/package/congressgov-mcp-server) [](https://modelcontextprotocol.io/) [](https://www.npmjs.com/package/@cyanheads/congressgov-mcp-server) [](https://www.typescriptlang.org/) [](https://bun.sh/)
|
|
11
11
|
|
|
12
12
|
</div>
|
|
13
13
|
|
|
@@ -43,6 +43,33 @@ export declare const billLookupTool: import("@cyanheads/mcp-ts-core").ToolDefini
|
|
|
43
43
|
count: z.ZodNumber;
|
|
44
44
|
nextOffset: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
45
45
|
}, z.core.$strip>>;
|
|
46
|
-
|
|
47
|
-
|
|
46
|
+
}, z.core.$loose>, readonly [{
|
|
47
|
+
readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.NotFound;
|
|
48
|
+
readonly reason: "not_found";
|
|
49
|
+
readonly retryable: false;
|
|
50
|
+
readonly when: "A requested bill, member, committee, report, vote, or nomination does not exist in Congress.gov.";
|
|
51
|
+
readonly recovery: "Use the tool's list or browse operation to discover valid identifiers, then retry with one that exists.";
|
|
52
|
+
}, {
|
|
53
|
+
readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.RateLimited;
|
|
54
|
+
readonly reason: "rate_limited";
|
|
55
|
+
readonly retryable: true;
|
|
56
|
+
readonly when: "The Congress.gov API rate limit (5,000 requests/hour per key) was exceeded.";
|
|
57
|
+
readonly recovery: "Wait for the hourly rate-limit window to reset before retrying, or reduce the request frequency.";
|
|
58
|
+
}, {
|
|
59
|
+
readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.InvalidParams;
|
|
60
|
+
readonly reason: "invalid_request";
|
|
61
|
+
readonly retryable: false;
|
|
62
|
+
readonly when: "Congress.gov rejected the request as malformed — a bad date range or an identifier with an unexpected shape.";
|
|
63
|
+
readonly recovery: "Check parameter formats: dates must be ISO 8601 like 2026-05-01T00:00:00Z and identifiers must match their documented shape.";
|
|
64
|
+
}, {
|
|
65
|
+
readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.ServiceUnavailable;
|
|
66
|
+
readonly reason: "upstream_error";
|
|
67
|
+
readonly retryable: true;
|
|
68
|
+
readonly when: "Congress.gov returned an unexpected error (5xx or another non-2xx status).";
|
|
69
|
+
readonly recovery: "Retry after a short delay; if the failure persists the Congress.gov service may be temporarily degraded.";
|
|
70
|
+
}], {
|
|
71
|
+
effectiveQuery: z.ZodString;
|
|
72
|
+
totalCount: z.ZodNumber;
|
|
73
|
+
notice: z.ZodOptional<z.ZodString>;
|
|
74
|
+
}>;
|
|
48
75
|
//# sourceMappingURL=bill-lookup.tool.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bill-lookup.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/bill-lookup.tool.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"bill-lookup.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/bill-lookup.tool.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;AAmCjD,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAwIzB,CAAC"}
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
import { tool, z } from '@cyanheads/mcp-ts-core';
|
|
6
6
|
import { validationError } from '@cyanheads/mcp-ts-core/errors';
|
|
7
7
|
import { formatBills } from '../../../mcp-server/tools/format-helpers.js';
|
|
8
|
-
import {
|
|
8
|
+
import { buildEffectiveQuery, congressErrorContracts, listEnrichment, listOrDetail, normalizeOptionalString, validateIsoDateTime, } from '../../../mcp-server/tools/tool-helpers.js';
|
|
9
9
|
import { getCongressApi } from '../../../services/congress-api/congress-api-service.js';
|
|
10
10
|
import { BILL_TYPE_CODES } from '../../../services/congress-api/types.js';
|
|
11
11
|
const BillTypeEnum = z.enum(BILL_TYPE_CODES);
|
|
@@ -28,6 +28,7 @@ const SUB_RESOURCE_MAP = {
|
|
|
28
28
|
export const billLookupTool = tool('congressgov_bill_lookup', {
|
|
29
29
|
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).`,
|
|
30
30
|
annotations: { readOnlyHint: true, idempotentHint: true, openWorldHint: true },
|
|
31
|
+
errors: congressErrorContracts,
|
|
31
32
|
input: z.object({
|
|
32
33
|
operation: OperationEnum.describe('Which data to retrieve.'),
|
|
33
34
|
congress: z.number().int().positive().describe('Congress number (e.g., 118, 119).'),
|
|
@@ -54,6 +55,7 @@ export const billLookupTool = tool('congressgov_bill_lookup', {
|
|
|
54
55
|
offset: z.number().int().min(0).default(0).describe('Pagination offset.'),
|
|
55
56
|
}),
|
|
56
57
|
output: listOrDetail('bill', 'Bill record (sponsor, policy area, latest action, CBO estimates, law citation) for `get`; absent for `list` and sub-resources.'),
|
|
58
|
+
enrichment: listEnrichment,
|
|
57
59
|
format: formatBills,
|
|
58
60
|
async handler(input, ctx) {
|
|
59
61
|
const api = getCongressApi();
|
|
@@ -70,15 +72,16 @@ export const billLookupTool = tool('congressgov_bill_lookup', {
|
|
|
70
72
|
offset: input.offset,
|
|
71
73
|
}, ctx);
|
|
72
74
|
ctx.log.info('Bills listed', { congress: input.congress, count: result.data.length });
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
75
|
+
ctx.enrich.echo(buildEffectiveQuery('bills', {
|
|
76
|
+
congress: input.congress,
|
|
77
|
+
billType: input.billType,
|
|
78
|
+
fromDateTime,
|
|
79
|
+
toDateTime,
|
|
80
|
+
}));
|
|
81
|
+
ctx.enrich.total(result.pagination.count);
|
|
82
|
+
if (result.data.length === 0)
|
|
83
|
+
ctx.enrich.notice('No bills matched the filters. Try broadening the date range or removing billType.');
|
|
84
|
+
return result;
|
|
82
85
|
}
|
|
83
86
|
if (!input.billType || !input.billNumber) {
|
|
84
87
|
throw validationError(`The '${input.operation}' operation requires congress, billType, and billNumber. Use 'list' first to find the bill, then request its ${input.operation}.`, { operation: input.operation, billType: input.billType, billNumber: input.billNumber });
|
|
@@ -94,6 +97,8 @@ export const billLookupTool = tool('congressgov_bill_lookup', {
|
|
|
94
97
|
billType: input.billType,
|
|
95
98
|
billNumber: input.billNumber,
|
|
96
99
|
});
|
|
100
|
+
ctx.enrich.echo(`${input.billType.toUpperCase()} ${input.billNumber} in the ${input.congress}th Congress`);
|
|
101
|
+
ctx.enrich.total(1);
|
|
97
102
|
return result;
|
|
98
103
|
}
|
|
99
104
|
const subResource = SUB_RESOURCE_MAP[input.operation] ?? input.operation;
|
|
@@ -111,10 +116,11 @@ export const billLookupTool = tool('congressgov_bill_lookup', {
|
|
|
111
116
|
billNumber: input.billNumber,
|
|
112
117
|
subResource,
|
|
113
118
|
});
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
119
|
+
ctx.enrich.echo(`${input.operation} for ${input.billType.toUpperCase()} ${input.billNumber} in the ${input.congress}th Congress`);
|
|
120
|
+
ctx.enrich.total(result.pagination.count);
|
|
121
|
+
if (result.data.length === 0)
|
|
122
|
+
ctx.enrich.notice(`No ${input.operation} found for ${input.billType.toUpperCase()} ${input.billNumber}.`);
|
|
123
|
+
return result;
|
|
118
124
|
},
|
|
119
125
|
});
|
|
120
126
|
//# sourceMappingURL=bill-lookup.tool.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bill-lookup.tool.js","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/bill-lookup.tool.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AA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;
|
|
27
27
|
}, z.core.$strip>;
|
|
28
|
-
|
|
29
|
-
|
|
28
|
+
}, z.core.$loose>, readonly [{
|
|
29
|
+
readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.NotFound;
|
|
30
|
+
readonly reason: "not_found";
|
|
31
|
+
readonly retryable: false;
|
|
32
|
+
readonly when: "A requested bill, member, committee, report, vote, or nomination does not exist in Congress.gov.";
|
|
33
|
+
readonly recovery: "Use the tool's list or browse operation to discover valid identifiers, then retry with one that exists.";
|
|
34
|
+
}, {
|
|
35
|
+
readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.RateLimited;
|
|
36
|
+
readonly reason: "rate_limited";
|
|
37
|
+
readonly retryable: true;
|
|
38
|
+
readonly when: "The Congress.gov API rate limit (5,000 requests/hour per key) was exceeded.";
|
|
39
|
+
readonly recovery: "Wait for the hourly rate-limit window to reset before retrying, or reduce the request frequency.";
|
|
40
|
+
}, {
|
|
41
|
+
readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.InvalidParams;
|
|
42
|
+
readonly reason: "invalid_request";
|
|
43
|
+
readonly retryable: false;
|
|
44
|
+
readonly when: "Congress.gov rejected the request as malformed — a bad date range or an identifier with an unexpected shape.";
|
|
45
|
+
readonly recovery: "Check parameter formats: dates must be ISO 8601 like 2026-05-01T00:00:00Z and identifiers must match their documented shape.";
|
|
46
|
+
}, {
|
|
47
|
+
readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.ServiceUnavailable;
|
|
48
|
+
readonly reason: "upstream_error";
|
|
49
|
+
readonly retryable: true;
|
|
50
|
+
readonly when: "Congress.gov returned an unexpected error (5xx or another non-2xx status).";
|
|
51
|
+
readonly recovery: "Retry after a short delay; if the failure persists the Congress.gov service may be temporarily degraded.";
|
|
52
|
+
}], {
|
|
53
|
+
effectiveQuery: z.ZodString;
|
|
54
|
+
totalCount: z.ZodNumber;
|
|
55
|
+
notice: z.ZodOptional<z.ZodString>;
|
|
56
|
+
}>;
|
|
30
57
|
//# sourceMappingURL=bill-summaries.tool.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bill-summaries.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/bill-summaries.tool.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"bill-summaries.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/bill-summaries.tool.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;AAiBjD,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAkF5B,CAAC"}
|
|
@@ -5,13 +5,14 @@
|
|
|
5
5
|
import { tool, z } from '@cyanheads/mcp-ts-core';
|
|
6
6
|
import { validationError } from '@cyanheads/mcp-ts-core/errors';
|
|
7
7
|
import { formatSummaries } from '../../../mcp-server/tools/format-helpers.js';
|
|
8
|
-
import {
|
|
8
|
+
import { buildEffectiveQuery, congressErrorContracts, listEnrichment, listOutput, normalizeOptionalString, validateIsoDateTime, } from '../../../mcp-server/tools/tool-helpers.js';
|
|
9
9
|
import { getCongressApi } from '../../../services/congress-api/congress-api-service.js';
|
|
10
10
|
import { BILL_TYPE_CODES } from '../../../services/congress-api/types.js';
|
|
11
11
|
const DEFAULT_LOOKBACK_MS = 7 * 24 * 60 * 60 * 1000;
|
|
12
12
|
export const billSummariesTool = tool('congressgov_bill_summaries', {
|
|
13
13
|
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, use congressgov_bill_lookup with operation='summaries' instead.`,
|
|
14
14
|
annotations: { readOnlyHint: true, idempotentHint: true, openWorldHint: true },
|
|
15
|
+
errors: congressErrorContracts,
|
|
15
16
|
input: z.object({
|
|
16
17
|
congress: z
|
|
17
18
|
.number()
|
|
@@ -32,6 +33,7 @@ export const billSummariesTool = tool('congressgov_bill_summaries', {
|
|
|
32
33
|
offset: z.number().int().min(0).default(0).describe('Pagination offset.'),
|
|
33
34
|
}),
|
|
34
35
|
output: listOutput,
|
|
36
|
+
enrichment: listEnrichment,
|
|
35
37
|
format: formatSummaries,
|
|
36
38
|
async handler(input, ctx) {
|
|
37
39
|
const fromDateTimeInput = validateIsoDateTime(normalizeOptionalString(input.fromDateTime), 'fromDateTime');
|
|
@@ -53,15 +55,16 @@ export const billSummariesTool = tool('congressgov_bill_summaries', {
|
|
|
53
55
|
offset: input.offset,
|
|
54
56
|
}, ctx);
|
|
55
57
|
ctx.log.info('Summaries listed', { count: result.data.length });
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
58
|
+
ctx.enrich.echo(buildEffectiveQuery('bill summaries', {
|
|
59
|
+
congress: input.congress,
|
|
60
|
+
billType: input.billType,
|
|
61
|
+
fromDateTime,
|
|
62
|
+
toDateTime: toDateTimeInput,
|
|
63
|
+
}));
|
|
64
|
+
ctx.enrich.total(result.pagination.count);
|
|
65
|
+
if (result.data.length === 0)
|
|
66
|
+
ctx.enrich.notice('No summaries found. Try broadening the date range or removing billType/congress filters.');
|
|
67
|
+
return result;
|
|
65
68
|
},
|
|
66
69
|
});
|
|
67
70
|
//# 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;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,CAAC,MAAM;SACrB,EACD,GAAG,CACJ,CAAC;QACF,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,kBAAkB,EAAE,EAAE,KAAK,EAAE,MAAM,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC,CAAC;QAChE,
|
|
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,mBAAmB,GACpB,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EAAE,cAAc,EAAE,MAAM,iDAAiD,CAAC;AACjF,OAAO,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAC;AAEnE,MAAM,mBAAmB,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC;AAEpD,MAAM,CAAC,MAAM,iBAAiB,GAAG,IAAI,CAAC,4BAA4B,EAAE;IAClE,WAAW,EAAE,2jBAA2jB;IACxkB,WAAW,EAAE,EAAE,YAAY,EAAE,IAAI,EAAE,cAAc,EAAE,IAAI,EAAE,aAAa,EAAE,IAAI,EAAE;IAC9E,MAAM,EAAE,sBAAsB;IAC9B,KAAK,EAAE,CAAC,CAAC,MAAM,CAAC;QACd,QAAQ,EAAE,CAAC;aACR,MAAM,EAAE;aACR,GAAG,EAAE;aACL,QAAQ,EAAE;aACV,QAAQ,EAAE;aACV,QAAQ,CAAC,uEAAuE,CAAC;QACpF,QAAQ,EAAE,CAAC,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC,QAAQ,EAAE,CAA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AC,WAAW,EAAE,CAAC,OAAO,CAAC,WAAW,EAAE,GAAG,CAAC;gBACpF,CAAC,CAAC,SAAS,CAAC,CAAC;QAEjB,MAAM,GAAG,GAAG,cAAc,EAAE,CAAC;QAC7B,MAAM,MAAM,GAAG,MAAM,GAAG,CAAC,aAAa,CACpC;YACE,QAAQ,EAAE,KAAK,CAAC,QAAQ;YACxB,QAAQ,EAAE,KAAK,CAAC,QAAQ;YACxB,YAAY;YACZ,UAAU,EAAE,eAAe;YAC3B,KAAK,EAAE,KAAK,CAAC,KAAK;YAClB,MAAM,EAAE,KAAK,CAAC,MAAM;SACrB,EACD,GAAG,CACJ,CAAC;QACF,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,kBAAkB,EAAE,EAAE,KAAK,EAAE,MAAM,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC,CAAC;QAChE,GAAG,CAAC,MAAM,CAAC,IAAI,CACb,mBAAmB,CAAC,gBAAgB,EAAE;YACpC,QAAQ,EAAE,KAAK,CAAC,QAAQ;YACxB,QAAQ,EAAE,KAAK,CAAC,QAAQ;YACxB,YAAY;YACZ,UAAU,EAAE,eAAe;SAC5B,CAAC,CACH,CAAC;QACF,GAAG,CAAC,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC;QAC1C,IAAI,MAAM,CAAC,IAAI,CAAC,MAAM,KAAK,CAAC;YAC1B,GAAG,CAAC,MAAM,CAAC,MAAM,CACf,0FAA0F,CAC3F,CAAC;QACJ,OAAO,MAAM,CAAC;IAChB,CAAC;CACF,CAAC,CAAC"}
|
|
@@ -30,6 +30,33 @@ export declare const committeeLookupTool: import("@cyanheads/mcp-ts-core").ToolD
|
|
|
30
30
|
count: z.ZodNumber;
|
|
31
31
|
nextOffset: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
32
32
|
}, z.core.$strip>>;
|
|
33
|
-
|
|
34
|
-
|
|
33
|
+
}, z.core.$loose>, readonly [{
|
|
34
|
+
readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.NotFound;
|
|
35
|
+
readonly reason: "not_found";
|
|
36
|
+
readonly retryable: false;
|
|
37
|
+
readonly when: "A requested bill, member, committee, report, vote, or nomination does not exist in Congress.gov.";
|
|
38
|
+
readonly recovery: "Use the tool's list or browse operation to discover valid identifiers, then retry with one that exists.";
|
|
39
|
+
}, {
|
|
40
|
+
readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.RateLimited;
|
|
41
|
+
readonly reason: "rate_limited";
|
|
42
|
+
readonly retryable: true;
|
|
43
|
+
readonly when: "The Congress.gov API rate limit (5,000 requests/hour per key) was exceeded.";
|
|
44
|
+
readonly recovery: "Wait for the hourly rate-limit window to reset before retrying, or reduce the request frequency.";
|
|
45
|
+
}, {
|
|
46
|
+
readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.InvalidParams;
|
|
47
|
+
readonly reason: "invalid_request";
|
|
48
|
+
readonly retryable: false;
|
|
49
|
+
readonly when: "Congress.gov rejected the request as malformed — a bad date range or an identifier with an unexpected shape.";
|
|
50
|
+
readonly recovery: "Check parameter formats: dates must be ISO 8601 like 2026-05-01T00:00:00Z and identifiers must match their documented shape.";
|
|
51
|
+
}, {
|
|
52
|
+
readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.ServiceUnavailable;
|
|
53
|
+
readonly reason: "upstream_error";
|
|
54
|
+
readonly retryable: true;
|
|
55
|
+
readonly when: "Congress.gov returned an unexpected error (5xx or another non-2xx status).";
|
|
56
|
+
readonly recovery: "Retry after a short delay; if the failure persists the Congress.gov service may be temporarily degraded.";
|
|
57
|
+
}], {
|
|
58
|
+
effectiveQuery: z.ZodString;
|
|
59
|
+
totalCount: z.ZodNumber;
|
|
60
|
+
notice: z.ZodOptional<z.ZodString>;
|
|
61
|
+
}>;
|
|
35
62
|
//# sourceMappingURL=committee-lookup.tool.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"committee-lookup.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/committee-lookup.tool.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"committee-lookup.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/committee-lookup.tool.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;AAsBjD,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA+H9B,CAAC"}
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
import { tool, z } from '@cyanheads/mcp-ts-core';
|
|
6
6
|
import { validationError } from '@cyanheads/mcp-ts-core/errors';
|
|
7
7
|
import { formatCommittees } from '../../../mcp-server/tools/format-helpers.js';
|
|
8
|
-
import {
|
|
8
|
+
import { buildEffectiveQuery, congressErrorContracts, listEnrichment, listOrDetail, } from '../../../mcp-server/tools/tool-helpers.js';
|
|
9
9
|
import { getCongressApi } from '../../../services/congress-api/congress-api-service.js';
|
|
10
10
|
/** Committee codes carry chamber in the first letter (h=House, s=Senate, j=Joint). */
|
|
11
11
|
function inferChamberFromCode(code) {
|
|
@@ -21,6 +21,7 @@ function inferChamberFromCode(code) {
|
|
|
21
21
|
export const committeeLookupTool = tool('congressgov_committee_lookup', {
|
|
22
22
|
description: `Browse congressional committees and their legislation, reports, and nominations. Committee codes follow the pattern chamber-prefix (h/s/j) + abbreviation + number — use 'list' to discover codes, then 'get' or drill into 'bills', 'reports', or 'nominations' ('nominations' is Senate-only). 'get' and sub-resources only need committeeCode (chamber is inferred from the prefix); pass chamber explicitly to override. The 'bills' sub-resource defaults to 'recent' order (newest update-date first); pass order='oldest' for ascending update-date order. Upstream omits bill titles from the 'bills' sub-resource — rows carry only {congress, billType, billNumber, actionDate, relationshipType, url}; chain 'congressgov_bill_lookup get' per row to retrieve titles and policy area.`,
|
|
23
23
|
annotations: { readOnlyHint: true, idempotentHint: true, openWorldHint: true },
|
|
24
|
+
errors: congressErrorContracts,
|
|
24
25
|
input: z.object({
|
|
25
26
|
operation: z
|
|
26
27
|
.enum(['list', 'get', 'bills', 'reports', 'nominations'])
|
|
@@ -42,6 +43,7 @@ export const committeeLookupTool = tool('congressgov_committee_lookup', {
|
|
|
42
43
|
.describe("Sort order for the 'bills' sub-resource. 'recent' (default) returns newest update-date first; 'oldest' returns ascending update-date order. Ignored by other operations."),
|
|
43
44
|
}),
|
|
44
45
|
output: listOrDetail('committee', 'Committee record for `get` (name, chamber, subcommittees, history, sub-resource counts); absent for `list` and sub-resources.'),
|
|
46
|
+
enrichment: listEnrichment,
|
|
45
47
|
format: formatCommittees,
|
|
46
48
|
async handler(input, ctx) {
|
|
47
49
|
const api = getCongressApi();
|
|
@@ -53,13 +55,11 @@ export const committeeLookupTool = tool('congressgov_committee_lookup', {
|
|
|
53
55
|
offset: input.offset,
|
|
54
56
|
}, ctx);
|
|
55
57
|
ctx.log.info('Committees listed', { count: result.data.length });
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
}),
|
|
62
|
-
};
|
|
58
|
+
ctx.enrich.echo(buildEffectiveQuery('committees', { congress: input.congress, chamber: input.chamber }));
|
|
59
|
+
ctx.enrich.total(result.pagination.count);
|
|
60
|
+
if (result.data.length === 0)
|
|
61
|
+
ctx.enrich.notice('No committees found. Try removing the chamber filter or check the congress number.');
|
|
62
|
+
return result;
|
|
63
63
|
}
|
|
64
64
|
if (!input.committeeCode) {
|
|
65
65
|
throw validationError(`The '${input.operation}' operation requires committeeCode. Use 'list' to discover available committees.`, { operation: input.operation, committeeCode: input.committeeCode });
|
|
@@ -71,18 +71,25 @@ export const committeeLookupTool = tool('congressgov_committee_lookup', {
|
|
|
71
71
|
if (input.operation === 'get') {
|
|
72
72
|
const result = await api.getCommittee(chamber, input.committeeCode, ctx);
|
|
73
73
|
ctx.log.info('Committee retrieved', { committeeCode: input.committeeCode });
|
|
74
|
+
ctx.enrich.echo(`committee ${input.committeeCode}`);
|
|
75
|
+
ctx.enrich.total(1);
|
|
74
76
|
return result;
|
|
75
77
|
}
|
|
76
78
|
if (input.operation === 'nominations' && chamber !== 'senate') {
|
|
77
79
|
throw validationError("Nominations are only referred to Senate committees. Use chamber='senate' or a Senate committee code (s-prefix).", { field: 'chamber', chamber });
|
|
78
80
|
}
|
|
79
81
|
if (input.operation === 'bills' && input.order === 'recent') {
|
|
80
|
-
|
|
82
|
+
const recentResult = await fetchCommitteeBillsRecent({
|
|
81
83
|
chamber,
|
|
82
84
|
committeeCode: input.committeeCode,
|
|
83
85
|
limit: input.limit,
|
|
84
86
|
offset: input.offset,
|
|
85
87
|
}, ctx);
|
|
88
|
+
ctx.enrich.echo(`bills for committee ${input.committeeCode} (recent order)`);
|
|
89
|
+
ctx.enrich.total(recentResult.pagination.count);
|
|
90
|
+
if (recentResult.data.length === 0)
|
|
91
|
+
ctx.enrich.notice(`No bills found for committee ${input.committeeCode}.`);
|
|
92
|
+
return recentResult;
|
|
86
93
|
}
|
|
87
94
|
const result = await api.getCommitteeSubResource({
|
|
88
95
|
chamber,
|
|
@@ -95,10 +102,11 @@ export const committeeLookupTool = tool('congressgov_committee_lookup', {
|
|
|
95
102
|
committeeCode: input.committeeCode,
|
|
96
103
|
subResource: input.operation,
|
|
97
104
|
});
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
105
|
+
ctx.enrich.echo(`${input.operation} for committee ${input.committeeCode}`);
|
|
106
|
+
ctx.enrich.total(result.pagination.count);
|
|
107
|
+
if (result.data.length === 0)
|
|
108
|
+
ctx.enrich.notice(`No ${input.operation} found for committee ${input.committeeCode}.`);
|
|
109
|
+
return result;
|
|
102
110
|
},
|
|
103
111
|
});
|
|
104
112
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"committee-lookup.tool.js","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/committee-lookup.tool.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAEhE,OAAO,EAAE,gBAAgB,EAAE,MAAM,sCAAsC,CAAC;AACxE,OAAO,
|
|
1
|
+
{"version":3,"file":"committee-lookup.tool.js","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/committee-lookup.tool.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAEhE,OAAO,EAAE,gBAAgB,EAAE,MAAM,sCAAsC,CAAC;AACxE,OAAO,EACL,mBAAmB,EACnB,sBAAsB,EACtB,cAAc,EACd,YAAY,GACb,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EAAE,cAAc,EAAE,MAAM,iDAAiD,CAAC;AAGjF,sFAAsF;AACtF,SAAS,oBAAoB,CAAC,IAAY;IACxC,MAAM,KAAK,GAAG,IAAI,CAAC,CAAC,CAAC,EAAE,WAAW,EAAE,CAAC;IACrC,IAAI,KAAK,KAAK,GAAG;QAAE,OAAO,QAAQ,CAAC;IACnC,IAAI,KAAK,KAAK,GAAG;QAAE,OAAO,OAAO,CAAC;IAClC,IAAI,KAAK,KAAK,GAAG;QAAE,OAAO,OAAO,CAAC;IAClC,OAAO;AACT,CAAC;AAED,MAAM,CAAC,MAAM,mBAAmB,GAAG,IAAI,CAAC,8BAA8B,EAAE;IACtE,WAAW,EAAE,mwBAAmwB;IAChxB,WAAW,EAAE,EAAE,YAAY,EAAE,IAAI,EAAE,cAAc,EAAE,IAA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;QACzB,MAAM,EAAE,MAAM,CAAC,MAAM;KACtB,CAAC,CAAC;IAEH,OAAO;QACL,GAAG,MAAM;QACT,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,UAAU,EAAE;KACzC,CAAC;AACJ,CAAC"}
|
|
@@ -24,6 +24,33 @@ export declare const committeeReportsTool: import("@cyanheads/mcp-ts-core").Tool
|
|
|
24
24
|
count: z.ZodNumber;
|
|
25
25
|
nextOffset: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
26
26
|
}, z.core.$strip>>;
|
|
27
|
-
|
|
28
|
-
|
|
27
|
+
}, z.core.$loose>, readonly [{
|
|
28
|
+
readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.NotFound;
|
|
29
|
+
readonly reason: "not_found";
|
|
30
|
+
readonly retryable: false;
|
|
31
|
+
readonly when: "A requested bill, member, committee, report, vote, or nomination does not exist in Congress.gov.";
|
|
32
|
+
readonly recovery: "Use the tool's list or browse operation to discover valid identifiers, then retry with one that exists.";
|
|
33
|
+
}, {
|
|
34
|
+
readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.RateLimited;
|
|
35
|
+
readonly reason: "rate_limited";
|
|
36
|
+
readonly retryable: true;
|
|
37
|
+
readonly when: "The Congress.gov API rate limit (5,000 requests/hour per key) was exceeded.";
|
|
38
|
+
readonly recovery: "Wait for the hourly rate-limit window to reset before retrying, or reduce the request frequency.";
|
|
39
|
+
}, {
|
|
40
|
+
readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.InvalidParams;
|
|
41
|
+
readonly reason: "invalid_request";
|
|
42
|
+
readonly retryable: false;
|
|
43
|
+
readonly when: "Congress.gov rejected the request as malformed — a bad date range or an identifier with an unexpected shape.";
|
|
44
|
+
readonly recovery: "Check parameter formats: dates must be ISO 8601 like 2026-05-01T00:00:00Z and identifiers must match their documented shape.";
|
|
45
|
+
}, {
|
|
46
|
+
readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.ServiceUnavailable;
|
|
47
|
+
readonly reason: "upstream_error";
|
|
48
|
+
readonly retryable: true;
|
|
49
|
+
readonly when: "Congress.gov returned an unexpected error (5xx or another non-2xx status).";
|
|
50
|
+
readonly recovery: "Retry after a short delay; if the failure persists the Congress.gov service may be temporarily degraded.";
|
|
51
|
+
}], {
|
|
52
|
+
effectiveQuery: z.ZodString;
|
|
53
|
+
totalCount: z.ZodNumber;
|
|
54
|
+
notice: z.ZodOptional<z.ZodString>;
|
|
55
|
+
}>;
|
|
29
56
|
//# sourceMappingURL=committee-reports.tool.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"committee-reports.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/committee-reports.tool.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"committee-reports.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/committee-reports.tool.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;AAYjD,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA6G/B,CAAC"}
|
|
@@ -5,11 +5,12 @@
|
|
|
5
5
|
import { tool, z } from '@cyanheads/mcp-ts-core';
|
|
6
6
|
import { validationError } from '@cyanheads/mcp-ts-core/errors';
|
|
7
7
|
import { formatCommitteeReports } from '../../../mcp-server/tools/format-helpers.js';
|
|
8
|
-
import {
|
|
8
|
+
import { buildEffectiveQuery, congressErrorContracts, listEnrichment, listOrDetail, } from '../../../mcp-server/tools/tool-helpers.js';
|
|
9
9
|
import { getCongressApi } from '../../../services/congress-api/congress-api-service.js';
|
|
10
10
|
export const committeeReportsTool = tool('congressgov_committee_reports', {
|
|
11
11
|
description: `Browse and retrieve committee reports from Congress.gov — reports accompany legislation reported out of committee and explain the bill's purpose, committee amendments, dissenting views, and the committee vote. Report types are 'hrpt' (House), 'srpt' (Senate), and 'erpt' (Executive).`,
|
|
12
12
|
annotations: { readOnlyHint: true, idempotentHint: true, openWorldHint: true },
|
|
13
|
+
errors: congressErrorContracts,
|
|
13
14
|
input: z.object({
|
|
14
15
|
operation: z.enum(['list', 'get', 'text']).describe('Which data to retrieve.'),
|
|
15
16
|
congress: z.number().int().positive().describe('Congress number.'),
|
|
@@ -27,6 +28,7 @@ export const committeeReportsTool = tool('congressgov_committee_reports', {
|
|
|
27
28
|
offset: z.number().int().min(0).default(0).describe('Pagination offset.'),
|
|
28
29
|
}),
|
|
29
30
|
output: listOrDetail('report', "the committee report (citation, title, committees, associated bill); for `text`, an alternative key 'text' carries an array of {type, url} format links."),
|
|
31
|
+
enrichment: listEnrichment,
|
|
30
32
|
format: formatCommitteeReports,
|
|
31
33
|
async handler(input, ctx) {
|
|
32
34
|
const api = getCongressApi();
|
|
@@ -41,13 +43,14 @@ export const committeeReportsTool = tool('congressgov_committee_reports', {
|
|
|
41
43
|
congress: input.congress,
|
|
42
44
|
count: result.data.length,
|
|
43
45
|
});
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
46
|
+
ctx.enrich.echo(buildEffectiveQuery('committee reports', {
|
|
47
|
+
congress: input.congress,
|
|
48
|
+
reportType: input.reportType,
|
|
49
|
+
}));
|
|
50
|
+
ctx.enrich.total(result.pagination.count);
|
|
51
|
+
if (result.data.length === 0)
|
|
52
|
+
ctx.enrich.notice('No committee reports found. Try removing the reportType filter or check the congress number.');
|
|
53
|
+
return result;
|
|
51
54
|
}
|
|
52
55
|
if (!input.reportType || !input.reportNumber) {
|
|
53
56
|
throw validationError(`The '${input.operation}' operation requires reportType and reportNumber. Use 'list' to browse available reports.`, {
|
|
@@ -67,6 +70,8 @@ export const committeeReportsTool = tool('congressgov_committee_reports', {
|
|
|
67
70
|
reportType: input.reportType,
|
|
68
71
|
reportNumber: input.reportNumber,
|
|
69
72
|
});
|
|
73
|
+
ctx.enrich.echo(`text formats for ${input.reportType.toUpperCase()} ${input.reportNumber} (${input.congress}th Congress)`);
|
|
74
|
+
ctx.enrich.total(Array.isArray(result.text) ? result.text.length : 1);
|
|
70
75
|
return result;
|
|
71
76
|
}
|
|
72
77
|
const result = await api.getCommitteeReport({
|
|
@@ -79,6 +84,8 @@ export const committeeReportsTool = tool('congressgov_committee_reports', {
|
|
|
79
84
|
reportType: input.reportType,
|
|
80
85
|
reportNumber: input.reportNumber,
|
|
81
86
|
});
|
|
87
|
+
ctx.enrich.echo(`${input.reportType.toUpperCase()} ${input.reportNumber} (${input.congress}th Congress)`);
|
|
88
|
+
ctx.enrich.total(1);
|
|
82
89
|
return result;
|
|
83
90
|
},
|
|
84
91
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"committee-reports.tool.js","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/committee-reports.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,sBAAsB,EAAE,MAAM,sCAAsC,CAAC;AAC9E,OAAO,
|
|
1
|
+
{"version":3,"file":"committee-reports.tool.js","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/committee-reports.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,sBAAsB,EAAE,MAAM,sCAAsC,CAAC;AAC9E,OAAO,EACL,mBAA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,EAAE,KAAK,CAAC,UAAU;YAC5B,YAAY,EAAE,KAAK,CAAC,YAAY;SACjC,CAAC,CAAC;QACH,GAAG,CAAC,MAAM,CAAC,IAAI,CACb,GAAG,KAAK,CAAC,UAAU,CAAC,WAAW,EAAE,IAAI,KAAK,CAAC,YAAY,KAAK,KAAK,CAAC,QAAQ,cAAc,CACzF,CAAC;QACF,GAAG,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;QACpB,OAAO,MAAM,CAAC;IAChB,CAAC;CACF,CAAC,CAAC"}
|
|
@@ -17,6 +17,33 @@ export declare const crsReportsTool: import("@cyanheads/mcp-ts-core").ToolDefini
|
|
|
17
17
|
count: z.ZodNumber;
|
|
18
18
|
nextOffset: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
19
19
|
}, z.core.$strip>>;
|
|
20
|
-
|
|
21
|
-
|
|
20
|
+
}, z.core.$loose>, readonly [{
|
|
21
|
+
readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.NotFound;
|
|
22
|
+
readonly reason: "not_found";
|
|
23
|
+
readonly retryable: false;
|
|
24
|
+
readonly when: "A requested bill, member, committee, report, vote, or nomination does not exist in Congress.gov.";
|
|
25
|
+
readonly recovery: "Use the tool's list or browse operation to discover valid identifiers, then retry with one that exists.";
|
|
26
|
+
}, {
|
|
27
|
+
readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.RateLimited;
|
|
28
|
+
readonly reason: "rate_limited";
|
|
29
|
+
readonly retryable: true;
|
|
30
|
+
readonly when: "The Congress.gov API rate limit (5,000 requests/hour per key) was exceeded.";
|
|
31
|
+
readonly recovery: "Wait for the hourly rate-limit window to reset before retrying, or reduce the request frequency.";
|
|
32
|
+
}, {
|
|
33
|
+
readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.InvalidParams;
|
|
34
|
+
readonly reason: "invalid_request";
|
|
35
|
+
readonly retryable: false;
|
|
36
|
+
readonly when: "Congress.gov rejected the request as malformed — a bad date range or an identifier with an unexpected shape.";
|
|
37
|
+
readonly recovery: "Check parameter formats: dates must be ISO 8601 like 2026-05-01T00:00:00Z and identifiers must match their documented shape.";
|
|
38
|
+
}, {
|
|
39
|
+
readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.ServiceUnavailable;
|
|
40
|
+
readonly reason: "upstream_error";
|
|
41
|
+
readonly retryable: true;
|
|
42
|
+
readonly when: "Congress.gov returned an unexpected error (5xx or another non-2xx status).";
|
|
43
|
+
readonly recovery: "Retry after a short delay; if the failure persists the Congress.gov service may be temporarily degraded.";
|
|
44
|
+
}], {
|
|
45
|
+
effectiveQuery: z.ZodString;
|
|
46
|
+
totalCount: z.ZodNumber;
|
|
47
|
+
notice: z.ZodOptional<z.ZodString>;
|
|
48
|
+
}>;
|
|
22
49
|
//# sourceMappingURL=crs-reports.tool.d.ts.map
|