@cyanheads/congressgov-mcp-server 0.3.18 → 0.3.20
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 +1 -1
- package/CLAUDE.md +1 -1
- package/README.md +5 -3
- package/dist/mcp-server/tools/definitions/bill-lookup.tool.d.ts +12 -1
- package/dist/mcp-server/tools/definitions/bill-lookup.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/bill-lookup.tool.js +28 -9
- package/dist/mcp-server/tools/definitions/bill-lookup.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/bill-summaries.tool.d.ts +8 -1
- package/dist/mcp-server/tools/definitions/bill-summaries.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/bill-summaries.tool.js +13 -5
- package/dist/mcp-server/tools/definitions/bill-summaries.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/committee-lookup.tool.d.ts +8 -1
- package/dist/mcp-server/tools/definitions/committee-lookup.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/committee-lookup.tool.js +37 -12
- package/dist/mcp-server/tools/definitions/committee-lookup.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/committee-reports.tool.d.ts +8 -1
- package/dist/mcp-server/tools/definitions/committee-reports.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/committee-reports.tool.js +9 -2
- package/dist/mcp-server/tools/definitions/committee-reports.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/crs-reports.tool.d.ts +8 -1
- package/dist/mcp-server/tools/definitions/crs-reports.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/crs-reports.tool.js +3 -2
- package/dist/mcp-server/tools/definitions/crs-reports.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/daily-record.tool.d.ts +8 -1
- package/dist/mcp-server/tools/definitions/daily-record.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/daily-record.tool.js +11 -4
- package/dist/mcp-server/tools/definitions/daily-record.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/enacted-laws.tool.d.ts +8 -1
- package/dist/mcp-server/tools/definitions/enacted-laws.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/enacted-laws.tool.js +10 -3
- package/dist/mcp-server/tools/definitions/enacted-laws.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/member-lookup.tool.d.ts +8 -1
- package/dist/mcp-server/tools/definitions/member-lookup.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/member-lookup.tool.js +15 -3
- package/dist/mcp-server/tools/definitions/member-lookup.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/roll-votes.tool.d.ts +12 -1
- package/dist/mcp-server/tools/definitions/roll-votes.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/roll-votes.tool.js +68 -3
- package/dist/mcp-server/tools/definitions/roll-votes.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/senate-nominations.tool.d.ts +8 -1
- package/dist/mcp-server/tools/definitions/senate-nominations.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/senate-nominations.tool.js +26 -7
- package/dist/mcp-server/tools/definitions/senate-nominations.tool.js.map +1 -1
- package/dist/mcp-server/tools/format-helpers.d.ts +3 -3
- package/dist/mcp-server/tools/format-helpers.d.ts.map +1 -1
- package/dist/mcp-server/tools/format-helpers.js +657 -42
- package/dist/mcp-server/tools/format-helpers.js.map +1 -1
- package/dist/mcp-server/tools/tool-helpers.d.ts +34 -0
- package/dist/mcp-server/tools/tool-helpers.d.ts.map +1 -1
- package/dist/mcp-server/tools/tool-helpers.js +96 -0
- package/dist/mcp-server/tools/tool-helpers.js.map +1 -1
- package/dist/services/congress-api/congress-api-service.d.ts +1 -1
- package/dist/services/congress-api/congress-api-service.d.ts.map +1 -1
- package/dist/services/congress-api/congress-api-service.js +69 -26
- package/dist/services/congress-api/congress-api-service.js.map +1 -1
- package/dist/services/congress-api/types.d.ts +1 -0
- package/dist/services/congress-api/types.d.ts.map +1 -1
- package/package.json +1 -1
- package/server.json +3 -3
package/AGENTS.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# Agent Protocol
|
|
2
2
|
|
|
3
3
|
**Server:** congressgov-mcp-server
|
|
4
|
-
**Version:** 0.3.
|
|
4
|
+
**Version:** 0.3.20
|
|
5
5
|
**Framework:** [@cyanheads/mcp-ts-core](https://www.npmjs.com/package/@cyanheads/mcp-ts-core)
|
|
6
6
|
|
|
7
7
|
> **Read the framework docs first:** `node_modules/@cyanheads/mcp-ts-core/CLAUDE.md` contains the full API reference — builders, Context, error codes, exports, patterns. This file covers server-specific conventions only.
|
package/CLAUDE.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# Agent Protocol
|
|
2
2
|
|
|
3
3
|
**Server:** congressgov-mcp-server
|
|
4
|
-
**Version:** 0.3.
|
|
4
|
+
**Version:** 0.3.20
|
|
5
5
|
**Framework:** [@cyanheads/mcp-ts-core](https://www.npmjs.com/package/@cyanheads/mcp-ts-core)
|
|
6
6
|
|
|
7
7
|
> **Read the framework docs first:** `node_modules/@cyanheads/mcp-ts-core/CLAUDE.md` contains the full API reference — builders, Context, error codes, exports, patterns. This file covers server-specific conventions only.
|
package/README.md
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
|
|
8
8
|
<div align="center">
|
|
9
9
|
|
|
10
|
-
[](https://www.npmjs.com/package/@cyanheads/congressgov-mcp-server) [](https://www.npmjs.com/package/@cyanheads/congressgov-mcp-server) [](./CHANGELOG.md) [](https://www.npmjs.com/package/@cyanheads/mcp-ts-core) [](https://modelcontextprotocol.io/)
|
|
11
11
|
|
|
12
12
|
[](./LICENSE) [](https://www.typescriptlang.org/) [](https://bun.sh/)
|
|
13
13
|
|
|
@@ -42,8 +42,9 @@ Ten read-only tools for querying U.S. legislative data:
|
|
|
42
42
|
|
|
43
43
|
Browse and retrieve U.S. legislative bill data from Congress.gov.
|
|
44
44
|
|
|
45
|
-
- Filter by congress number, bill type, and date range
|
|
45
|
+
- Filter by congress number, bill type, and update-date range
|
|
46
46
|
- Retrieve detailed sub-resources: actions, amendments, committees, cosponsors, related bills, subjects, summaries, text versions, and titles
|
|
47
|
+
- `list` defaults to `order='recent'` (newest update-date first); pass `order='oldest'` for ascending
|
|
47
48
|
- Pagination support for browsing large result sets
|
|
48
49
|
|
|
49
50
|
---
|
|
@@ -64,7 +65,7 @@ Browse congressional committees and their legislation, reports, and nominations.
|
|
|
64
65
|
|
|
65
66
|
- Filter by chamber (House, Senate, Joint)
|
|
66
67
|
- Retrieve committee bills, reports, and nominations
|
|
67
|
-
-
|
|
68
|
+
- Detail and sub-resource lookups need only `committeeCode` — `chamber` is auto-detected from the code
|
|
68
69
|
- Committee bills default to `order='recent'` (newest-first); pass `order='oldest'` for ascending update-date order
|
|
69
70
|
|
|
70
71
|
---
|
|
@@ -75,6 +76,7 @@ Retrieve House roll call vote data and individual member voting positions.
|
|
|
75
76
|
|
|
76
77
|
- Browse roll call votes by congress and session
|
|
77
78
|
- Retrieve individual member voting positions per roll call
|
|
79
|
+
- `list` defaults to `order='recent'` (newest update-date first); pass `order='oldest'` for ascending
|
|
78
80
|
|
|
79
81
|
---
|
|
80
82
|
|
|
@@ -31,7 +31,18 @@ export declare const billLookupTool: import("@cyanheads/mcp-ts-core").ToolDefini
|
|
|
31
31
|
billNumber: z.ZodOptional<z.ZodNumber>;
|
|
32
32
|
fromDateTime: z.ZodOptional<z.ZodString>;
|
|
33
33
|
toDateTime: z.ZodOptional<z.ZodString>;
|
|
34
|
+
order: z.ZodDefault<z.ZodEnum<{
|
|
35
|
+
recent: "recent";
|
|
36
|
+
oldest: "oldest";
|
|
37
|
+
}>>;
|
|
34
38
|
limit: z.ZodDefault<z.ZodNumber>;
|
|
35
39
|
offset: z.ZodDefault<z.ZodNumber>;
|
|
36
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
40
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
41
|
+
data: z.ZodOptional<z.ZodArray<z.ZodObject<{}, z.core.$loose>>>;
|
|
42
|
+
pagination: z.ZodOptional<z.ZodObject<{
|
|
43
|
+
count: z.ZodNumber;
|
|
44
|
+
nextOffset: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
45
|
+
}, z.core.$strip>>;
|
|
46
|
+
query: z.ZodOptional<z.ZodString>;
|
|
47
|
+
}, z.core.$loose>, undefined>;
|
|
37
48
|
//# sourceMappingURL=bill-lookup.tool.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bill-lookup.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/bill-lookup.tool.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"bill-lookup.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/bill-lookup.tool.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;AAiCjD,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;6BA0HzB,CAAC"}
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
import { tool, z } from '@cyanheads/mcp-ts-core';
|
|
6
6
|
import { validationError } from '@cyanheads/mcp-ts-core/errors';
|
|
7
7
|
import { formatBills } from '../../../mcp-server/tools/format-helpers.js';
|
|
8
|
-
import { normalizeOptionalString } from '../../../mcp-server/tools/tool-helpers.js';
|
|
8
|
+
import { buildQueryEcho, listOrDetail, normalizeOptionalString, validateIsoDateTime, } from '../../../mcp-server/tools/tool-helpers.js';
|
|
9
9
|
import { getCongressApi } from '../../../services/congress-api/congress-api-service.js';
|
|
10
10
|
import { BILL_TYPE_CODES } from '../../../services/congress-api/types.js';
|
|
11
11
|
const BillTypeEnum = z.enum(BILL_TYPE_CODES);
|
|
@@ -26,7 +26,7 @@ const SUB_RESOURCE_MAP = {
|
|
|
26
26
|
related: 'relatedbills',
|
|
27
27
|
};
|
|
28
28
|
export const billLookupTool = tool('congressgov_bill_lookup', {
|
|
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), '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).`,
|
|
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
31
|
input: z.object({
|
|
32
32
|
operation: OperationEnum.describe('Which data to retrieve.'),
|
|
@@ -41,28 +41,44 @@ export const billLookupTool = tool('congressgov_bill_lookup', {
|
|
|
41
41
|
fromDateTime: z
|
|
42
42
|
.string()
|
|
43
43
|
.optional()
|
|
44
|
-
.describe(
|
|
45
|
-
toDateTime: z
|
|
44
|
+
.describe("Start of date range filter (ISO 8601). Filters by the bill's update date — when Congress.gov last touched the record — not by the bill's latest legislative action."),
|
|
45
|
+
toDateTime: z
|
|
46
|
+
.string()
|
|
47
|
+
.optional()
|
|
48
|
+
.describe('End of date range filter (ISO 8601). Same field semantics as fromDateTime.'),
|
|
49
|
+
order: z
|
|
50
|
+
.enum(['recent', 'oldest'])
|
|
51
|
+
.default('recent')
|
|
52
|
+
.describe("Sort order for 'list' (sorts by update date). 'recent' (default) is newest first; 'oldest' is ascending. Ignored by other operations."),
|
|
46
53
|
limit: z.number().int().min(1).max(250).default(20).describe('Results per page (1-250).'),
|
|
47
54
|
offset: z.number().int().min(0).default(0).describe('Pagination offset.'),
|
|
48
55
|
}),
|
|
49
|
-
output:
|
|
56
|
+
output: listOrDetail('bill', 'Bill record (sponsor, policy area, latest action, CBO estimates, law citation) for `get`; absent for `list` and sub-resources.'),
|
|
50
57
|
format: formatBills,
|
|
51
58
|
async handler(input, ctx) {
|
|
52
59
|
const api = getCongressApi();
|
|
53
|
-
const fromDateTime = normalizeOptionalString(input.fromDateTime);
|
|
54
|
-
const toDateTime = normalizeOptionalString(input.toDateTime);
|
|
60
|
+
const fromDateTime = validateIsoDateTime(normalizeOptionalString(input.fromDateTime), 'fromDateTime');
|
|
61
|
+
const toDateTime = validateIsoDateTime(normalizeOptionalString(input.toDateTime), 'toDateTime');
|
|
55
62
|
if (input.operation === 'list') {
|
|
56
63
|
const result = await api.listBills({
|
|
57
64
|
congress: input.congress,
|
|
58
65
|
billType: input.billType,
|
|
59
66
|
fromDateTime,
|
|
60
67
|
toDateTime,
|
|
68
|
+
sort: input.order === 'oldest' ? 'updateDate asc' : 'updateDate desc',
|
|
61
69
|
limit: input.limit,
|
|
62
70
|
offset: input.offset,
|
|
63
71
|
}, ctx);
|
|
64
72
|
ctx.log.info('Bills listed', { congress: input.congress, count: result.data.length });
|
|
65
|
-
return
|
|
73
|
+
return {
|
|
74
|
+
...result,
|
|
75
|
+
query: buildQueryEcho('bills', {
|
|
76
|
+
congress: input.congress,
|
|
77
|
+
billType: input.billType,
|
|
78
|
+
fromDateTime,
|
|
79
|
+
toDateTime,
|
|
80
|
+
}),
|
|
81
|
+
};
|
|
66
82
|
}
|
|
67
83
|
if (!input.billType || !input.billNumber) {
|
|
68
84
|
throw validationError(`The '${input.operation}' operation requires congress, billType, and billNumber. Use 'list' first to find the bill, then request its ${input.operation}.`, { operation: input.operation, billType: input.billType, billNumber: input.billNumber });
|
|
@@ -95,7 +111,10 @@ export const billLookupTool = tool('congressgov_bill_lookup', {
|
|
|
95
111
|
billNumber: input.billNumber,
|
|
96
112
|
subResource,
|
|
97
113
|
});
|
|
98
|
-
return
|
|
114
|
+
return {
|
|
115
|
+
...result,
|
|
116
|
+
query: buildQueryEcho(`${input.operation} for ${input.billType.toUpperCase()} ${input.billNumber} in the ${input.congress}th Congress`),
|
|
117
|
+
};
|
|
99
118
|
},
|
|
100
119
|
});
|
|
101
120
|
//# sourceMappingURL=bill-lookup.tool.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bill-lookup.tool.js","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/bill-lookup.tool.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAEhE,OAAO,EAAE,WAAW,EAAE,MAAM,sCAAsC,CAAC;AACnE,OAAO,
|
|
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,cAAc,EACd,YAAY,EACZ,uBAAuB,EACvB,mBAAmB,GACpB,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EAAE,cAAc,EAAE,MAAM,iDAAiD,CAAC;AACjF,OAAO,EAAE,eAAe,EAAwB,MAAM,kCAAkC,CAAC;AAEzF,MAAM,YAAY,GAAG,CAAC,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC;AAE7C,MAAM,aAAa,GAAG,CAAC,CAAC,IAAI,CAAC;IAC3B,MAAM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AC5B,WAAW,EAAE,WAA8B;YAC3C,KAAK,EAAE,KAAK,CAAC,KAAK;YAClB,MAAM,EAAE,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,EAAE,KAAK,CAAC,UAAU;YAC5B,WAAW;SACZ,CAAC,CAAC;QACH,OAAO;YACL,GAAG,MAAM;YACT,KAAK,EAAE,cAAc,CACnB,GAAG,KAAK,CAAC,SAAS,QAAQ,KAAK,CAAC,QAAQ,CAAC,WAAW,EAAE,IAAI,KAAK,CAAC,UAAU,WAAW,KAAK,CAAC,QAAQ,aAAa,CACjH;SACF,CAAC;IACJ,CAAC;CACF,CAAC,CAAC"}
|
|
@@ -19,5 +19,12 @@ export declare const billSummariesTool: import("@cyanheads/mcp-ts-core").ToolDef
|
|
|
19
19
|
toDateTime: z.ZodOptional<z.ZodString>;
|
|
20
20
|
limit: z.ZodDefault<z.ZodNumber>;
|
|
21
21
|
offset: z.ZodDefault<z.ZodNumber>;
|
|
22
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
22
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
23
|
+
data: z.ZodArray<z.ZodObject<{}, z.core.$loose>>;
|
|
24
|
+
pagination: z.ZodObject<{
|
|
25
|
+
count: z.ZodNumber;
|
|
26
|
+
nextOffset: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
27
|
+
}, z.core.$strip>;
|
|
28
|
+
query: z.ZodOptional<z.ZodString>;
|
|
29
|
+
}, z.core.$loose>, undefined>;
|
|
23
30
|
//# sourceMappingURL=bill-summaries.tool.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bill-summaries.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/bill-summaries.tool.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"bill-summaries.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/bill-summaries.tool.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;AAejD,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;6BA2E5B,CAAC"}
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
import { tool, z } from '@cyanheads/mcp-ts-core';
|
|
6
6
|
import { validationError } from '@cyanheads/mcp-ts-core/errors';
|
|
7
7
|
import { formatSummaries } from '../../../mcp-server/tools/format-helpers.js';
|
|
8
|
-
import { normalizeOptionalString } from '../../../mcp-server/tools/tool-helpers.js';
|
|
8
|
+
import { buildQueryEcho, listOutput, normalizeOptionalString, validateIsoDateTime, } from '../../../mcp-server/tools/tool-helpers.js';
|
|
9
9
|
import { getCongressApi } from '../../../services/congress-api/congress-api-service.js';
|
|
10
10
|
import { BILL_TYPE_CODES } from '../../../services/congress-api/types.js';
|
|
11
11
|
const DEFAULT_LOOKBACK_MS = 7 * 24 * 60 * 60 * 1000;
|
|
@@ -31,11 +31,11 @@ export const billSummariesTool = tool('congressgov_bill_summaries', {
|
|
|
31
31
|
limit: z.number().int().min(1).max(250).default(20).describe('Results per page (1-250).'),
|
|
32
32
|
offset: z.number().int().min(0).default(0).describe('Pagination offset.'),
|
|
33
33
|
}),
|
|
34
|
-
output:
|
|
34
|
+
output: listOutput,
|
|
35
35
|
format: formatSummaries,
|
|
36
36
|
async handler(input, ctx) {
|
|
37
|
-
const fromDateTimeInput = normalizeOptionalString(input.fromDateTime);
|
|
38
|
-
const toDateTimeInput = normalizeOptionalString(input.toDateTime);
|
|
37
|
+
const fromDateTimeInput = validateIsoDateTime(normalizeOptionalString(input.fromDateTime), 'fromDateTime');
|
|
38
|
+
const toDateTimeInput = validateIsoDateTime(normalizeOptionalString(input.toDateTime), 'toDateTime');
|
|
39
39
|
if (input.billType && !input.congress) {
|
|
40
40
|
throw validationError("The 'billType' filter requires 'congress'. Provide both or omit billType to browse across all types.", { field: 'congress', billType: input.billType });
|
|
41
41
|
}
|
|
@@ -53,7 +53,15 @@ export const billSummariesTool = tool('congressgov_bill_summaries', {
|
|
|
53
53
|
offset: input.offset,
|
|
54
54
|
}, ctx);
|
|
55
55
|
ctx.log.info('Summaries listed', { count: result.data.length });
|
|
56
|
-
return
|
|
56
|
+
return {
|
|
57
|
+
...result,
|
|
58
|
+
query: buildQueryEcho('bill summaries', {
|
|
59
|
+
congress: input.congress,
|
|
60
|
+
billType: input.billType,
|
|
61
|
+
fromDateTime,
|
|
62
|
+
toDateTime: toDateTimeInput,
|
|
63
|
+
}),
|
|
64
|
+
};
|
|
57
65
|
},
|
|
58
66
|
});
|
|
59
67
|
//# sourceMappingURL=bill-summaries.tool.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bill-summaries.tool.js","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/bill-summaries.tool.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAEhE,OAAO,EAAE,eAAe,EAAE,MAAM,sCAAsC,CAAC;AACvE,OAAO,
|
|
1
|
+
{"version":3,"file":"bill-summaries.tool.js","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/bill-summaries.tool.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAEhE,OAAO,EAAE,eAAe,EAAE,MAAM,sCAAsC,CAA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AAO;YACL,GAAG,MAAM;YACT,KAAK,EAAE,cAAc,CAAC,gBAAgB,EAAE;gBACtC,QAAQ,EAAE,KAAK,CAAC,QAAQ;gBACxB,QAAQ,EAAE,KAAK,CAAC,QAAQ;gBACxB,YAAY;gBACZ,UAAU,EAAE,eAAe;aAC5B,CAAC;SACH,CAAC;IACJ,CAAC;CACF,CAAC,CAAC"}
|
|
@@ -24,5 +24,12 @@ export declare const committeeLookupTool: import("@cyanheads/mcp-ts-core").ToolD
|
|
|
24
24
|
recent: "recent";
|
|
25
25
|
oldest: "oldest";
|
|
26
26
|
}>>;
|
|
27
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
27
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
28
|
+
data: z.ZodOptional<z.ZodArray<z.ZodObject<{}, z.core.$loose>>>;
|
|
29
|
+
pagination: z.ZodOptional<z.ZodObject<{
|
|
30
|
+
count: z.ZodNumber;
|
|
31
|
+
nextOffset: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
32
|
+
}, z.core.$strip>>;
|
|
33
|
+
query: z.ZodOptional<z.ZodString>;
|
|
34
|
+
}, z.core.$loose>, undefined>;
|
|
28
35
|
//# sourceMappingURL=committee-lookup.tool.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"committee-lookup.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/committee-lookup.tool.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"committee-lookup.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/committee-lookup.tool.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;AAiBjD,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;6BAmH9B,CAAC"}
|
|
@@ -5,9 +5,21 @@
|
|
|
5
5
|
import { tool, z } from '@cyanheads/mcp-ts-core';
|
|
6
6
|
import { validationError } from '@cyanheads/mcp-ts-core/errors';
|
|
7
7
|
import { formatCommittees } from '../../../mcp-server/tools/format-helpers.js';
|
|
8
|
+
import { buildQueryEcho, listOrDetail } from '../../../mcp-server/tools/tool-helpers.js';
|
|
8
9
|
import { getCongressApi } from '../../../services/congress-api/congress-api-service.js';
|
|
10
|
+
/** Committee codes carry chamber in the first letter (h=House, s=Senate, j=Joint). */
|
|
11
|
+
function inferChamberFromCode(code) {
|
|
12
|
+
const first = code[0]?.toLowerCase();
|
|
13
|
+
if (first === 's')
|
|
14
|
+
return 'senate';
|
|
15
|
+
if (first === 'j')
|
|
16
|
+
return 'joint';
|
|
17
|
+
if (first === 'h')
|
|
18
|
+
return 'house';
|
|
19
|
+
return;
|
|
20
|
+
}
|
|
9
21
|
export const committeeLookupTool = tool('congressgov_committee_lookup', {
|
|
10
|
-
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). The 'bills' sub-resource defaults to 'recent' order (newest update-date first); pass order='oldest' for ascending update-date order.`,
|
|
22
|
+
description: `Browse congressional committees and their legislation, reports, and nominations. Committee codes follow the pattern chamber-prefix (h/s/j) + abbreviation + number — use 'list' to discover codes, then 'get' or drill into 'bills', 'reports', or 'nominations' ('nominations' is Senate-only). 'get' and sub-resources only need committeeCode (chamber is inferred from the prefix); pass chamber explicitly to override. The 'bills' sub-resource defaults to 'recent' order (newest update-date first); pass order='oldest' for ascending update-date order. Upstream omits bill titles from the 'bills' sub-resource — rows carry only {congress, billType, billNumber, actionDate, relationshipType, url}; chain 'congressgov_bill_lookup get' per row to retrieve titles and policy area.`,
|
|
11
23
|
annotations: { readOnlyHint: true, idempotentHint: true, openWorldHint: true },
|
|
12
24
|
input: z.object({
|
|
13
25
|
operation: z
|
|
@@ -17,7 +29,7 @@ export const committeeLookupTool = tool('congressgov_committee_lookup', {
|
|
|
17
29
|
chamber: z
|
|
18
30
|
.enum(['house', 'senate', 'joint'])
|
|
19
31
|
.optional()
|
|
20
|
-
.describe("Chamber filter
|
|
32
|
+
.describe("Chamber filter for 'list', or override for 'get' and sub-resources (otherwise inferred from committeeCode prefix)."),
|
|
21
33
|
committeeCode: z
|
|
22
34
|
.string()
|
|
23
35
|
.optional()
|
|
@@ -29,7 +41,7 @@ export const committeeLookupTool = tool('congressgov_committee_lookup', {
|
|
|
29
41
|
.default('recent')
|
|
30
42
|
.describe("Sort order for the 'bills' sub-resource. 'recent' (default) returns newest update-date first; 'oldest' returns ascending update-date order. Ignored by other operations."),
|
|
31
43
|
}),
|
|
32
|
-
output:
|
|
44
|
+
output: listOrDetail('committee', 'Committee record for `get` (name, chamber, subcommittees, history, sub-resource counts); absent for `list` and sub-resources.'),
|
|
33
45
|
format: formatCommittees,
|
|
34
46
|
async handler(input, ctx) {
|
|
35
47
|
const api = getCongressApi();
|
|
@@ -41,29 +53,39 @@ export const committeeLookupTool = tool('congressgov_committee_lookup', {
|
|
|
41
53
|
offset: input.offset,
|
|
42
54
|
}, ctx);
|
|
43
55
|
ctx.log.info('Committees listed', { count: result.data.length });
|
|
44
|
-
return
|
|
56
|
+
return {
|
|
57
|
+
...result,
|
|
58
|
+
query: buildQueryEcho('committees', {
|
|
59
|
+
congress: input.congress,
|
|
60
|
+
chamber: input.chamber,
|
|
61
|
+
}),
|
|
62
|
+
};
|
|
45
63
|
}
|
|
46
|
-
if (!input.
|
|
47
|
-
throw validationError(`The '${input.operation}' operation requires
|
|
64
|
+
if (!input.committeeCode) {
|
|
65
|
+
throw validationError(`The '${input.operation}' operation requires committeeCode. Use 'list' to discover available committees.`, { operation: input.operation, committeeCode: input.committeeCode });
|
|
66
|
+
}
|
|
67
|
+
const chamber = input.chamber ?? inferChamberFromCode(input.committeeCode);
|
|
68
|
+
if (!chamber) {
|
|
69
|
+
throw validationError(`Could not infer chamber from committeeCode '${input.committeeCode}'. Pass chamber explicitly ('house', 'senate', or 'joint').`, { field: 'committeeCode', committeeCode: input.committeeCode });
|
|
48
70
|
}
|
|
49
71
|
if (input.operation === 'get') {
|
|
50
|
-
const result = await api.getCommittee(
|
|
72
|
+
const result = await api.getCommittee(chamber, input.committeeCode, ctx);
|
|
51
73
|
ctx.log.info('Committee retrieved', { committeeCode: input.committeeCode });
|
|
52
74
|
return result;
|
|
53
75
|
}
|
|
54
|
-
if (input.operation === 'nominations' &&
|
|
55
|
-
throw validationError("Nominations are only referred to Senate committees. Use chamber='senate' or a Senate committee code (s-prefix).", { field: 'chamber', chamber
|
|
76
|
+
if (input.operation === 'nominations' && chamber !== 'senate') {
|
|
77
|
+
throw validationError("Nominations are only referred to Senate committees. Use chamber='senate' or a Senate committee code (s-prefix).", { field: 'chamber', chamber });
|
|
56
78
|
}
|
|
57
79
|
if (input.operation === 'bills' && input.order === 'recent') {
|
|
58
80
|
return fetchCommitteeBillsRecent({
|
|
59
|
-
chamber
|
|
81
|
+
chamber,
|
|
60
82
|
committeeCode: input.committeeCode,
|
|
61
83
|
limit: input.limit,
|
|
62
84
|
offset: input.offset,
|
|
63
85
|
}, ctx);
|
|
64
86
|
}
|
|
65
87
|
const result = await api.getCommitteeSubResource({
|
|
66
|
-
chamber
|
|
88
|
+
chamber,
|
|
67
89
|
committeeCode: input.committeeCode,
|
|
68
90
|
subResource: input.operation,
|
|
69
91
|
limit: input.limit,
|
|
@@ -73,7 +95,10 @@ export const committeeLookupTool = tool('congressgov_committee_lookup', {
|
|
|
73
95
|
committeeCode: input.committeeCode,
|
|
74
96
|
subResource: input.operation,
|
|
75
97
|
});
|
|
76
|
-
return
|
|
98
|
+
return {
|
|
99
|
+
...result,
|
|
100
|
+
query: buildQueryEcho(`${input.operation} for committee ${input.committeeCode}`),
|
|
101
|
+
};
|
|
77
102
|
},
|
|
78
103
|
});
|
|
79
104
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"committee-lookup.tool.js","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/committee-lookup.tool.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAEhE,OAAO,EAAE,gBAAgB,EAAE,MAAM,sCAAsC,CAAC;AACxE,OAAO,EAAE,cAAc,EAAE,MAAM,iDAAiD,CAAC;AAGjF,MAAM,CAAC,MAAM,mBAAmB,GAAG,IAAI,CAAC,8BAA8B,EAAE;IACtE,WAAW,EAAE,
|
|
1
|
+
{"version":3,"file":"committee-lookup.tool.js","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/committee-lookup.tool.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAEhE,OAAO,EAAE,gBAAgB,EAAE,MAAM,sCAAsC,CAAC;AACxE,OAAO,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,oCAAoC,CAAC;AAClF,OAAO,EAAE,cAAc,EAAE,MAAM,iDAAiD,CAAC;AAGjF,sFAAsF;AACtF,SAAS,oBAAoB,CAAC,IAAY;IACxC,MAAM,KAAK,GAAG,IAAI,CAAC,CAAC,CAAC,EAAE,WAAW,EAAE,CAAC;IACrC,IAAI,KAAK,KAAK,GAAG;QAAE,OAAO,QAAQ,CAAC;IACnC,IAAI,KAAK,KAAK,GAAG;QAAE,OAAO,OAAO,CAAC;IAClC,IAAI,KAAK,KAAK,GAAG;QAAE,OAAO,OAAO,CAAC;IAClC,OAAO;AACT,CAAC;AAED,MAAM,CAAC,MAAM,mBAAmB,GAAG,IAAI,CAAC,8BAA8B,EAAE;IACtE,WAAW,EAA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C,MAAM,UAAU,GAAG,MAAM,CAAC,MAAM,GAAG,cAAc,GAAG,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,GAAG,cAAc,CAAC,CAAC,CAAC,IAAI,CAAC;IAElG,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,0CAA0C,EAAE;QACvD,aAAa,EAAE,MAAM,CAAC,aAAa;QACnC,KAAK;QACL,QAAQ,EAAE,QAAQ,CAAC,MAAM;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"}
|
|
@@ -18,5 +18,12 @@ export declare const committeeReportsTool: import("@cyanheads/mcp-ts-core").Tool
|
|
|
18
18
|
reportNumber: z.ZodOptional<z.ZodNumber>;
|
|
19
19
|
limit: z.ZodDefault<z.ZodNumber>;
|
|
20
20
|
offset: z.ZodDefault<z.ZodNumber>;
|
|
21
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
21
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
22
|
+
data: z.ZodOptional<z.ZodArray<z.ZodObject<{}, z.core.$loose>>>;
|
|
23
|
+
pagination: z.ZodOptional<z.ZodObject<{
|
|
24
|
+
count: z.ZodNumber;
|
|
25
|
+
nextOffset: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
26
|
+
}, z.core.$strip>>;
|
|
27
|
+
query: z.ZodOptional<z.ZodString>;
|
|
28
|
+
}, z.core.$loose>, undefined>;
|
|
22
29
|
//# sourceMappingURL=committee-reports.tool.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"committee-reports.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/committee-reports.tool.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"committee-reports.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/committee-reports.tool.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;AAOjD,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;6BA8F/B,CAAC"}
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
import { tool, z } from '@cyanheads/mcp-ts-core';
|
|
6
6
|
import { validationError } from '@cyanheads/mcp-ts-core/errors';
|
|
7
7
|
import { formatCommitteeReports } from '../../../mcp-server/tools/format-helpers.js';
|
|
8
|
+
import { buildQueryEcho, listOrDetail } from '../../../mcp-server/tools/tool-helpers.js';
|
|
8
9
|
import { getCongressApi } from '../../../services/congress-api/congress-api-service.js';
|
|
9
10
|
export const committeeReportsTool = tool('congressgov_committee_reports', {
|
|
10
11
|
description: `Browse and retrieve committee reports from Congress.gov — reports accompany legislation reported out of committee and explain the bill's purpose, committee amendments, dissenting views, and the committee vote. Report types are 'hrpt' (House), 'srpt' (Senate), and 'erpt' (Executive).`,
|
|
@@ -25,7 +26,7 @@ export const committeeReportsTool = tool('congressgov_committee_reports', {
|
|
|
25
26
|
limit: z.number().int().min(1).max(250).default(20).describe('Results per page (1-250).'),
|
|
26
27
|
offset: z.number().int().min(0).default(0).describe('Pagination offset.'),
|
|
27
28
|
}),
|
|
28
|
-
output:
|
|
29
|
+
output: listOrDetail('report', "the committee report (citation, title, committees, associated bill); for `text`, an alternative key 'text' carries an array of {type, url} format links."),
|
|
29
30
|
format: formatCommitteeReports,
|
|
30
31
|
async handler(input, ctx) {
|
|
31
32
|
const api = getCongressApi();
|
|
@@ -40,7 +41,13 @@ export const committeeReportsTool = tool('congressgov_committee_reports', {
|
|
|
40
41
|
congress: input.congress,
|
|
41
42
|
count: result.data.length,
|
|
42
43
|
});
|
|
43
|
-
return
|
|
44
|
+
return {
|
|
45
|
+
...result,
|
|
46
|
+
query: buildQueryEcho('committee reports', {
|
|
47
|
+
congress: input.congress,
|
|
48
|
+
reportType: input.reportType,
|
|
49
|
+
}),
|
|
50
|
+
};
|
|
44
51
|
}
|
|
45
52
|
if (!input.reportType || !input.reportNumber) {
|
|
46
53
|
throw validationError(`The '${input.operation}' operation requires reportType and reportNumber. Use 'list' to browse available reports.`, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"committee-reports.tool.js","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/committee-reports.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,EAAE,cAAc,EAAE,MAAM,iDAAiD,CAAC;AAEjF,MAAM,CAAC,MAAM,oBAAoB,GAAG,IAAI,CAAC,+BAA+B,EAAE;IACxE,WAAW,EAAE,6RAA6R;IAC1S,WAAW,EAAE,EAAE,YAAY,EAAE,IAAI,EAAE,cAAc,EAAE,IAAI,EAAE,aAAa,EAAE,IAAI,EAAE;IAC9E,KAAK,EAAE,CAAC,CAAC,MAAM,CAAC;QACd,SAAS,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,KAAK,EAAE,MAAM,CAAC,CAAC,CAAC,QAAQ,CAAC,yBAAyB,CAAC;QAC9E,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,kBAAkB,CAAC;QAClE,UAAU,EAAE,CAAC;aACV,IAAI,CAAC,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;aAC9B,QAAQ,EAAE;aACV,QAAQ,CAAC,oDAAoD,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K,CAAC,UAAU;YAC5B,YAAY,EAAE,KAAK,CAAC,YAAY;SACjC,EACD,GAAG,CACJ,CAAC;QACF,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,4BAA4B,EAAE;YACzC,QAAQ,EAAE,KAAK,CAAC,QAAQ;YACxB,UAAU,EAAE,KAAK,CAAC,UAAU;YAC5B,YAAY,EAAE,KAAK,CAAC,YAAY;SACjC,CAAC,CAAC;QACH,OAAO,MAAM,CAAC;IAChB,CAAC;CACF,CAAC,CAAC"}
|
|
@@ -11,5 +11,12 @@ export declare const crsReportsTool: import("@cyanheads/mcp-ts-core").ToolDefini
|
|
|
11
11
|
reportNumber: z.ZodOptional<z.ZodString>;
|
|
12
12
|
limit: z.ZodDefault<z.ZodNumber>;
|
|
13
13
|
offset: z.ZodDefault<z.ZodNumber>;
|
|
14
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
14
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
15
|
+
data: z.ZodOptional<z.ZodArray<z.ZodObject<{}, z.core.$loose>>>;
|
|
16
|
+
pagination: z.ZodOptional<z.ZodObject<{
|
|
17
|
+
count: z.ZodNumber;
|
|
18
|
+
nextOffset: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
19
|
+
}, z.core.$strip>>;
|
|
20
|
+
query: z.ZodOptional<z.ZodString>;
|
|
21
|
+
}, z.core.$loose>, undefined>;
|
|
15
22
|
//# sourceMappingURL=crs-reports.tool.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"crs-reports.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/crs-reports.tool.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"crs-reports.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/crs-reports.tool.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;AAOjD,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;6BAsCzB,CAAC"}
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
import { tool, z } from '@cyanheads/mcp-ts-core';
|
|
6
6
|
import { validationError } from '@cyanheads/mcp-ts-core/errors';
|
|
7
7
|
import { formatCrsReports } from '../../../mcp-server/tools/format-helpers.js';
|
|
8
|
+
import { buildQueryEcho, listOrDetail } from '../../../mcp-server/tools/tool-helpers.js';
|
|
8
9
|
import { getCongressApi } from '../../../services/congress-api/congress-api-service.js';
|
|
9
10
|
export const crsReportsTool = tool('congressgov_crs_reports', {
|
|
10
11
|
description: `Browse and retrieve CRS (Congressional Research Service) reports — nonpartisan policy analyses by subject-matter experts at the Library of Congress, covering policy areas, legislative proposals, and legal questions. Report IDs use letter-number codes (e.g., R40097, RL33612, IF12345). Use 'list' to browse available reports or 'get' for full detail (authors, topics, summary, download formats).`,
|
|
@@ -18,14 +19,14 @@ export const crsReportsTool = tool('congressgov_crs_reports', {
|
|
|
18
19
|
limit: z.number().int().min(1).max(250).default(20).describe('Results per page (1-250).'),
|
|
19
20
|
offset: z.number().int().min(0).default(0).describe('Pagination offset.'),
|
|
20
21
|
}),
|
|
21
|
-
output:
|
|
22
|
+
output: listOrDetail('report', 'CRS report record for `get` (authors, topics, summary, formats, related materials); absent for `list`.'),
|
|
22
23
|
format: formatCrsReports,
|
|
23
24
|
async handler(input, ctx) {
|
|
24
25
|
const api = getCongressApi();
|
|
25
26
|
if (input.operation === 'list') {
|
|
26
27
|
const result = await api.listCrsReports({ limit: input.limit, offset: input.offset }, ctx);
|
|
27
28
|
ctx.log.info('CRS reports listed', { count: result.data.length });
|
|
28
|
-
return result;
|
|
29
|
+
return { ...result, query: buildQueryEcho('CRS reports') };
|
|
29
30
|
}
|
|
30
31
|
if (!input.reportNumber) {
|
|
31
32
|
throw validationError("The 'get' operation requires reportNumber. Report IDs use letter-number codes (e.g., R40097). Use 'list' to browse available reports.", { field: 'reportNumber' });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"crs-reports.tool.js","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/crs-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,gBAAgB,EAAE,MAAM,sCAAsC,CAAC;AACxE,OAAO,EAAE,cAAc,EAAE,MAAM,iDAAiD,CAAC;AAEjF,MAAM,CAAC,MAAM,cAAc,GAAG,IAAI,CAAC,yBAAyB,EAAE;IAC5D,WAAW,EAAE,4YAA4Y;IACzZ,WAAW,EAAE,EAAE,YAAY,EAAE,IAAI,EAAE,cAAc,EAAE,IAAI,EAAE,aAAa,EAAE,IAAI,EAAE;IAC9E,KAAK,EAAE,CAAC,CAAC,MAAM,CAAC;QACd,SAAS,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC,CAAC,QAAQ,CAAC,yBAAyB,CAAC;QACtE,YAAY,EAAE,CAAC;aACZ,MAAM,EAAE;aACR,QAAQ,EAAE;aACV,QAAQ,CAAC,qDAAqD,CAAC;QAClE,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC,QAAQ,CAAC,2BAA2B,CAAC;QACzF,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,oBAAoB,CAAC;KAC1E,CAAC;IACF,MAAM,EAAE,
|
|
1
|
+
{"version":3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AM,EAAE,gBAAgB;IAExB,KAAK,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG;QACtB,MAAM,GAAG,GAAG,cAAc,EAAE,CAAC;QAE7B,IAAI,KAAK,CAAC,SAAS,KAAK,MAAM,EAAE,CAAC;YAC/B,MAAM,MAAM,GAAG,MAAM,GAAG,CAAC,cAAc,CAAC,EAAE,KAAK,EAAE,KAAK,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,CAAC,MAAM,EAAE,EAAE,GAAG,CAAC,CAAC;YAC3F,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,oBAAoB,EAAE,EAAE,KAAK,EAAE,MAAM,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC,CAAC;YAClE,OAAO,EAAE,GAAG,MAAM,EAAE,KAAK,EAAE,cAAc,CAAC,aAAa,CAAC,EAAE,CAAC;QAC7D,CAAC;QAED,IAAI,CAAC,KAAK,CAAC,YAAY,EAAE,CAAC;YACxB,MAAM,eAAe,CACnB,uIAAuI,EACvI,EAAE,KAAK,EAAE,cAAc,EAAE,CAC1B,CAAC;QACJ,CAAC;QAED,MAAM,MAAM,GAAG,MAAM,GAAG,CAAC,YAAY,CAAC,EAAE,YAAY,EAAE,KAAK,CAAC,YAAY,EAAE,EAAE,GAAG,CAAC,CAAC;QACjF,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,sBAAsB,EAAE,EAAE,YAAY,EAAE,KAAK,CAAC,YAAY,EAAE,CAAC,CAAC;QAC3E,OAAO,MAAM,CAAC;IAChB,CAAC;CACF,CAAC,CAAC"}
|
|
@@ -13,5 +13,12 @@ export declare const dailyRecordTool: import("@cyanheads/mcp-ts-core").ToolDefin
|
|
|
13
13
|
issueNumber: z.ZodOptional<z.ZodNumber>;
|
|
14
14
|
limit: z.ZodDefault<z.ZodNumber>;
|
|
15
15
|
offset: z.ZodDefault<z.ZodNumber>;
|
|
16
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
16
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
17
|
+
data: z.ZodArray<z.ZodObject<{}, z.core.$loose>>;
|
|
18
|
+
pagination: z.ZodObject<{
|
|
19
|
+
count: z.ZodNumber;
|
|
20
|
+
nextOffset: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
21
|
+
}, z.core.$strip>;
|
|
22
|
+
query: z.ZodOptional<z.ZodString>;
|
|
23
|
+
}, z.core.$loose>, undefined>;
|
|
17
24
|
//# sourceMappingURL=daily-record.tool.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"daily-record.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/daily-record.tool.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"daily-record.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/daily-record.tool.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;AAOjD,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;6BAkF1B,CAAC"}
|