@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
|
@@ -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,C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AAG,CAAC,GAAG,CAAC,IAAI,CAAC,iCAAiC,EAAE;YAC9C,YAAY,EAAE,KAAK,CAAC,YAAY;YAChC,WAAW,EAAE,KAAK,CAAC,WAAW;SAC/B,CAAC,CAAC;QACH,OAAO;YACL,GAAG,MAAM;YACT,KAAK,EAAE,cAAc,CACnB,uBAAuB,KAAK,CAAC,YAAY,WAAW,KAAK,CAAC,WAAW,EAAE,CACxE;SACF,CAAC;IACJ,CAAC;CACF,CAAC,CAAC"}
|
|
@@ -16,5 +16,12 @@ export declare const enactedLawsTool: import("@cyanheads/mcp-ts-core").ToolDefin
|
|
|
16
16
|
lawNumber: z.ZodOptional<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 });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"enacted-laws.tool.js","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/enacted-laws.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,UAAU,EAAE,MAAM,sCAAsC,CAAC;AAClE,OAAO,EAAE,cAAc,EAAE,MAAM,iDAAiD,CAAC;AAEjF,MAAM,CAAC,MAAM,eAAe,GAAG,IAAI,CAAC,0BAA0B,EAAE;IAC9D,WAAW,EAAE,
|
|
1
|
+
{"version":3,"file":"enacted-laws.tool.js","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/enacted-laws.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,UAAU,EAAE,MAAM,sCAAsC,CAAC;AAClE,OAAO,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,oCAAoC,CAAC;AAClF,OAAO,EAAE,cAAc,EAAE,MAAM,iDAAiD,CAAC;AAEjF,MAAM,CAAC,MAAM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AAC;IAChB,CAAC;CACF,CAAC,CAAC"}
|
|
@@ -17,5 +17,12 @@ export declare const memberLookupTool: import("@cyanheads/mcp-ts-core").ToolDefi
|
|
|
17
17
|
currentMember: z.ZodOptional<z.ZodBoolean>;
|
|
18
18
|
limit: z.ZodDefault<z.ZodNumber>;
|
|
19
19
|
offset: z.ZodDefault<z.ZodNumber>;
|
|
20
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
20
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
21
|
+
data: z.ZodOptional<z.ZodArray<z.ZodObject<{}, z.core.$loose>>>;
|
|
22
|
+
pagination: z.ZodOptional<z.ZodObject<{
|
|
23
|
+
count: z.ZodNumber;
|
|
24
|
+
nextOffset: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
25
|
+
}, z.core.$strip>>;
|
|
26
|
+
query: z.ZodOptional<z.ZodString>;
|
|
27
|
+
}, z.core.$loose>, undefined>;
|
|
21
28
|
//# sourceMappingURL=member-lookup.tool.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"member-lookup.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/member-lookup.tool.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"member-lookup.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/member-lookup.tool.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;AAOjD,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;6BA0G3B,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 { formatMembers } 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 memberLookupTool = tool('congressgov_member_lookup', {
|
|
10
11
|
description: `Discover congressional members and their legislative activity. No name search. For 'list', filter by stateCode (optionally with district), by congress, or by both together (e.g., 118th Congress + CA, or CA district 12 in the 118th). Add currentMember=true to restrict to currently serving members. Once you have a bioguideId, use 'get' for full profile or 'sponsored'/'cosponsored' for their legislative portfolio.`,
|
|
@@ -36,7 +37,7 @@ export const memberLookupTool = tool('congressgov_member_lookup', {
|
|
|
36
37
|
limit: z.number().int().min(1).max(250).default(20).describe('Results per page (1-250).'),
|
|
37
38
|
offset: z.number().int().min(0).default(0).describe('Pagination offset.'),
|
|
38
39
|
}),
|
|
39
|
-
output:
|
|
40
|
+
output: listOrDetail('member', 'Member profile for `get` (name, state, terms, party history, leadership, legislation counts); absent for `list`, `sponsored`, `cosponsored`.'),
|
|
40
41
|
format: formatMembers,
|
|
41
42
|
async handler(input, ctx) {
|
|
42
43
|
const api = getCongressApi();
|
|
@@ -53,7 +54,15 @@ export const memberLookupTool = tool('congressgov_member_lookup', {
|
|
|
53
54
|
offset: input.offset,
|
|
54
55
|
}, ctx);
|
|
55
56
|
ctx.log.info('Members listed', { count: result.data.length });
|
|
56
|
-
return
|
|
57
|
+
return {
|
|
58
|
+
...result,
|
|
59
|
+
query: buildQueryEcho('members', {
|
|
60
|
+
congress: input.congress,
|
|
61
|
+
stateCode: input.stateCode,
|
|
62
|
+
district: input.district,
|
|
63
|
+
currentMember: input.currentMember,
|
|
64
|
+
}),
|
|
65
|
+
};
|
|
57
66
|
}
|
|
58
67
|
if (!input.bioguideId) {
|
|
59
68
|
throw validationError(`The '${input.operation}' operation requires bioguideId. Use 'list' with stateCode or congress to discover members.`, { field: 'bioguideId', operation: input.operation });
|
|
@@ -74,7 +83,10 @@ export const memberLookupTool = tool('congressgov_member_lookup', {
|
|
|
74
83
|
bioguideId: input.bioguideId,
|
|
75
84
|
type: input.operation,
|
|
76
85
|
});
|
|
77
|
-
return
|
|
86
|
+
return {
|
|
87
|
+
...result,
|
|
88
|
+
query: buildQueryEcho(`${input.operation} legislation for ${input.bioguideId}`),
|
|
89
|
+
};
|
|
78
90
|
},
|
|
79
91
|
});
|
|
80
92
|
//# sourceMappingURL=member-lookup.tool.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"member-lookup.tool.js","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/member-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,aAAa,EAAE,MAAM,sCAAsC,CAAC;AACrE,OAAO,EAAE,cAAc,EAAE,MAAM,iDAAiD,CAAC;AAEjF,MAAM,CAAC,MAAM,gBAAgB,GAAG,IAAI,CAAC,2BAA2B,EAAE;IAChE,WAAW,EAAE,gaAAga;IAC7a,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;aACT,IAAI,CAAC,CAAC,MAAM,EAAE,KAAK,EAAE,WAAW,EAAE,aAAa,CAAC,CAAC;aACjD,QAAQ,CAAC,yBAAyB,CAAC;QACtC,UAAU,EAAE,CAAC;aACV,MAAM,EAAE;aACR,QAAQ,EAAE;aACV,QAAQ,CACP,qFAAqF,CACtF;QACH,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,+BAA+B,CAAC;QAC1F,SAAS,EAAE,CAAC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E,CACpD,CAAC;QACJ,CAAC;QAED,IAAI,KAAK,CAAC,SAAS,KAAK,KAAK,EAAE,CAAC;YAC9B,MAAM,MAAM,GAAG,MAAM,GAAG,CAAC,SAAS,CAAC,KAAK,CAAC,UAAU,EAAE,GAAG,CAAC,CAAC;YAC1D,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,kBAAkB,EAAE,EAAE,UAAU,EAAE,KAAK,CAAC,UAAU,EAAE,CAAC,CAAC;YACnE,OAAO,MAAM,CAAC;QAChB,CAAC;QAED,MAAM,IAAI,GACR,KAAK,CAAC,SAAS,KAAK,WAAW,CAAC,CAAC,CAAC,uBAAuB,CAAC,CAAC,CAAC,yBAAyB,CAAC;QACxF,MAAM,MAAM,GAAG,MAAM,GAAG,CAAC,oBAAoB,CAC3C;YACE,UAAU,EAAE,KAAK,CAAC,UAAU;YAC5B,IAAI;YACJ,KAAK,EAAE,KAAK,CAAC,KAAK;YAClB,MAAM,EAAE,KAAK,CAAC,MAAM;SACrB,EACD,GAAG,CACJ,CAAC;QACF,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,8BAA8B,EAAE;YAC3C,UAAU,EAAE,KAAK,CAAC,UAAU;YAC5B,IAAI,EAAE,KAAK,CAAC,SAAS;SACtB,CAAC,CAAC;QACH,OAAO;YACL,GAAG,MAAM;YACT,KAAK,EAAE,cAAc,CAAC,GAAG,KAAK,CAAC,SAAS,oBAAoB,KAAK,CAAC,UAAU,EAAE,CAAC;SAChF,CAAC;IACJ,CAAC;CACF,CAAC,CAAC"}
|
|
@@ -12,7 +12,18 @@ export declare const rollVotesTool: import("@cyanheads/mcp-ts-core").ToolDefinit
|
|
|
12
12
|
congress: z.ZodNumber;
|
|
13
13
|
session: z.ZodNumber;
|
|
14
14
|
voteNumber: z.ZodOptional<z.ZodNumber>;
|
|
15
|
+
order: z.ZodDefault<z.ZodEnum<{
|
|
16
|
+
recent: "recent";
|
|
17
|
+
oldest: "oldest";
|
|
18
|
+
}>>;
|
|
15
19
|
limit: z.ZodDefault<z.ZodNumber>;
|
|
16
20
|
offset: z.ZodDefault<z.ZodNumber>;
|
|
17
|
-
}, 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>;
|
|
18
29
|
//# sourceMappingURL=roll-votes.tool.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"roll-votes.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/roll-votes.tool.ts"],"names":[],"mappings":"AAAA;;;GAGG;
|
|
1
|
+
{"version":3,"file":"roll-votes.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/roll-votes.tool.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;AAOjD,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;6BAiGxB,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 { formatVotes } 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 rollVotesTool = tool('congressgov_roll_votes', {
|
|
10
|
-
description: `Retrieve House roll call vote data and individual member voting positions — House-only, as Senate vote data is not yet in the Congress.gov API. Use 'list' to find votes by congress and session, 'get' for vote details (question, result, associated bill), or 'members' for how each representative voted.`,
|
|
11
|
+
description: `Retrieve House roll call vote data and individual member voting positions — House-only, as Senate vote data is not yet in the Congress.gov API. Use 'list' to find votes by congress and session (defaults to most-recently-updated first), 'get' for vote details (question, result, associated bill), or 'members' for how each representative voted.`,
|
|
11
12
|
annotations: { readOnlyHint: true, idempotentHint: true, openWorldHint: true },
|
|
12
13
|
input: z.object({
|
|
13
14
|
operation: z.enum(['list', 'get', 'members']).describe('Which data to retrieve.'),
|
|
@@ -24,14 +25,31 @@ export const rollVotesTool = tool('congressgov_roll_votes', {
|
|
|
24
25
|
.positive()
|
|
25
26
|
.optional()
|
|
26
27
|
.describe("Roll call vote number. Required for 'get' and 'members'."),
|
|
28
|
+
order: z
|
|
29
|
+
.enum(['recent', 'oldest'])
|
|
30
|
+
.default('recent')
|
|
31
|
+
.describe("Sort order for 'list', by vote update date. 'recent' (default) returns newest first; 'oldest' returns ascending. With 'recent', offset=0 always returns the strictly newest page. Ignored by 'get' and 'members'."),
|
|
27
32
|
limit: z.number().int().min(1).max(250).default(20).describe('Results per page (1-250).'),
|
|
28
33
|
offset: z.number().int().min(0).default(0).describe('Pagination offset.'),
|
|
29
34
|
}),
|
|
30
|
-
output:
|
|
35
|
+
output: listOrDetail('vote', 'Vote record for `get` and `members` (question, result, party totals, member positions); absent for `list`.'),
|
|
31
36
|
format: formatVotes,
|
|
32
37
|
async handler(input, ctx) {
|
|
33
38
|
const api = getCongressApi();
|
|
34
39
|
if (input.operation === 'list') {
|
|
40
|
+
const hint = buildQueryEcho('roll call votes', {
|
|
41
|
+
congress: input.congress,
|
|
42
|
+
session: input.session,
|
|
43
|
+
});
|
|
44
|
+
if (input.order === 'recent') {
|
|
45
|
+
const recent = await fetchVotesRecent({
|
|
46
|
+
congress: input.congress,
|
|
47
|
+
session: input.session,
|
|
48
|
+
limit: input.limit,
|
|
49
|
+
offset: input.offset,
|
|
50
|
+
}, ctx);
|
|
51
|
+
return { ...recent, query: hint };
|
|
52
|
+
}
|
|
35
53
|
const result = await api.listVotes({
|
|
36
54
|
congress: input.congress,
|
|
37
55
|
session: input.session,
|
|
@@ -39,7 +57,7 @@ export const rollVotesTool = tool('congressgov_roll_votes', {
|
|
|
39
57
|
offset: input.offset,
|
|
40
58
|
}, ctx);
|
|
41
59
|
ctx.log.info('Votes listed', { congress: input.congress, session: input.session });
|
|
42
|
-
return result;
|
|
60
|
+
return { ...result, query: hint };
|
|
43
61
|
}
|
|
44
62
|
if (!input.voteNumber) {
|
|
45
63
|
throw validationError(`The '${input.operation}' operation requires voteNumber. Use 'list' to browse available votes.`, { field: 'voteNumber', operation: input.operation });
|
|
@@ -56,7 +74,54 @@ export const rollVotesTool = tool('congressgov_roll_votes', {
|
|
|
56
74
|
...voteParams,
|
|
57
75
|
operation: input.operation,
|
|
58
76
|
});
|
|
77
|
+
if (input.operation === 'members') {
|
|
78
|
+
return {
|
|
79
|
+
...result,
|
|
80
|
+
query: buildQueryEcho(`member votes for roll ${input.voteNumber} in the ${input.congress}th Congress, session ${input.session}`),
|
|
81
|
+
};
|
|
82
|
+
}
|
|
59
83
|
return result;
|
|
60
84
|
},
|
|
61
85
|
});
|
|
86
|
+
/**
|
|
87
|
+
* Fetch roll call votes in strict newest-first order. The /house-vote/{c}/{s}
|
|
88
|
+
* endpoint returns rows in opaque insertion order (loosely correlated with roll
|
|
89
|
+
* number but not with updateDate — late-edited votes break the sequence), and
|
|
90
|
+
* ignores sort params. Fetch the full session, sort by updateDate desc, then
|
|
91
|
+
* slice the requested page. Typical sessions are 200-750 votes; at PAGE_SIZE=250
|
|
92
|
+
* that's 1-3 upstream requests per call, dispatched in parallel after the first.
|
|
93
|
+
*/
|
|
94
|
+
async function fetchVotesRecent(params, ctx) {
|
|
95
|
+
const api = getCongressApi();
|
|
96
|
+
const PAGE_SIZE = 250;
|
|
97
|
+
const first = await api.listVotes({ congress: params.congress, session: params.session, limit: PAGE_SIZE, offset: 0 }, ctx);
|
|
98
|
+
const total = first.pagination.count;
|
|
99
|
+
if (total === 0 || params.offset >= total) {
|
|
100
|
+
return { data: [], pagination: { count: total, nextOffset: null } };
|
|
101
|
+
}
|
|
102
|
+
const remainingPages = Math.ceil(total / PAGE_SIZE) - 1;
|
|
103
|
+
const pages = await Promise.all(Array.from({ length: remainingPages }, (_, i) => api.listVotes({
|
|
104
|
+
congress: params.congress,
|
|
105
|
+
session: params.session,
|
|
106
|
+
limit: PAGE_SIZE,
|
|
107
|
+
offset: (i + 1) * PAGE_SIZE,
|
|
108
|
+
}, ctx)));
|
|
109
|
+
const all = [...first.data, ...pages.flatMap((p) => p.data)];
|
|
110
|
+
all.sort((a, b) => {
|
|
111
|
+
const ad = a.updateDate ?? '';
|
|
112
|
+
const bd = b.updateDate ?? '';
|
|
113
|
+
return bd.localeCompare(ad);
|
|
114
|
+
});
|
|
115
|
+
const slice = all.slice(params.offset, params.offset + params.limit);
|
|
116
|
+
const nextOffset = params.offset + slice.length < all.length ? params.offset + slice.length : null;
|
|
117
|
+
ctx.log.info('Votes listed (recent order, strict)', {
|
|
118
|
+
congress: params.congress,
|
|
119
|
+
session: params.session,
|
|
120
|
+
total: all.length,
|
|
121
|
+
returned: slice.length,
|
|
122
|
+
offset: params.offset,
|
|
123
|
+
upstreamRequests: 1 + remainingPages,
|
|
124
|
+
});
|
|
125
|
+
return { ...first, data: slice, pagination: { count: all.length, nextOffset } };
|
|
126
|
+
}
|
|
62
127
|
//# sourceMappingURL=roll-votes.tool.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"roll-votes.tool.js","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/roll-votes.tool.ts"],"names":[],"mappings":"AAAA;;;GAGG;
|
|
1
|
+
{"version":3,"file":"roll-votes.tool.js","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/roll-votes.tool.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,E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<z.ZodNumber>;
|
|
19
19
|
offset: z.ZodDefault<z.ZodNumber>;
|
|
20
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
20
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
21
|
+
data: z.ZodOptional<z.ZodArray<z.ZodObject<{}, z.core.$loose>>>;
|
|
22
|
+
pagination: z.ZodOptional<z.ZodObject<{
|
|
23
|
+
count: z.ZodNumber;
|
|
24
|
+
nextOffset: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
25
|
+
}, z.core.$strip>>;
|
|
26
|
+
query: z.ZodOptional<z.ZodString>;
|
|
27
|
+
}, z.core.$loose>, undefined>;
|
|
21
28
|
//# sourceMappingURL=senate-nominations.tool.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"senate-nominations.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/senate-nominations.tool.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"senate-nominations.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/senate-nominations.tool.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;AAOjD,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;6BA+GhC,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 { formatNominations } 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 senateNominationsTool = tool('congressgov_senate_nominations', {
|
|
10
|
-
description: `Browse presidential nominations to federal positions and track the Senate confirmation process. Use 'list' to browse, 'get' for nomination detail, 'actions'/'committees'/'hearings' for confirmation pipeline data, or 'nominees' to retrieve individual appointees in a multi-nominee batch. Nominations use 'PN' (Presidential Nomination) numbering
|
|
11
|
+
description: `Browse presidential nominations to federal positions and track the Senate confirmation process. Use 'list' to browse, 'get' for nomination detail, 'actions'/'committees'/'hearings' for confirmation pipeline data, or 'nominees' to retrieve individual appointees in a multi-nominee batch. Nominations use 'PN' (Presidential Nomination) numbering. Most nominations carry confirmation activity on the parent (e.g., PN1000); multi-part parents (e.g., PN851) carry no activity of their own — their actions, committees, hearings, and nominees live on partitioned children (PN851-1, PN851-2, …). 'get' on a parent that has no \`nominees\` array signals the partitioned form is needed for everything below it.`,
|
|
11
12
|
annotations: { readOnlyHint: true, idempotentHint: true, openWorldHint: true },
|
|
12
13
|
input: z.object({
|
|
13
14
|
operation: z
|
|
@@ -17,17 +18,17 @@ export const senateNominationsTool = tool('congressgov_senate_nominations', {
|
|
|
17
18
|
nominationNumber: z
|
|
18
19
|
.string()
|
|
19
20
|
.optional()
|
|
20
|
-
.describe("Nomination number (e.g
|
|
21
|
+
.describe("Nomination number. Use the bare form (e.g. '1000') for nominations whose activity sits on the parent; use the partitioned form (e.g. '851-1') for sub-resources of a multi-part nomination. Required for detail operations."),
|
|
21
22
|
ordinal: z
|
|
22
23
|
.number()
|
|
23
24
|
.int()
|
|
24
25
|
.positive()
|
|
25
26
|
.optional()
|
|
26
|
-
.describe("Batch ordinal within a multi-nominee nomination. Each ordinal addresses a group of nominees; the 'nominees' operation returns every individual in that batch. Use 'get' first to see available ordinals on the nomination's `nominees` array."),
|
|
27
|
+
.describe("Batch ordinal within a multi-nominee nomination. Each ordinal addresses a group of nominees; the 'nominees' operation returns every individual in that batch. Use 'get' first to see available ordinals on the nomination's `nominees` array (multi-part parents have no nominees array — use a partitioned form like '851-1' instead)."),
|
|
27
28
|
limit: z.number().int().min(1).max(250).default(20).describe('Results per page (1-250).'),
|
|
28
29
|
offset: z.number().int().min(0).default(0).describe('Pagination offset.'),
|
|
29
30
|
}),
|
|
30
|
-
output:
|
|
31
|
+
output: listOrDetail('nomination', 'Nomination record for `get` (description, dates, nominees array, sub-resource counts); absent for `list` and sub-resources.'),
|
|
31
32
|
format: formatNominations,
|
|
32
33
|
async handler(input, ctx) {
|
|
33
34
|
const api = getCongressApi();
|
|
@@ -41,7 +42,10 @@ export const senateNominationsTool = tool('congressgov_senate_nominations', {
|
|
|
41
42
|
congress: input.congress,
|
|
42
43
|
count: result.data.length,
|
|
43
44
|
});
|
|
44
|
-
return
|
|
45
|
+
return {
|
|
46
|
+
...result,
|
|
47
|
+
query: buildQueryEcho('nominations', { congress: input.congress }),
|
|
48
|
+
};
|
|
45
49
|
}
|
|
46
50
|
if (!input.nominationNumber) {
|
|
47
51
|
throw validationError(`The '${input.operation}' operation requires nominationNumber. Use 'list' to browse nominations.`, { field: 'nominationNumber', operation: input.operation });
|
|
@@ -67,7 +71,7 @@ export const senateNominationsTool = tool('congressgov_senate_nominations', {
|
|
|
67
71
|
nominationNumber: input.nominationNumber,
|
|
68
72
|
ordinal: input.ordinal,
|
|
69
73
|
});
|
|
70
|
-
return result;
|
|
74
|
+
return withParentFormHint(result, input.nominationNumber);
|
|
71
75
|
}
|
|
72
76
|
const result = await api.getNominationSubResource({
|
|
73
77
|
congress: input.congress,
|
|
@@ -81,7 +85,22 @@ export const senateNominationsTool = tool('congressgov_senate_nominations', {
|
|
|
81
85
|
nominationNumber: input.nominationNumber,
|
|
82
86
|
subResource: input.operation,
|
|
83
87
|
});
|
|
84
|
-
return result;
|
|
88
|
+
return withParentFormHint(result, input.nominationNumber);
|
|
85
89
|
},
|
|
86
90
|
});
|
|
91
|
+
/**
|
|
92
|
+
* Sub-resource calls (actions/committees/hearings/nominees) against a bare
|
|
93
|
+
* parent number (e.g. '851') silently return 0 results when the nomination is
|
|
94
|
+
* a multi-part parent — those sub-resources live on the partitioned children.
|
|
95
|
+
* Attach a hint the formatter can render so callers know to try the partitioned
|
|
96
|
+
* form.
|
|
97
|
+
*/
|
|
98
|
+
function withParentFormHint(result, nominationNumber) {
|
|
99
|
+
if (result.data.length > 0 || nominationNumber.includes('-'))
|
|
100
|
+
return result;
|
|
101
|
+
return {
|
|
102
|
+
...result,
|
|
103
|
+
query: `If \`${nominationNumber}\` is a multi-part parent, its actions/committees/hearings/nominees live on the partitioned children. Try \`${nominationNumber}-1\` (and -2, -3, …) instead.`,
|
|
104
|
+
};
|
|
105
|
+
}
|
|
87
106
|
//# sourceMappingURL=senate-nominations.tool.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"senate-nominations.tool.js","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/senate-nominations.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,qBAAqB,GAAG,IAAI,CAAC,gCAAgC,EAAE;IAC1E,WAAW,EAAE,
|
|
1
|
+
{"version":3,"file":"senate-nominations.tool.js","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/senate-nominations.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,YAAY,EAAE,MAAM,oCAAoC,CAAC;AAClF,OAAO,EAAE,cAAc,EAAE,MAAM,iDAAiD,CAAC;AAEjF,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AS,EAAE,gBAAwB;IAC5F,IAAI,MAAM,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,IAAI,gBAAgB,CAAC,QAAQ,CAAC,GAAG,CAAC;QAAE,OAAO,MAAM,CAAC;IAC5E,OAAO;QACL,GAAG,MAAM;QACT,KAAK,EAAE,QAAQ,gBAAgB,+GAA+G,gBAAgB,+BAA+B;KAC9L,CAAC;AACJ,CAAC"}
|
|
@@ -29,11 +29,11 @@ export declare function formatCrsReports(result: Record<string, unknown>): TextB
|
|
|
29
29
|
/** Daily Congressional Record — volumes, issues, articles. */
|
|
30
30
|
/** Daily Congressional Record. Dispatches between volumes/issues and flattened articles. */
|
|
31
31
|
export declare function formatDailyRecord(result: Record<string, unknown>): TextBlock[];
|
|
32
|
-
/** Enacted public and private laws. */
|
|
32
|
+
/** Enacted public and private laws. Upstream /law mirrors /bill, so reuse bill formatters. */
|
|
33
33
|
export declare const formatLaws: (result: Record<string, unknown>) => TextBlock[];
|
|
34
34
|
/** House roll call votes and member voting positions. */
|
|
35
|
-
export declare
|
|
35
|
+
export declare function formatVotes(result: Record<string, unknown>): TextBlock[];
|
|
36
36
|
/** Presidential nominations and Senate confirmation pipeline. */
|
|
37
|
-
export declare
|
|
37
|
+
export declare function formatNominations(result: Record<string, unknown>): TextBlock[];
|
|
38
38
|
export {};
|
|
39
39
|
//# sourceMappingURL=format-helpers.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"format-helpers.d.ts","sourceRoot":"","sources":["../../../src/mcp-server/tools/format-helpers.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,KAAK,SAAS,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC;
|
|
1
|
+
{"version":3,"file":"format-helpers.d.ts","sourceRoot":"","sources":["../../../src/mcp-server/tools/format-helpers.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,KAAK,S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