@cyanheads/congressgov-mcp-server 0.3.3

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.
Files changed (94) hide show
  1. package/CLAUDE.md +270 -0
  2. package/Dockerfile +99 -0
  3. package/LICENSE +191 -0
  4. package/README.md +296 -0
  5. package/dist/config/server-config.d.ts +13 -0
  6. package/dist/config/server-config.d.ts.map +1 -0
  7. package/dist/config/server-config.js +22 -0
  8. package/dist/config/server-config.js.map +1 -0
  9. package/dist/index.d.ts +7 -0
  10. package/dist/index.d.ts.map +1 -0
  11. package/dist/index.js +50 -0
  12. package/dist/index.js.map +1 -0
  13. package/dist/mcp-server/prompts/definitions/bill-analysis.prompt.d.ts +11 -0
  14. package/dist/mcp-server/prompts/definitions/bill-analysis.prompt.d.ts.map +1 -0
  15. package/dist/mcp-server/prompts/definitions/bill-analysis.prompt.js +36 -0
  16. package/dist/mcp-server/prompts/definitions/bill-analysis.prompt.js.map +1 -0
  17. package/dist/mcp-server/prompts/definitions/legislative-research.prompt.d.ts +10 -0
  18. package/dist/mcp-server/prompts/definitions/legislative-research.prompt.d.ts.map +1 -0
  19. package/dist/mcp-server/prompts/definitions/legislative-research.prompt.js +47 -0
  20. package/dist/mcp-server/prompts/definitions/legislative-research.prompt.js.map +1 -0
  21. package/dist/mcp-server/resources/definitions/bill-types.resource.d.ts +8 -0
  22. package/dist/mcp-server/resources/definitions/bill-types.resource.d.ts.map +1 -0
  23. package/dist/mcp-server/resources/definitions/bill-types.resource.js +39 -0
  24. package/dist/mcp-server/resources/definitions/bill-types.resource.js.map +1 -0
  25. package/dist/mcp-server/resources/definitions/bill.resource.d.ts +11 -0
  26. package/dist/mcp-server/resources/definitions/bill.resource.d.ts.map +1 -0
  27. package/dist/mcp-server/resources/definitions/bill.resource.js +31 -0
  28. package/dist/mcp-server/resources/definitions/bill.resource.js.map +1 -0
  29. package/dist/mcp-server/resources/definitions/committee.resource.d.ts +9 -0
  30. package/dist/mcp-server/resources/definitions/committee.resource.d.ts.map +1 -0
  31. package/dist/mcp-server/resources/definitions/committee.resource.js +26 -0
  32. package/dist/mcp-server/resources/definitions/committee.resource.js.map +1 -0
  33. package/dist/mcp-server/resources/definitions/current-congress.resource.d.ts +8 -0
  34. package/dist/mcp-server/resources/definitions/current-congress.resource.d.ts.map +1 -0
  35. package/dist/mcp-server/resources/definitions/current-congress.resource.js +18 -0
  36. package/dist/mcp-server/resources/definitions/current-congress.resource.js.map +1 -0
  37. package/dist/mcp-server/resources/definitions/member.resource.d.ts +9 -0
  38. package/dist/mcp-server/resources/definitions/member.resource.d.ts.map +1 -0
  39. package/dist/mcp-server/resources/definitions/member.resource.js +21 -0
  40. package/dist/mcp-server/resources/definitions/member.resource.js.map +1 -0
  41. package/dist/mcp-server/tools/definitions/bill-lookup.tool.d.ts +37 -0
  42. package/dist/mcp-server/tools/definitions/bill-lookup.tool.d.ts.map +1 -0
  43. package/dist/mcp-server/tools/definitions/bill-lookup.tool.js +105 -0
  44. package/dist/mcp-server/tools/definitions/bill-lookup.tool.js.map +1 -0
  45. package/dist/mcp-server/tools/definitions/bill-summaries.tool.d.ts +23 -0
  46. package/dist/mcp-server/tools/definitions/bill-summaries.tool.d.ts.map +1 -0
  47. package/dist/mcp-server/tools/definitions/bill-summaries.tool.js +57 -0
  48. package/dist/mcp-server/tools/definitions/bill-summaries.tool.js.map +1 -0
  49. package/dist/mcp-server/tools/definitions/committee-lookup.tool.d.ts +24 -0
  50. package/dist/mcp-server/tools/definitions/committee-lookup.tool.d.ts.map +1 -0
  51. package/dist/mcp-server/tools/definitions/committee-lookup.tool.js +70 -0
  52. package/dist/mcp-server/tools/definitions/committee-lookup.tool.js.map +1 -0
  53. package/dist/mcp-server/tools/definitions/committee-reports.tool.d.ts +22 -0
  54. package/dist/mcp-server/tools/definitions/committee-reports.tool.d.ts.map +1 -0
  55. package/dist/mcp-server/tools/definitions/committee-reports.tool.js +80 -0
  56. package/dist/mcp-server/tools/definitions/committee-reports.tool.js.map +1 -0
  57. package/dist/mcp-server/tools/definitions/crs-reports.tool.d.ts +15 -0
  58. package/dist/mcp-server/tools/definitions/crs-reports.tool.d.ts.map +1 -0
  59. package/dist/mcp-server/tools/definitions/crs-reports.tool.js +41 -0
  60. package/dist/mcp-server/tools/definitions/crs-reports.tool.js.map +1 -0
  61. package/dist/mcp-server/tools/definitions/daily-record.tool.d.ts +17 -0
  62. package/dist/mcp-server/tools/definitions/daily-record.tool.d.ts.map +1 -0
  63. package/dist/mcp-server/tools/definitions/daily-record.tool.js +67 -0
  64. package/dist/mcp-server/tools/definitions/daily-record.tool.js.map +1 -0
  65. package/dist/mcp-server/tools/definitions/enacted-laws.tool.d.ts +20 -0
  66. package/dist/mcp-server/tools/definitions/enacted-laws.tool.d.ts.map +1 -0
  67. package/dist/mcp-server/tools/definitions/enacted-laws.tool.js +55 -0
  68. package/dist/mcp-server/tools/definitions/enacted-laws.tool.js.map +1 -0
  69. package/dist/mcp-server/tools/definitions/member-lookup.tool.d.ts +21 -0
  70. package/dist/mcp-server/tools/definitions/member-lookup.tool.d.ts.map +1 -0
  71. package/dist/mcp-server/tools/definitions/member-lookup.tool.js +86 -0
  72. package/dist/mcp-server/tools/definitions/member-lookup.tool.js.map +1 -0
  73. package/dist/mcp-server/tools/definitions/roll-votes.tool.d.ts +18 -0
  74. package/dist/mcp-server/tools/definitions/roll-votes.tool.d.ts.map +1 -0
  75. package/dist/mcp-server/tools/definitions/roll-votes.tool.js +65 -0
  76. package/dist/mcp-server/tools/definitions/roll-votes.tool.js.map +1 -0
  77. package/dist/mcp-server/tools/definitions/senate-nominations.tool.d.ts +21 -0
  78. package/dist/mcp-server/tools/definitions/senate-nominations.tool.d.ts.map +1 -0
  79. package/dist/mcp-server/tools/definitions/senate-nominations.tool.js +90 -0
  80. package/dist/mcp-server/tools/definitions/senate-nominations.tool.js.map +1 -0
  81. package/dist/mcp-server/tools/format-helpers.d.ts +12 -0
  82. package/dist/mcp-server/tools/format-helpers.d.ts.map +1 -0
  83. package/dist/mcp-server/tools/format-helpers.js +72 -0
  84. package/dist/mcp-server/tools/format-helpers.js.map +1 -0
  85. package/dist/services/congress-api/congress-api-service.d.ts +75 -0
  86. package/dist/services/congress-api/congress-api-service.d.ts.map +1 -0
  87. package/dist/services/congress-api/congress-api-service.js +292 -0
  88. package/dist/services/congress-api/congress-api-service.js.map +1 -0
  89. package/dist/services/congress-api/types.d.ts +122 -0
  90. package/dist/services/congress-api/types.d.ts.map +1 -0
  91. package/dist/services/congress-api/types.js +6 -0
  92. package/dist/services/congress-api/types.js.map +1 -0
  93. package/package.json +71 -0
  94. package/server.json +111 -0
@@ -0,0 +1,41 @@
1
+ /**
2
+ * @fileoverview Tool for browsing and retrieving CRS policy analysis reports.
3
+ * @module mcp-server/tools/definitions/crs-reports
4
+ */
5
+ import { tool, z } from '@cyanheads/mcp-ts-core';
6
+ import { formatResult } from '../../../mcp-server/tools/format-helpers.js';
7
+ import { getCongressApi } from '../../../services/congress-api/congress-api-service.js';
8
+ export const crsReportsTool = tool('congressgov_crs_reports', {
9
+ description: `Browse and retrieve CRS (Congressional Research Service) reports — nonpartisan policy analyses written by subject-matter experts at the Library of Congress.
10
+
11
+ CRS reports cover policy areas, legislative proposals, and legal questions. Report IDs use letter-number codes (e.g., R40097, RL33612, IF12345).
12
+
13
+ Use 'list' to browse available reports, 'get' for full detail including authors, topics, summary, and available download formats.`,
14
+ annotations: { readOnlyHint: true, idempotentHint: true, openWorldHint: true },
15
+ input: z.object({
16
+ operation: z.enum(['list', 'get']).describe('Which data to retrieve.'),
17
+ reportNumber: z
18
+ .string()
19
+ .optional()
20
+ .describe("CRS report ID (e.g., 'R40097'). Required for 'get'."),
21
+ limit: z.number().int().min(1).max(250).default(20).describe('Results per page (1-250).'),
22
+ offset: z.number().int().min(0).default(0).describe('Pagination offset.'),
23
+ }),
24
+ output: z.object({}).passthrough().describe('CRS report data from Congress.gov API.'),
25
+ format: formatResult,
26
+ async handler(input, ctx) {
27
+ const api = getCongressApi();
28
+ if (input.operation === 'list') {
29
+ const result = await api.listCrsReports({ limit: input.limit, offset: input.offset });
30
+ ctx.log.info('CRS reports listed', { count: result.data.length });
31
+ return result;
32
+ }
33
+ if (!input.reportNumber) {
34
+ throw new Error("The 'get' operation requires reportNumber. Report IDs use letter-number codes (e.g., R40097). Use 'list' to browse available reports.");
35
+ }
36
+ const result = await api.getCrsReport({ reportNumber: input.reportNumber });
37
+ ctx.log.info('CRS report retrieved', { reportNumber: input.reportNumber });
38
+ return result;
39
+ },
40
+ });
41
+ //# sourceMappingURL=crs-reports.tool.js.map
@@ -0,0 +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;AAEjD,OAAO,EAAE,YAAY,EAAE,MAAM,sCAAsC,CAAC;AACpE,OAAO,EAAE,cAAc,EAAE,MAAM,iDAAiD,CAAC;AAEjF,MAAM,CAAC,MAAM,cAAc,GAAG,IAAI,CAAC,yBAAyB,EAAE;IAC5D,WAAW,EAAE;;;;kIAImH;IAChI,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,O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for browsing the daily Congressional Record.
3
+ * @module mcp-server/tools/definitions/daily-record
4
+ */
5
+ import { z } from '@cyanheads/mcp-ts-core';
6
+ export declare const dailyRecordTool: import("@cyanheads/mcp-ts-core").ToolDefinition<z.ZodObject<{
7
+ operation: z.ZodEnum<{
8
+ articles: "articles";
9
+ list: "list";
10
+ issues: "issues";
11
+ }>;
12
+ volumeNumber: z.ZodOptional<z.ZodNumber>;
13
+ issueNumber: z.ZodOptional<z.ZodNumber>;
14
+ limit: z.ZodDefault<z.ZodNumber>;
15
+ offset: z.ZodDefault<z.ZodNumber>;
16
+ }, z.core.$strip>, z.ZodObject<{}, z.core.$loose>>;
17
+ //# sourceMappingURL=daily-record.tool.d.ts.map
@@ -0,0 +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;AAKjD,eAAO,MAAM,eAAe;;;;;;;;;;kDAoE1B,CAAC"}
@@ -0,0 +1,67 @@
1
+ /**
2
+ * @fileoverview Tool for browsing the daily Congressional Record.
3
+ * @module mcp-server/tools/definitions/daily-record
4
+ */
5
+ import { tool, z } from '@cyanheads/mcp-ts-core';
6
+ import { formatResult } from '../../../mcp-server/tools/format-helpers.js';
7
+ import { getCongressApi } from '../../../services/congress-api/congress-api-service.js';
8
+ export const dailyRecordTool = tool('congressgov_daily_record', {
9
+ description: `Browse the daily Congressional Record — floor speeches, debates, and legislative text published each day Congress is in session.
10
+
11
+ Navigation is hierarchical: list → volumes, issues → individual articles. Use 'list' to find recent volumes, 'issues' to see what's in a volume, and 'articles' to access individual speeches and debate sections.`,
12
+ annotations: { readOnlyHint: true, idempotentHint: true, openWorldHint: true },
13
+ input: z.object({
14
+ operation: z.enum(['list', 'issues', 'articles']).describe('Which data to retrieve.'),
15
+ volumeNumber: z
16
+ .number()
17
+ .int()
18
+ .positive()
19
+ .optional()
20
+ .describe("Volume number. Required for 'issues' and 'articles'."),
21
+ issueNumber: z
22
+ .number()
23
+ .int()
24
+ .positive()
25
+ .optional()
26
+ .describe("Issue number within a volume. Required for 'articles'."),
27
+ limit: z.number().int().min(1).max(250).default(20).describe('Results per page (1-250).'),
28
+ offset: z.number().int().min(0).default(0).describe('Pagination offset.'),
29
+ }),
30
+ output: z.object({}).passthrough().describe('Congressional Record data from Congress.gov API.'),
31
+ format: formatResult,
32
+ async handler(input, ctx) {
33
+ const api = getCongressApi();
34
+ if (input.operation === 'list') {
35
+ const result = await api.listDailyRecord({ limit: input.limit, offset: input.offset });
36
+ ctx.log.info('Daily record listed');
37
+ return result;
38
+ }
39
+ if (!input.volumeNumber) {
40
+ throw new Error(`The '${input.operation}' operation requires volumeNumber. Use 'list' to browse available Congressional Record volumes.`);
41
+ }
42
+ if (input.operation === 'issues') {
43
+ const result = await api.getDailyIssues({
44
+ volumeNumber: input.volumeNumber,
45
+ limit: input.limit,
46
+ offset: input.offset,
47
+ });
48
+ ctx.log.info('Daily record issues retrieved', { volumeNumber: input.volumeNumber });
49
+ return result;
50
+ }
51
+ if (!input.issueNumber) {
52
+ throw new Error("The 'articles' operation requires both volumeNumber and issueNumber. Use 'issues' to see available issues within a volume.");
53
+ }
54
+ const result = await api.getDailyArticles({
55
+ volumeNumber: input.volumeNumber,
56
+ issueNumber: input.issueNumber,
57
+ limit: input.limit,
58
+ offset: input.offset,
59
+ });
60
+ ctx.log.info('Daily record articles retrieved', {
61
+ volumeNumber: input.volumeNumber,
62
+ issueNumber: input.issueNumber,
63
+ });
64
+ return result;
65
+ },
66
+ });
67
+ //# sourceMappingURL=daily-record.tool.js.map
@@ -0,0 +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,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AG,CAAC,IAAI,CAAC,iCAAiC,EAAE;YAC9C,YAAY,EAAE,KAAK,CAAC,YAAY;YAChC,WAAW,EAAE,KAAK,CAAC,WAAW;SAC/B,CAAC,CAAC;QACH,OAAO,MAAM,CAAC;IAChB,CAAC;CACF,CAAC,CAAC"}
@@ -0,0 +1,20 @@
1
+ /**
2
+ * @fileoverview Tool for browsing enacted public and private laws from Congress.gov.
3
+ * @module mcp-server/tools/definitions/enacted-laws
4
+ */
5
+ import { z } from '@cyanheads/mcp-ts-core';
6
+ export declare const enactedLawsTool: import("@cyanheads/mcp-ts-core").ToolDefinition<z.ZodObject<{
7
+ operation: z.ZodEnum<{
8
+ get: "get";
9
+ list: "list";
10
+ }>;
11
+ congress: z.ZodNumber;
12
+ lawType: z.ZodOptional<z.ZodEnum<{
13
+ pub: "pub";
14
+ priv: "priv";
15
+ }>>;
16
+ lawNumber: z.ZodOptional<z.ZodNumber>;
17
+ limit: z.ZodDefault<z.ZodNumber>;
18
+ offset: z.ZodDefault<z.ZodNumber>;
19
+ }, z.core.$strip>, z.ZodObject<{}, z.core.$loose>>;
20
+ //# sourceMappingURL=enacted-laws.tool.d.ts.map
@@ -0,0 +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;AAKjD,eAAO,MAAM,eAAe;;;;;;;;;;;;;kDAkD1B,CAAC"}
@@ -0,0 +1,55 @@
1
+ /**
2
+ * @fileoverview Tool for browsing enacted public and private laws from Congress.gov.
3
+ * @module mcp-server/tools/definitions/enacted-laws
4
+ */
5
+ import { tool, z } from '@cyanheads/mcp-ts-core';
6
+ import { formatResult } from '../../../mcp-server/tools/format-helpers.js';
7
+ import { getCongressApi } from '../../../services/congress-api/congress-api-service.js';
8
+ export const enactedLawsTool = tool('congressgov_enacted_laws', {
9
+ description: `Browse enacted public and private laws from Congress.gov.
10
+
11
+ Use 'list' to browse laws by congress. Each law references its origin bill — use 'congressgov_bill_lookup' with that reference for the full legislative history.
12
+
13
+ Law types:
14
+ - pub: Public laws (general application, most common)
15
+ - priv: Private laws (specific individuals or entities)`,
16
+ annotations: { readOnlyHint: true, idempotentHint: true, openWorldHint: true },
17
+ input: z.object({
18
+ operation: z.enum(['list', 'get']).describe('Which data to retrieve.'),
19
+ congress: z.number().int().positive().describe('Congress number.'),
20
+ lawType: z.enum(['pub', 'priv']).optional().describe("Law type. Required for 'get'."),
21
+ lawNumber: z.number().int().positive().optional().describe("Law number. Required for 'get'."),
22
+ limit: z.number().int().min(1).max(250).default(20).describe('Results per page (1-250).'),
23
+ offset: z.number().int().min(0).default(0).describe('Pagination offset.'),
24
+ }),
25
+ output: z.object({}).passthrough().describe('Law data from Congress.gov API.'),
26
+ format: formatResult,
27
+ async handler(input, ctx) {
28
+ const api = getCongressApi();
29
+ if (input.operation === 'list') {
30
+ const result = await api.listLaws({
31
+ congress: input.congress,
32
+ lawType: input.lawType,
33
+ limit: input.limit,
34
+ offset: input.offset,
35
+ });
36
+ ctx.log.info('Laws listed', { congress: input.congress, count: result.data.length });
37
+ return result;
38
+ }
39
+ if (!input.lawType || !input.lawNumber) {
40
+ throw new Error("The 'get' operation requires lawType ('pub' or 'priv') and lawNumber.");
41
+ }
42
+ const result = await api.getLaw({
43
+ congress: input.congress,
44
+ lawType: input.lawType,
45
+ lawNumber: input.lawNumber,
46
+ });
47
+ ctx.log.info('Law retrieved', {
48
+ congress: input.congress,
49
+ lawType: input.lawType,
50
+ lawNumber: input.lawNumber,
51
+ });
52
+ return result;
53
+ },
54
+ });
55
+ //# sourceMappingURL=enacted-laws.tool.js.map
@@ -0,0 +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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B,CAAC;CACF,CAAC,CAAC"}
@@ -0,0 +1,21 @@
1
+ /**
2
+ * @fileoverview Tool for discovering congressional members and their legislative activity.
3
+ * @module mcp-server/tools/definitions/member-lookup
4
+ */
5
+ import { z } from '@cyanheads/mcp-ts-core';
6
+ export declare const memberLookupTool: import("@cyanheads/mcp-ts-core").ToolDefinition<z.ZodObject<{
7
+ operation: z.ZodEnum<{
8
+ get: "get";
9
+ list: "list";
10
+ sponsored: "sponsored";
11
+ cosponsored: "cosponsored";
12
+ }>;
13
+ bioguideId: z.ZodOptional<z.ZodString>;
14
+ congress: z.ZodOptional<z.ZodNumber>;
15
+ stateCode: z.ZodOptional<z.ZodString>;
16
+ district: z.ZodOptional<z.ZodNumber>;
17
+ currentMember: z.ZodOptional<z.ZodBoolean>;
18
+ limit: z.ZodDefault<z.ZodNumber>;
19
+ offset: z.ZodDefault<z.ZodNumber>;
20
+ }, z.core.$strip>, z.ZodObject<{}, z.core.$loose>>;
21
+ //# sourceMappingURL=member-lookup.tool.d.ts.map
@@ -0,0 +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;AAKjD,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;kDAyF3B,CAAC"}
@@ -0,0 +1,86 @@
1
+ /**
2
+ * @fileoverview Tool for discovering congressional members and their legislative activity.
3
+ * @module mcp-server/tools/definitions/member-lookup
4
+ */
5
+ import { tool, z } from '@cyanheads/mcp-ts-core';
6
+ import { formatResult } from '../../../mcp-server/tools/format-helpers.js';
7
+ import { getCongressApi } from '../../../services/congress-api/congress-api-service.js';
8
+ export const memberLookupTool = tool('congressgov_member_lookup', {
9
+ description: `Discover congressional members and their legislative activity.
10
+
11
+ The API does not support name search. To find a member:
12
+ - By location: use 'list' with stateCode (and optionally district)
13
+ - By congress: use 'list' with congress number
14
+ - By current status: use 'list' with currentMember=true
15
+
16
+ Once you have a bioguideId, use 'get' for full profile or 'sponsored'/'cosponsored' for legislative portfolio. The bioguideId also works with the congress://member/{bioguideId} resource.`,
17
+ annotations: { readOnlyHint: true, idempotentHint: true, openWorldHint: true },
18
+ input: z.object({
19
+ operation: z
20
+ .enum(['list', 'get', 'sponsored', 'cosponsored'])
21
+ .describe('Which data to retrieve.'),
22
+ bioguideId: z
23
+ .string()
24
+ .optional()
25
+ .describe("Unique member identifier (e.g., 'P000197'). Required for get/sponsored/cosponsored."),
26
+ congress: z.number().int().positive().optional().describe('Congress number to filter by.'),
27
+ stateCode: z
28
+ .string()
29
+ .length(2)
30
+ .optional()
31
+ .describe("Two-letter state code (e.g., 'CA', 'TX')."),
32
+ district: z
33
+ .number()
34
+ .int()
35
+ .min(0)
36
+ .optional()
37
+ .describe('Congressional district number. Requires stateCode. Use 0 for at-large.'),
38
+ currentMember: z
39
+ .boolean()
40
+ .optional()
41
+ .describe('Filter to currently serving members. Defaults to false.'),
42
+ limit: z.number().int().min(1).max(250).default(20).describe('Results per page (1-250).'),
43
+ offset: z.number().int().min(0).default(0).describe('Pagination offset.'),
44
+ }),
45
+ output: z.object({}).passthrough().describe('Member data from Congress.gov API.'),
46
+ format: formatResult,
47
+ async handler(input, ctx) {
48
+ const api = getCongressApi();
49
+ if (input.operation === 'list') {
50
+ if (input.district !== undefined && !input.stateCode) {
51
+ throw new Error("The 'district' parameter requires 'stateCode'. Provide both to look up a specific House representative.");
52
+ }
53
+ const result = await api.listMembers({
54
+ congress: input.congress,
55
+ stateCode: input.stateCode,
56
+ district: input.district,
57
+ currentMember: input.currentMember,
58
+ limit: input.limit,
59
+ offset: input.offset,
60
+ });
61
+ ctx.log.info('Members listed', { count: result.data.length });
62
+ return result;
63
+ }
64
+ if (!input.bioguideId) {
65
+ throw new Error(`The '${input.operation}' operation requires bioguideId. Use 'list' with stateCode or congress to discover members.`);
66
+ }
67
+ if (input.operation === 'get') {
68
+ const result = await api.getMember(input.bioguideId);
69
+ ctx.log.info('Member retrieved', { bioguideId: input.bioguideId });
70
+ return result;
71
+ }
72
+ const type = input.operation === 'sponsored' ? 'sponsored-legislation' : 'cosponsored-legislation';
73
+ const result = await api.getMemberLegislation({
74
+ bioguideId: input.bioguideId,
75
+ type,
76
+ limit: input.limit,
77
+ offset: input.offset,
78
+ });
79
+ ctx.log.info('Member legislation retrieved', {
80
+ bioguideId: input.bioguideId,
81
+ type: input.operation,
82
+ });
83
+ return result;
84
+ },
85
+ });
86
+ //# sourceMappingURL=member-lookup.tool.js.map
@@ -0,0 +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;AAEjD,OAAO,EAAE,YAAY,EAAE,MAAM,sCAAsC,CAAC;AACpE,OAAO,EAAE,cAAc,EAAE,MAAM,iDAAiD,CAAC;AAEjF,MAAM,CAAC,MAAM,gBAAgB,GAAG,IAAI,CAAC,2BAA2B,EAAE;IAChE,WAAW,EAAE;;;;;;;2LAO4K;IACzL,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,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K,CAAC,SAAS;SACtB,CAAC,CAAC;QACH,OAAO,MAAM,CAAC;IAChB,CAAC;CACF,CAAC,CAAC"}
@@ -0,0 +1,18 @@
1
+ /**
2
+ * @fileoverview Tool for retrieving House roll call vote data and member voting positions.
3
+ * @module mcp-server/tools/definitions/roll-votes
4
+ */
5
+ import { z } from '@cyanheads/mcp-ts-core';
6
+ export declare const rollVotesTool: import("@cyanheads/mcp-ts-core").ToolDefinition<z.ZodObject<{
7
+ operation: z.ZodEnum<{
8
+ members: "members";
9
+ get: "get";
10
+ list: "list";
11
+ }>;
12
+ congress: z.ZodNumber;
13
+ session: z.ZodNumber;
14
+ voteNumber: z.ZodOptional<z.ZodNumber>;
15
+ limit: z.ZodDefault<z.ZodNumber>;
16
+ offset: z.ZodDefault<z.ZodNumber>;
17
+ }, z.core.$strip>, z.ZodObject<{}, z.core.$loose>>;
18
+ //# sourceMappingURL=roll-votes.tool.d.ts.map
@@ -0,0 +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;AAEH,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;AAKjD,eAAO,MAAM,aAAa;;;;;;;;;;;kDAgExB,CAAC"}
@@ -0,0 +1,65 @@
1
+ /**
2
+ * @fileoverview Tool for retrieving House roll call vote data and member voting positions.
3
+ * @module mcp-server/tools/definitions/roll-votes
4
+ */
5
+ import { tool, z } from '@cyanheads/mcp-ts-core';
6
+ import { formatResult } from '../../../mcp-server/tools/format-helpers.js';
7
+ import { getCongressApi } from '../../../services/congress-api/congress-api-service.js';
8
+ export const rollVotesTool = tool('congressgov_roll_votes', {
9
+ description: `Retrieve House roll call vote data and individual member voting positions.
10
+
11
+ NOTE: Covers House votes only — Senate vote data is not yet in the Congress.gov API.
12
+
13
+ Use 'list' to find votes by congress and session, 'get' for vote details (question, result, associated bill), and 'members' for how each representative voted.`,
14
+ annotations: { readOnlyHint: true, idempotentHint: true, openWorldHint: true },
15
+ input: z.object({
16
+ operation: z.enum(['list', 'get', 'members']).describe('Which data to retrieve.'),
17
+ congress: z.number().int().positive().describe('Congress number.'),
18
+ session: z
19
+ .number()
20
+ .int()
21
+ .min(1)
22
+ .max(2)
23
+ .describe('Session number (1 or 2). Odd years are session 1, even years session 2.'),
24
+ voteNumber: z
25
+ .number()
26
+ .int()
27
+ .positive()
28
+ .optional()
29
+ .describe("Roll call vote number. Required for 'get' and 'members'."),
30
+ limit: z.number().int().min(1).max(250).default(20).describe('Results per page (1-250).'),
31
+ offset: z.number().int().min(0).default(0).describe('Pagination offset.'),
32
+ }),
33
+ output: z.object({}).passthrough().describe('Vote data from Congress.gov API.'),
34
+ format: formatResult,
35
+ async handler(input, ctx) {
36
+ const api = getCongressApi();
37
+ if (input.operation === 'list') {
38
+ const result = await api.listVotes({
39
+ congress: input.congress,
40
+ session: input.session,
41
+ limit: input.limit,
42
+ offset: input.offset,
43
+ });
44
+ ctx.log.info('Votes listed', { congress: input.congress, session: input.session });
45
+ return result;
46
+ }
47
+ if (!input.voteNumber) {
48
+ throw new Error(`The '${input.operation}' operation requires voteNumber. Use 'list' to browse available votes.`);
49
+ }
50
+ const voteParams = {
51
+ congress: input.congress,
52
+ session: input.session,
53
+ voteNumber: input.voteNumber,
54
+ };
55
+ const result = input.operation === 'members'
56
+ ? await api.getVoteMembers(voteParams)
57
+ : await api.getVote(voteParams);
58
+ ctx.log.info('Vote retrieved', {
59
+ ...voteParams,
60
+ operation: input.operation,
61
+ });
62
+ return result;
63
+ },
64
+ });
65
+ //# sourceMappingURL=roll-votes.tool.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"roll-votes.tool.js","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/roll-votes.tool.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,wBAAwB,CAAC;AAEjD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CAAC;QACH,OAAO,MAAM,CAAC;IAChB,CAAC;CACF,CAAC,CAAC"}
@@ -0,0 +1,21 @@
1
+ /**
2
+ * @fileoverview Tool for browsing presidential nominations and the Senate confirmation pipeline.
3
+ * @module mcp-server/tools/definitions/senate-nominations
4
+ */
5
+ import { z } from '@cyanheads/mcp-ts-core';
6
+ export declare const senateNominationsTool: import("@cyanheads/mcp-ts-core").ToolDefinition<z.ZodObject<{
7
+ operation: z.ZodEnum<{
8
+ actions: "actions";
9
+ committees: "committees";
10
+ hearings: "hearings";
11
+ nominees: "nominees";
12
+ get: "get";
13
+ list: "list";
14
+ }>;
15
+ congress: z.ZodNumber;
16
+ nominationNumber: z.ZodOptional<z.ZodString>;
17
+ ordinal: z.ZodOptional<z.ZodNumber>;
18
+ limit: z.ZodDefault<z.ZodNumber>;
19
+ offset: z.ZodDefault<z.ZodNumber>;
20
+ }, z.core.$strip>, z.ZodObject<{}, z.core.$loose>>;
21
+ //# sourceMappingURL=senate-nominations.tool.d.ts.map
@@ -0,0 +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;AAKjD,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;kDA2FhC,CAAC"}
@@ -0,0 +1,90 @@
1
+ /**
2
+ * @fileoverview Tool for browsing presidential nominations and the Senate confirmation pipeline.
3
+ * @module mcp-server/tools/definitions/senate-nominations
4
+ */
5
+ import { tool, z } from '@cyanheads/mcp-ts-core';
6
+ import { formatResult } from '../../../mcp-server/tools/format-helpers.js';
7
+ import { getCongressApi } from '../../../services/congress-api/congress-api-service.js';
8
+ export const senateNominationsTool = tool('congressgov_senate_nominations', {
9
+ description: `Browse presidential nominations to federal positions and track the Senate confirmation process.
10
+
11
+ Nominations use 'PN' (Presidential Nomination) numbering. A single nomination may contain multiple nominees — use 'nominees' to see individual appointees.
12
+
13
+ Partitioned nominations (e.g., PN230-1, PN230-2) occur when nominees within one nomination follow different confirmation paths.`,
14
+ annotations: { readOnlyHint: true, idempotentHint: true, openWorldHint: true },
15
+ input: z.object({
16
+ operation: z
17
+ .enum(['list', 'get', 'nominees', 'actions', 'committees', 'hearings'])
18
+ .describe('Which data to retrieve.'),
19
+ congress: z.number().int().positive().describe('Congress number.'),
20
+ nominationNumber: z
21
+ .string()
22
+ .optional()
23
+ .describe("Nomination number (e.g., '1064'). Required for detail operations."),
24
+ ordinal: z
25
+ .number()
26
+ .int()
27
+ .positive()
28
+ .optional()
29
+ .describe('Position ordinal within a nomination (for multi-nominee nominations).'),
30
+ limit: z.number().int().min(1).max(250).default(20).describe('Results per page (1-250).'),
31
+ offset: z.number().int().min(0).default(0).describe('Pagination offset.'),
32
+ }),
33
+ output: z.object({}).passthrough().describe('Nomination data from Congress.gov API.'),
34
+ format: formatResult,
35
+ async handler(input, ctx) {
36
+ const api = getCongressApi();
37
+ if (input.operation === 'list') {
38
+ const result = await api.listNominations({
39
+ congress: input.congress,
40
+ limit: input.limit,
41
+ offset: input.offset,
42
+ });
43
+ ctx.log.info('Nominations listed', {
44
+ congress: input.congress,
45
+ count: result.data.length,
46
+ });
47
+ return result;
48
+ }
49
+ if (!input.nominationNumber) {
50
+ throw new Error(`The '${input.operation}' operation requires nominationNumber. Use 'list' to browse nominations.`);
51
+ }
52
+ if (input.operation === 'get') {
53
+ const result = await api.getNomination(input.congress, input.nominationNumber);
54
+ ctx.log.info('Nomination retrieved', {
55
+ congress: input.congress,
56
+ nominationNumber: input.nominationNumber,
57
+ });
58
+ return result;
59
+ }
60
+ if (input.operation === 'nominees') {
61
+ if (!input.ordinal) {
62
+ throw new Error("The 'nominees' operation requires 'ordinal' — the position number within the nomination. Use 'get' first to see available ordinals in the nominees array.");
63
+ }
64
+ const result = await api.getNominee(input.congress, input.nominationNumber, input.ordinal, {
65
+ limit: input.limit,
66
+ offset: input.offset,
67
+ });
68
+ ctx.log.info('Nominee retrieved', {
69
+ congress: input.congress,
70
+ nominationNumber: input.nominationNumber,
71
+ ordinal: input.ordinal,
72
+ });
73
+ return result;
74
+ }
75
+ const result = await api.getNominationSubResource({
76
+ congress: input.congress,
77
+ nominationNumber: input.nominationNumber,
78
+ subResource: input.operation,
79
+ limit: input.limit,
80
+ offset: input.offset,
81
+ });
82
+ ctx.log.info('Nomination sub-resource retrieved', {
83
+ congress: input.congress,
84
+ nominationNumber: input.nominationNumber,
85
+ subResource: input.operation,
86
+ });
87
+ return result;
88
+ },
89
+ });
90
+ //# sourceMappingURL=senate-nominations.tool.js.map
@@ -0,0 +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;AAEjD,OAAO,EAAE,YAAY,EAAE,MAAM,sCAAsC,CAAC;AACpE,OAAO,EAAE,cAAc,EAAE,MAAM,iDAAiD,CAAC;AAEjF,MAAM,CAAC,MAAM,qBAAqB,GAAG,IAAI,CAAC,gCAAgC,EAAE;IAC1E,WAAW,EAAE;;;;gIAIiH;IAC9H,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,UAAU,EAAE,SAAS,EAAE,YAAY,EAAE,UAAU,CAAC,CAAC;aACtE,QAAQ,CAAC,yBAAyB,CAAC;QACtC,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,kBAAkB,CAAC;QAClE,gBAAgB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;YACxC,WAAW,EAAE,KAAK,CAAC,SAAS;YAC5B,KAAK,EAAE,KAAK,CAAC,KAAK;YAClB,MAAM,EAAE,KAAK,CAAC,MAAM;SACrB,CAAC,CAAC;QACH,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,mCAAmC,EAAE;YAChD,QAAQ,EAAE,KAAK,CAAC,QAAQ;YACxB,gBAAgB,EAAE,KAAK,CAAC,gBAAgB;YACxC,WAAW,EAAE,KAAK,CAAC,SAAS;SAC7B,CAAC,CAAC;QACH,OAAO,MAAM,CAAC;IAChB,CAAC;CACF,CAAC,CAAC"}
@@ -0,0 +1,12 @@
1
+ /**
2
+ * @fileoverview Shared formatting for tool output — lists, details, HTML stripping.
3
+ * @module mcp-server/tools/format-helpers
4
+ */
5
+ type TextBlock = {
6
+ type: 'text';
7
+ text: string;
8
+ };
9
+ /** Format any tool result into readable text content blocks. */
10
+ export declare function formatResult(result: Record<string, unknown>): TextBlock[];
11
+ export {};
12
+ //# sourceMappingURL=format-helpers.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"format-helpers.d.ts","sourceRoot":"","sources":["../../../src/mcp-server/tools/format-helpers.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,KAAK,SAAS,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC;AAEhD,gEAAgE;AAChE,wBAAgB,YAAY,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,EAAE,CAEzE"}