@cyanheads/congressgov-mcp-server 0.3.19 → 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 +1 -1
- package/dist/mcp-server/tools/definitions/bill-lookup.tool.d.ts +8 -1
- package/dist/mcp-server/tools/definitions/bill-lookup.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/bill-lookup.tool.js +17 -6
- package/dist/mcp-server/tools/definitions/bill-lookup.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/bill-summaries.tool.d.ts +8 -1
- package/dist/mcp-server/tools/definitions/bill-summaries.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/bill-summaries.tool.js +13 -5
- package/dist/mcp-server/tools/definitions/bill-summaries.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/committee-lookup.tool.d.ts +8 -1
- package/dist/mcp-server/tools/definitions/committee-lookup.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/committee-lookup.tool.js +14 -4
- package/dist/mcp-server/tools/definitions/committee-lookup.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/committee-reports.tool.d.ts +8 -1
- package/dist/mcp-server/tools/definitions/committee-reports.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/committee-reports.tool.js +9 -2
- package/dist/mcp-server/tools/definitions/committee-reports.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/crs-reports.tool.d.ts +8 -1
- package/dist/mcp-server/tools/definitions/crs-reports.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/crs-reports.tool.js +3 -2
- package/dist/mcp-server/tools/definitions/crs-reports.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/daily-record.tool.d.ts +8 -1
- package/dist/mcp-server/tools/definitions/daily-record.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/daily-record.tool.js +11 -4
- package/dist/mcp-server/tools/definitions/daily-record.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/enacted-laws.tool.d.ts +8 -1
- package/dist/mcp-server/tools/definitions/enacted-laws.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/enacted-laws.tool.js +10 -3
- package/dist/mcp-server/tools/definitions/enacted-laws.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/member-lookup.tool.d.ts +8 -1
- package/dist/mcp-server/tools/definitions/member-lookup.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/member-lookup.tool.js +15 -3
- package/dist/mcp-server/tools/definitions/member-lookup.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/roll-votes.tool.d.ts +8 -1
- package/dist/mcp-server/tools/definitions/roll-votes.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/roll-votes.tool.js +43 -22
- package/dist/mcp-server/tools/definitions/roll-votes.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/senate-nominations.tool.d.ts +8 -1
- package/dist/mcp-server/tools/definitions/senate-nominations.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/senate-nominations.tool.js +7 -3
- package/dist/mcp-server/tools/definitions/senate-nominations.tool.js.map +1 -1
- package/dist/mcp-server/tools/format-helpers.d.ts +1 -1
- package/dist/mcp-server/tools/format-helpers.d.ts.map +1 -1
- package/dist/mcp-server/tools/format-helpers.js +228 -23
- package/dist/mcp-server/tools/format-helpers.js.map +1 -1
- package/dist/mcp-server/tools/tool-helpers.d.ts +34 -0
- package/dist/mcp-server/tools/tool-helpers.d.ts.map +1 -1
- package/dist/mcp-server/tools/tool-helpers.js +96 -0
- package/dist/mcp-server/tools/tool-helpers.js.map +1 -1
- package/dist/services/congress-api/congress-api-service.d.ts +1 -1
- package/dist/services/congress-api/congress-api-service.d.ts.map +1 -1
- package/dist/services/congress-api/congress-api-service.js +8 -16
- package/dist/services/congress-api/congress-api-service.js.map +1 -1
- package/package.json +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
|
|
|
@@ -37,5 +37,12 @@ export declare const billLookupTool: import("@cyanheads/mcp-ts-core").ToolDefini
|
|
|
37
37
|
}>>;
|
|
38
38
|
limit: z.ZodDefault<z.ZodNumber>;
|
|
39
39
|
offset: z.ZodDefault<z.ZodNumber>;
|
|
40
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
40
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
41
|
+
data: z.ZodOptional<z.ZodArray<z.ZodObject<{}, z.core.$loose>>>;
|
|
42
|
+
pagination: z.ZodOptional<z.ZodObject<{
|
|
43
|
+
count: z.ZodNumber;
|
|
44
|
+
nextOffset: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
45
|
+
}, z.core.$strip>>;
|
|
46
|
+
query: z.ZodOptional<z.ZodString>;
|
|
47
|
+
}, z.core.$loose>, undefined>;
|
|
41
48
|
//# sourceMappingURL=bill-lookup.tool.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bill-lookup.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/bill-lookup.tool.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"bill-lookup.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/bill-lookup.tool.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;AAiCjD,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;6BA0HzB,CAAC"}
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
import { tool, z } from '@cyanheads/mcp-ts-core';
|
|
6
6
|
import { validationError } from '@cyanheads/mcp-ts-core/errors';
|
|
7
7
|
import { formatBills } from '../../../mcp-server/tools/format-helpers.js';
|
|
8
|
-
import { normalizeOptionalString } from '../../../mcp-server/tools/tool-helpers.js';
|
|
8
|
+
import { buildQueryEcho, listOrDetail, normalizeOptionalString, validateIsoDateTime, } from '../../../mcp-server/tools/tool-helpers.js';
|
|
9
9
|
import { getCongressApi } from '../../../services/congress-api/congress-api-service.js';
|
|
10
10
|
import { BILL_TYPE_CODES } from '../../../services/congress-api/types.js';
|
|
11
11
|
const BillTypeEnum = z.enum(BILL_TYPE_CODES);
|
|
@@ -53,12 +53,12 @@ export const billLookupTool = tool('congressgov_bill_lookup', {
|
|
|
53
53
|
limit: z.number().int().min(1).max(250).default(20).describe('Results per page (1-250).'),
|
|
54
54
|
offset: z.number().int().min(0).default(0).describe('Pagination offset.'),
|
|
55
55
|
}),
|
|
56
|
-
output:
|
|
56
|
+
output: listOrDetail('bill', 'Bill record (sponsor, policy area, latest action, CBO estimates, law citation) for `get`; absent for `list` and sub-resources.'),
|
|
57
57
|
format: formatBills,
|
|
58
58
|
async handler(input, ctx) {
|
|
59
59
|
const api = getCongressApi();
|
|
60
|
-
const fromDateTime = normalizeOptionalString(input.fromDateTime);
|
|
61
|
-
const toDateTime = normalizeOptionalString(input.toDateTime);
|
|
60
|
+
const fromDateTime = validateIsoDateTime(normalizeOptionalString(input.fromDateTime), 'fromDateTime');
|
|
61
|
+
const toDateTime = validateIsoDateTime(normalizeOptionalString(input.toDateTime), 'toDateTime');
|
|
62
62
|
if (input.operation === 'list') {
|
|
63
63
|
const result = await api.listBills({
|
|
64
64
|
congress: input.congress,
|
|
@@ -70,7 +70,15 @@ export const billLookupTool = tool('congressgov_bill_lookup', {
|
|
|
70
70
|
offset: input.offset,
|
|
71
71
|
}, ctx);
|
|
72
72
|
ctx.log.info('Bills listed', { congress: input.congress, count: result.data.length });
|
|
73
|
-
return
|
|
73
|
+
return {
|
|
74
|
+
...result,
|
|
75
|
+
query: buildQueryEcho('bills', {
|
|
76
|
+
congress: input.congress,
|
|
77
|
+
billType: input.billType,
|
|
78
|
+
fromDateTime,
|
|
79
|
+
toDateTime,
|
|
80
|
+
}),
|
|
81
|
+
};
|
|
74
82
|
}
|
|
75
83
|
if (!input.billType || !input.billNumber) {
|
|
76
84
|
throw validationError(`The '${input.operation}' operation requires congress, billType, and billNumber. Use 'list' first to find the bill, then request its ${input.operation}.`, { operation: input.operation, billType: input.billType, billNumber: input.billNumber });
|
|
@@ -103,7 +111,10 @@ export const billLookupTool = tool('congressgov_bill_lookup', {
|
|
|
103
111
|
billNumber: input.billNumber,
|
|
104
112
|
subResource,
|
|
105
113
|
});
|
|
106
|
-
return
|
|
114
|
+
return {
|
|
115
|
+
...result,
|
|
116
|
+
query: buildQueryEcho(`${input.operation} for ${input.billType.toUpperCase()} ${input.billNumber} in the ${input.congress}th Congress`),
|
|
117
|
+
};
|
|
107
118
|
},
|
|
108
119
|
});
|
|
109
120
|
//# sourceMappingURL=bill-lookup.tool.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bill-lookup.tool.js","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/bill-lookup.tool.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,IAAI,EAAE,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,MA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,CAAC,QAAQ;YACxB,UAAU,EAAE,KAAK,CAAC,UAAU;YAC5B,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,CAA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M,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC,CAAC;QAChE,OAAO;YACL,GAAG,MAAM;YACT,KAAK,EAAE,cAAc,CAAC,gBAAgB,EAAE;gBACtC,QAAQ,EAAE,KAAK,CAAC,QAAQ;gBACxB,QAAQ,EAAE,KAAK,CAAC,QAAQ;gBACxB,YAAY;gBACZ,UAAU,EAAE,eAAe;aAC5B,CAAC;SACH,CAAC;IACJ,CAAC;CACF,CAAC,CAAC"}
|
|
@@ -24,5 +24,12 @@ export declare const committeeLookupTool: import("@cyanheads/mcp-ts-core").ToolD
|
|
|
24
24
|
recent: "recent";
|
|
25
25
|
oldest: "oldest";
|
|
26
26
|
}>>;
|
|
27
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
27
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
28
|
+
data: z.ZodOptional<z.ZodArray<z.ZodObject<{}, z.core.$loose>>>;
|
|
29
|
+
pagination: z.ZodOptional<z.ZodObject<{
|
|
30
|
+
count: z.ZodNumber;
|
|
31
|
+
nextOffset: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
32
|
+
}, z.core.$strip>>;
|
|
33
|
+
query: z.ZodOptional<z.ZodString>;
|
|
34
|
+
}, z.core.$loose>, undefined>;
|
|
28
35
|
//# sourceMappingURL=committee-lookup.tool.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"committee-lookup.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/committee-lookup.tool.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"committee-lookup.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/committee-lookup.tool.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;AAiBjD,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;6BAmH9B,CAAC"}
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
import { tool, z } from '@cyanheads/mcp-ts-core';
|
|
6
6
|
import { validationError } from '@cyanheads/mcp-ts-core/errors';
|
|
7
7
|
import { formatCommittees } from '../../../mcp-server/tools/format-helpers.js';
|
|
8
|
+
import { buildQueryEcho, listOrDetail } from '../../../mcp-server/tools/tool-helpers.js';
|
|
8
9
|
import { getCongressApi } from '../../../services/congress-api/congress-api-service.js';
|
|
9
10
|
/** Committee codes carry chamber in the first letter (h=House, s=Senate, j=Joint). */
|
|
10
11
|
function inferChamberFromCode(code) {
|
|
@@ -18,7 +19,7 @@ function inferChamberFromCode(code) {
|
|
|
18
19
|
return;
|
|
19
20
|
}
|
|
20
21
|
export const committeeLookupTool = tool('congressgov_committee_lookup', {
|
|
21
|
-
description: `Browse congressional committees and their legislation, reports, and nominations. Committee codes follow the pattern chamber-prefix (h/s/j) + abbreviation + number — use 'list' to discover codes, then 'get' or drill into 'bills', 'reports', or 'nominations' ('nominations' is Senate-only). 'get' and sub-resources only need committeeCode (chamber is inferred from the prefix); pass chamber explicitly to override. The 'bills' sub-resource defaults to 'recent' order (newest update-date first); pass order='oldest' for ascending update-date order.`,
|
|
22
|
+
description: `Browse congressional committees and their legislation, reports, and nominations. Committee codes follow the pattern chamber-prefix (h/s/j) + abbreviation + number — use 'list' to discover codes, then 'get' or drill into 'bills', 'reports', or 'nominations' ('nominations' is Senate-only). 'get' and sub-resources only need committeeCode (chamber is inferred from the prefix); pass chamber explicitly to override. The 'bills' sub-resource defaults to 'recent' order (newest update-date first); pass order='oldest' for ascending update-date order. Upstream omits bill titles from the 'bills' sub-resource — rows carry only {congress, billType, billNumber, actionDate, relationshipType, url}; chain 'congressgov_bill_lookup get' per row to retrieve titles and policy area.`,
|
|
22
23
|
annotations: { readOnlyHint: true, idempotentHint: true, openWorldHint: true },
|
|
23
24
|
input: z.object({
|
|
24
25
|
operation: z
|
|
@@ -40,7 +41,7 @@ export const committeeLookupTool = tool('congressgov_committee_lookup', {
|
|
|
40
41
|
.default('recent')
|
|
41
42
|
.describe("Sort order for the 'bills' sub-resource. 'recent' (default) returns newest update-date first; 'oldest' returns ascending update-date order. Ignored by other operations."),
|
|
42
43
|
}),
|
|
43
|
-
output:
|
|
44
|
+
output: listOrDetail('committee', 'Committee record for `get` (name, chamber, subcommittees, history, sub-resource counts); absent for `list` and sub-resources.'),
|
|
44
45
|
format: formatCommittees,
|
|
45
46
|
async handler(input, ctx) {
|
|
46
47
|
const api = getCongressApi();
|
|
@@ -52,7 +53,13 @@ export const committeeLookupTool = tool('congressgov_committee_lookup', {
|
|
|
52
53
|
offset: input.offset,
|
|
53
54
|
}, ctx);
|
|
54
55
|
ctx.log.info('Committees listed', { count: result.data.length });
|
|
55
|
-
return
|
|
56
|
+
return {
|
|
57
|
+
...result,
|
|
58
|
+
query: buildQueryEcho('committees', {
|
|
59
|
+
congress: input.congress,
|
|
60
|
+
chamber: input.chamber,
|
|
61
|
+
}),
|
|
62
|
+
};
|
|
56
63
|
}
|
|
57
64
|
if (!input.committeeCode) {
|
|
58
65
|
throw validationError(`The '${input.operation}' operation requires committeeCode. Use 'list' to discover available committees.`, { operation: input.operation, committeeCode: input.committeeCode });
|
|
@@ -88,7 +95,10 @@ export const committeeLookupTool = tool('congressgov_committee_lookup', {
|
|
|
88
95
|
committeeCode: input.committeeCode,
|
|
89
96
|
subResource: input.operation,
|
|
90
97
|
});
|
|
91
|
-
return
|
|
98
|
+
return {
|
|
99
|
+
...result,
|
|
100
|
+
query: buildQueryEcho(`${input.operation} for committee ${input.committeeCode}`),
|
|
101
|
+
};
|
|
92
102
|
},
|
|
93
103
|
});
|
|
94
104
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"committee-lookup.tool.js","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/committee-lookup.tool.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAEhE,OAAO,EAAE,gBAAgB,EAAE,MAAM,sCAAsC,CAAC;AACxE,OAAO,EAAE,cAAc,EAAE,MAAM,iDAAiD,CAAC;AAGjF,sFAAsF;AACtF,SAAS,oBAAoB,CAAC,IAAY;IACxC,MAAM,KAAK,GAAG,IAAI,CAAC,CAAC,CAAC,EAAE,WAAW,EAAE,CAAC;IACrC,IAAI,KAAK,KAAK,GAAG;QAAE,OAAO,QAAQ,CAAC;IACnC,IAAI,KAAK,KAAK,GAAG;QAAE,OAAO,OAAO,CAAC;IAClC,IAAI,KAAK,KAAK,GAAG;QAAE,OAAO,OAAO,CAAC;IAClC,OAAO;AACT,CAAC;AAED,MAAM,CAAC,MAAM,mBAAmB,GAAG,IAAI,CAAC,8BAA8B,EAAE;IACtE,WAAW,EAAE,
|
|
1
|
+
{"version":3,"file":"committee-lookup.tool.js","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/committee-lookup.tool.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAEhE,OAAO,EAAE,gBAAgB,EAAE,MAAM,sCAAsC,CAAC;AACxE,OAAO,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,oCAAoC,CAAC;AAClF,OAAO,EAAE,cAAc,EAAE,MAAM,iDAAiD,CAAC;AAGjF,sFAAsF;AACtF,SAAS,oBAAoB,CAAC,IAAY;IACxC,MAAM,KAAK,GAAG,IAAI,CAAC,CAAC,CAAC,EAAE,WAAW,EAAE,CAAC;IACrC,IAAI,KAAK,KAAK,GAAG;QAAE,OAAO,QAAQ,CAAC;IACnC,IAAI,KAAK,KAAK,GAAG;QAAE,OAAO,OAAO,CA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AAK,EAAE,cAAc;QACrB,MAAM,EAAE,SAAS;KAClB,EACD,GAAG,CACJ,CAAC;IAEF,MAAM,QAAQ,GAAG,CAAC,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,CAAC;IAC5C,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,QAA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AAC,CAAC;YACH,OAAO,MAAM,CAAC;QAChB,CAAC;QAED,MAAM,MAAM,GAAG,MAAM,GAAG,CAAC,kBAAkB,CACzC;YACE,QAAQ,EAAE,KAAK,CAAC,QAAQ;YACxB,UAAU,EAAE,KAAK,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,C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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"}
|
|
@@ -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 { formatDailyRecord } from '../../../mcp-server/tools/format-helpers.js';
|
|
8
|
+
import { buildQueryEcho, listOutput } from '../../../mcp-server/tools/tool-helpers.js';
|
|
8
9
|
import { getCongressApi } from '../../../services/congress-api/congress-api-service.js';
|
|
9
10
|
export const dailyRecordTool = tool('congressgov_daily_record', {
|
|
10
11
|
description: `Browse the daily Congressional Record — floor speeches, debates, and legislative text published each day Congress is in session. Navigation is hierarchical: volumes (via 'list') → issues (via 'issues') → articles (via 'articles'). Use 'list' to find recent volumes, 'issues' to see what's in a volume, and 'articles' to access individual speeches and debate sections.`,
|
|
@@ -26,14 +27,14 @@ export const dailyRecordTool = tool('congressgov_daily_record', {
|
|
|
26
27
|
limit: z.number().int().min(1).max(250).default(20).describe('Results per page (1-250).'),
|
|
27
28
|
offset: z.number().int().min(0).default(0).describe('Pagination offset.'),
|
|
28
29
|
}),
|
|
29
|
-
output:
|
|
30
|
+
output: listOutput,
|
|
30
31
|
format: formatDailyRecord,
|
|
31
32
|
async handler(input, ctx) {
|
|
32
33
|
const api = getCongressApi();
|
|
33
34
|
if (input.operation === 'list') {
|
|
34
35
|
const result = await api.listDailyRecord({ limit: input.limit, offset: input.offset }, ctx);
|
|
35
36
|
ctx.log.info('Daily record listed');
|
|
36
|
-
return result;
|
|
37
|
+
return { ...result, query: buildQueryEcho('Congressional Record volumes') };
|
|
37
38
|
}
|
|
38
39
|
if (!input.volumeNumber) {
|
|
39
40
|
throw validationError(`The '${input.operation}' operation requires volumeNumber. Use 'list' to browse available Congressional Record volumes.`, { field: 'volumeNumber', operation: input.operation });
|
|
@@ -45,7 +46,10 @@ export const dailyRecordTool = tool('congressgov_daily_record', {
|
|
|
45
46
|
offset: input.offset,
|
|
46
47
|
}, ctx);
|
|
47
48
|
ctx.log.info('Daily record issues retrieved', { volumeNumber: input.volumeNumber });
|
|
48
|
-
return
|
|
49
|
+
return {
|
|
50
|
+
...result,
|
|
51
|
+
query: buildQueryEcho(`issues for volume ${input.volumeNumber}`),
|
|
52
|
+
};
|
|
49
53
|
}
|
|
50
54
|
if (!input.issueNumber) {
|
|
51
55
|
throw validationError("The 'articles' operation requires both volumeNumber and issueNumber. Use 'issues' to see available issues within a volume.", { field: 'issueNumber' });
|
|
@@ -60,7 +64,10 @@ export const dailyRecordTool = tool('congressgov_daily_record', {
|
|
|
60
64
|
volumeNumber: input.volumeNumber,
|
|
61
65
|
issueNumber: input.issueNumber,
|
|
62
66
|
});
|
|
63
|
-
return
|
|
67
|
+
return {
|
|
68
|
+
...result,
|
|
69
|
+
query: buildQueryEcho(`articles for volume ${input.volumeNumber}, issue ${input.issueNumber}`),
|
|
70
|
+
};
|
|
64
71
|
},
|
|
65
72
|
});
|
|
66
73
|
//# sourceMappingURL=daily-record.tool.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"daily-record.tool.js","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/daily-record.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,iBAAiB,EAAE,MAAM,sCAAsC,CAAC;AACzE,OAAO,EAAE,cAAc,EAAE,MAAM,iDAAiD,CAAC;AAEjF,MAAM,CAAC,MAAM,eAAe,GAAG,IAAI,CAAC,0BAA0B,EAAE;IAC9D,WAAW,EAAE,iXAAiX;IAC9X,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,QAAQ,EAAE,UAAU,CAAC,CAAC,CAAC,QAAQ,CAAC,yBAAyB,CAAC;QACrF,YAAY,EAAE,CAAC;aACZ,MAAM,EAAE;aACR,GAAG,EAAE;aACL,QAAQ,EAAE;aACV,QAAQ,EAAE;aACV,QAAQ,CAAC,sDAAsD,CAAC;QACnE,WAAW,EAAE,CAAC;aACX,MAAM,EAAE;aACR,GAAG,EAAE;aACL,QAAQ,EAAE;aACV,QAAQ,EAAE;aACV,QAAQ,CAAC,wDAAwD,CAAC;QACrE,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Optional<z.ZodNumber>;
|
|
17
17
|
limit: z.ZodDefault<z.ZodNumber>;
|
|
18
18
|
offset: z.ZodDefault<z.ZodNumber>;
|
|
19
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
19
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
20
|
+
data: z.ZodOptional<z.ZodArray<z.ZodObject<{}, z.core.$loose>>>;
|
|
21
|
+
pagination: z.ZodOptional<z.ZodObject<{
|
|
22
|
+
count: z.ZodNumber;
|
|
23
|
+
nextOffset: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
24
|
+
}, z.core.$strip>>;
|
|
25
|
+
query: z.ZodOptional<z.ZodString>;
|
|
26
|
+
}, z.core.$loose>, undefined>;
|
|
20
27
|
//# sourceMappingURL=enacted-laws.tool.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"enacted-laws.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/enacted-laws.tool.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"enacted-laws.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/enacted-laws.tool.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;AAOjD,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;6BAmE1B,CAAC"}
|
|
@@ -5,9 +5,10 @@
|
|
|
5
5
|
import { tool, z } from '@cyanheads/mcp-ts-core';
|
|
6
6
|
import { validationError } from '@cyanheads/mcp-ts-core/errors';
|
|
7
7
|
import { formatLaws } 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 enactedLawsTool = tool('congressgov_enacted_laws', {
|
|
10
|
-
description: `Browse enacted public and private laws from Congress.gov
|
|
11
|
+
description: `Browse enacted public and private laws from Congress.gov by congress and law type ('pub' for public laws, 'priv' for private). 'list' filters by enactment status and law type — the discovery path 'bill_lookup' does not offer. 'get' returns the origin bill record (sponsor, actions, summaries, text), with the public/private law citation on the bill's 'laws' array (e.g. {"number":"118-2","type":"Public Law"}).`,
|
|
11
12
|
annotations: { readOnlyHint: true, idempotentHint: true, openWorldHint: true },
|
|
12
13
|
input: z.object({
|
|
13
14
|
operation: z.enum(['list', 'get']).describe('Which data to retrieve.'),
|
|
@@ -20,7 +21,7 @@ export const enactedLawsTool = tool('congressgov_enacted_laws', {
|
|
|
20
21
|
limit: z.number().int().min(1).max(250).default(20).describe('Results per page (1-250).'),
|
|
21
22
|
offset: z.number().int().min(0).default(0).describe('Pagination offset.'),
|
|
22
23
|
}),
|
|
23
|
-
output:
|
|
24
|
+
output: listOrDetail('law', "Origin bill record for `get`; absent for `list`. The bill's `laws` array carries the law citation."),
|
|
24
25
|
format: formatLaws,
|
|
25
26
|
async handler(input, ctx) {
|
|
26
27
|
const api = getCongressApi();
|
|
@@ -32,7 +33,13 @@ export const enactedLawsTool = tool('congressgov_enacted_laws', {
|
|
|
32
33
|
offset: input.offset,
|
|
33
34
|
}, ctx);
|
|
34
35
|
ctx.log.info('Laws listed', { congress: input.congress, count: result.data.length });
|
|
35
|
-
return
|
|
36
|
+
return {
|
|
37
|
+
...result,
|
|
38
|
+
query: buildQueryEcho('enacted laws', {
|
|
39
|
+
congress: input.congress,
|
|
40
|
+
lawType: input.lawType,
|
|
41
|
+
}),
|
|
42
|
+
};
|
|
36
43
|
}
|
|
37
44
|
if (!input.lawType || !input.lawNumber) {
|
|
38
45
|
throw validationError("The 'get' operation requires lawType ('pub' or 'priv') and lawNumber. Use 'list' to browse laws by congress.", { lawType: input.lawType, lawNumber: input.lawNumber });
|