@cyanheads/congressgov-mcp-server 0.3.21 → 0.3.23
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 +13 -5
- package/CLAUDE.md +13 -5
- package/README.md +2 -2
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/mcp-server/tools/definitions/bill-lookup.tool.d.ts +5 -2
- package/dist/mcp-server/tools/definitions/bill-lookup.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/bill-lookup.tool.js +19 -14
- package/dist/mcp-server/tools/definitions/bill-lookup.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/bill-summaries.tool.d.ts +5 -2
- package/dist/mcp-server/tools/definitions/bill-summaries.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/bill-summaries.tool.js +12 -10
- package/dist/mcp-server/tools/definitions/bill-summaries.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/committee-lookup.tool.d.ts +5 -2
- package/dist/mcp-server/tools/definitions/committee-lookup.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/committee-lookup.tool.js +20 -13
- package/dist/mcp-server/tools/definitions/committee-lookup.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/committee-reports.tool.d.ts +5 -2
- package/dist/mcp-server/tools/definitions/committee-reports.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/committee-reports.tool.js +14 -8
- package/dist/mcp-server/tools/definitions/committee-reports.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/crs-reports.tool.d.ts +5 -2
- package/dist/mcp-server/tools/definitions/crs-reports.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/crs-reports.tool.js +9 -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 +5 -2
- package/dist/mcp-server/tools/definitions/daily-record.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/daily-record.tool.js +17 -10
- package/dist/mcp-server/tools/definitions/daily-record.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/enacted-laws.tool.d.ts +5 -2
- package/dist/mcp-server/tools/definitions/enacted-laws.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/enacted-laws.tool.js +9 -8
- package/dist/mcp-server/tools/definitions/enacted-laws.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/member-lookup.tool.d.ts +5 -2
- package/dist/mcp-server/tools/definitions/member-lookup.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/member-lookup.tool.js +19 -14
- package/dist/mcp-server/tools/definitions/member-lookup.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/roll-votes.tool.d.ts +5 -2
- package/dist/mcp-server/tools/definitions/roll-votes.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/roll-votes.tool.js +27 -8
- package/dist/mcp-server/tools/definitions/roll-votes.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/senate-nominations.tool.d.ts +5 -2
- package/dist/mcp-server/tools/definitions/senate-nominations.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/senate-nominations.tool.js +21 -15
- package/dist/mcp-server/tools/definitions/senate-nominations.tool.js.map +1 -1
- package/dist/mcp-server/tools/format-helpers.d.ts +0 -1
- package/dist/mcp-server/tools/format-helpers.d.ts.map +1 -1
- package/dist/mcp-server/tools/format-helpers.js +16 -27
- package/dist/mcp-server/tools/format-helpers.js.map +1 -1
- package/dist/mcp-server/tools/tool-helpers.d.ts +24 -6
- package/dist/mcp-server/tools/tool-helpers.d.ts.map +1 -1
- package/dist/mcp-server/tools/tool-helpers.js +27 -12
- package/dist/mcp-server/tools/tool-helpers.js.map +1 -1
- package/package.json +9 -5
- package/server.json +3 -3
|
@@ -17,6 +17,9 @@ export declare const crsReportsTool: import("@cyanheads/mcp-ts-core").ToolDefini
|
|
|
17
17
|
count: z.ZodNumber;
|
|
18
18
|
nextOffset: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
19
19
|
}, z.core.$strip>>;
|
|
20
|
-
|
|
21
|
-
|
|
20
|
+
}, z.core.$loose>, undefined, {
|
|
21
|
+
effectiveQuery: z.ZodString;
|
|
22
|
+
totalCount: z.ZodNumber;
|
|
23
|
+
notice: z.ZodOptional<z.ZodString>;
|
|
24
|
+
}>;
|
|
22
25
|
//# 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;AAOjD,eAAO,MAAM,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;;;;;;;;;;;;;;;;;;EA6CzB,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 { formatCrsReports } from '../../../mcp-server/tools/format-helpers.js';
|
|
8
|
-
import {
|
|
8
|
+
import { listEnrichment, listOrDetail } from '../../../mcp-server/tools/tool-helpers.js';
|
|
9
9
|
import { getCongressApi } from '../../../services/congress-api/congress-api-service.js';
|
|
10
10
|
export const crsReportsTool = tool('congressgov_crs_reports', {
|
|
11
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).`,
|
|
@@ -20,19 +20,26 @@ export const crsReportsTool = tool('congressgov_crs_reports', {
|
|
|
20
20
|
offset: z.number().int().min(0).default(0).describe('Pagination offset.'),
|
|
21
21
|
}),
|
|
22
22
|
output: listOrDetail('report', 'CRS report record for `get` (authors, topics, summary, formats, related materials); absent for `list`.'),
|
|
23
|
+
enrichment: listEnrichment,
|
|
23
24
|
format: formatCrsReports,
|
|
24
25
|
async handler(input, ctx) {
|
|
25
26
|
const api = getCongressApi();
|
|
26
27
|
if (input.operation === 'list') {
|
|
27
28
|
const result = await api.listCrsReports({ limit: input.limit, offset: input.offset }, ctx);
|
|
28
29
|
ctx.log.info('CRS reports listed', { count: result.data.length });
|
|
29
|
-
|
|
30
|
+
ctx.enrich.echo('CRS reports');
|
|
31
|
+
ctx.enrich.total(result.pagination.count);
|
|
32
|
+
if (result.data.length === 0)
|
|
33
|
+
ctx.enrich.notice('No CRS reports found. The endpoint may be temporarily unavailable.');
|
|
34
|
+
return result;
|
|
30
35
|
}
|
|
31
36
|
if (!input.reportNumber) {
|
|
32
37
|
throw validationError("The 'get' operation requires reportNumber. Report IDs use letter-number codes (e.g., R40097). Use 'list' to browse available reports.", { field: 'reportNumber' });
|
|
33
38
|
}
|
|
34
39
|
const result = await api.getCrsReport({ reportNumber: input.reportNumber }, ctx);
|
|
35
40
|
ctx.log.info('CRS report retrieved', { reportNumber: input.reportNumber });
|
|
41
|
+
ctx.enrich.echo(`CRS report ${input.reportNumber}`);
|
|
42
|
+
ctx.enrich.total(1);
|
|
36
43
|
return result;
|
|
37
44
|
},
|
|
38
45
|
});
|
|
@@ -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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,GAAG,MAAM,GAAG,CAAC,YAAY,CAAC,EAAE,YAAY,EAAE,KAAK,CAAC,YAAY,EAAE,EAAE,GAAG,CAAC,CAAC;QACjF,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,sBAAsB,EAAE,EAAE,YAAY,EAAE,KAAK,CAAC,YAAY,EAAE,CAAC,CAAC;QAC3E,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,cAAc,KAAK,CAAC,YAAY,EAAE,CAAC,CAAC;QACpD,GAAG,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;QACpB,OAAO,MAAM,CAAC;IAChB,CAAC;CACF,CAAC,CAAC"}
|
|
@@ -19,6 +19,9 @@ export declare const dailyRecordTool: import("@cyanheads/mcp-ts-core").ToolDefin
|
|
|
19
19
|
count: z.ZodNumber;
|
|
20
20
|
nextOffset: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
21
21
|
}, z.core.$strip>;
|
|
22
|
-
|
|
23
|
-
|
|
22
|
+
}, z.core.$loose>, undefined, {
|
|
23
|
+
effectiveQuery: z.ZodString;
|
|
24
|
+
totalCount: z.ZodNumber;
|
|
25
|
+
notice: z.ZodOptional<z.ZodString>;
|
|
26
|
+
}>;
|
|
24
27
|
//# 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;AAOjD,eAAO,MAAM,eAAe
|
|
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;;;;;;;;;;;;;;;;;;;;EAwF1B,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 { formatDailyRecord } from '../../../mcp-server/tools/format-helpers.js';
|
|
8
|
-
import {
|
|
8
|
+
import { listEnrichment, listOutput } from '../../../mcp-server/tools/tool-helpers.js';
|
|
9
9
|
import { getCongressApi } from '../../../services/congress-api/congress-api-service.js';
|
|
10
10
|
export const dailyRecordTool = tool('congressgov_daily_record', {
|
|
11
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.`,
|
|
@@ -28,13 +28,18 @@ export const dailyRecordTool = tool('congressgov_daily_record', {
|
|
|
28
28
|
offset: z.number().int().min(0).default(0).describe('Pagination offset.'),
|
|
29
29
|
}),
|
|
30
30
|
output: listOutput,
|
|
31
|
+
enrichment: listEnrichment,
|
|
31
32
|
format: formatDailyRecord,
|
|
32
33
|
async handler(input, ctx) {
|
|
33
34
|
const api = getCongressApi();
|
|
34
35
|
if (input.operation === 'list') {
|
|
35
36
|
const result = await api.listDailyRecord({ limit: input.limit, offset: input.offset }, ctx);
|
|
36
37
|
ctx.log.info('Daily record listed');
|
|
37
|
-
|
|
38
|
+
ctx.enrich.echo('Congressional Record volumes');
|
|
39
|
+
ctx.enrich.total(result.pagination.count);
|
|
40
|
+
if (result.data.length === 0)
|
|
41
|
+
ctx.enrich.notice('No Congressional Record volumes found.');
|
|
42
|
+
return result;
|
|
38
43
|
}
|
|
39
44
|
if (!input.volumeNumber) {
|
|
40
45
|
throw validationError(`The '${input.operation}' operation requires volumeNumber. Use 'list' to browse available Congressional Record volumes.`, { field: 'volumeNumber', operation: input.operation });
|
|
@@ -46,10 +51,11 @@ export const dailyRecordTool = tool('congressgov_daily_record', {
|
|
|
46
51
|
offset: input.offset,
|
|
47
52
|
}, ctx);
|
|
48
53
|
ctx.log.info('Daily record issues retrieved', { volumeNumber: input.volumeNumber });
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
54
|
+
ctx.enrich.echo(`issues for volume ${input.volumeNumber}`);
|
|
55
|
+
ctx.enrich.total(result.pagination.count);
|
|
56
|
+
if (result.data.length === 0)
|
|
57
|
+
ctx.enrich.notice(`No issues found for volume ${input.volumeNumber}.`);
|
|
58
|
+
return result;
|
|
53
59
|
}
|
|
54
60
|
if (!input.issueNumber) {
|
|
55
61
|
throw validationError("The 'articles' operation requires both volumeNumber and issueNumber. Use 'issues' to see available issues within a volume.", { field: 'issueNumber' });
|
|
@@ -64,10 +70,11 @@ export const dailyRecordTool = tool('congressgov_daily_record', {
|
|
|
64
70
|
volumeNumber: input.volumeNumber,
|
|
65
71
|
issueNumber: input.issueNumber,
|
|
66
72
|
});
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
73
|
+
ctx.enrich.echo(`articles for volume ${input.volumeNumber}, issue ${input.issueNumber}`);
|
|
74
|
+
ctx.enrich.total(result.pagination.count);
|
|
75
|
+
if (result.data.length === 0)
|
|
76
|
+
ctx.enrich.notice(`No articles found for volume ${input.volumeNumber}, issue ${input.issueNumber}.`);
|
|
77
|
+
return result;
|
|
71
78
|
},
|
|
72
79
|
});
|
|
73
80
|
//# 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,iB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AAC,GAAG,CAAC,IAAI,CAAC,iCAAiC,EAAE;YAC9C,YAAY,EAAE,KAAK,CAAC,YAAY;YAChC,WAAW,EAAE,KAAK,CAAC,WAAW;SAC/B,CAAC,CAAC;QACH,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,uBAAuB,KAAK,CAAC,YAAY,WAAW,KAAK,CAAC,WAAW,EAAE,CAAC,CAAC;QACzF,GAAG,CAAC,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC;QAC1C,IAAI,MAAM,CAAC,IAAI,CAAC,MAAM,KAAK,CAAC;YAC1B,GAAG,CAAC,MAAM,CAAC,MAAM,CACf,gCAAgC,KAAK,CAAC,YAAY,WAAW,KAAK,CAAC,WAAW,GAAG,CAClF,CAAC;QACJ,OAAO,MAAM,CAAC;IAChB,CAAC;CACF,CAAC,CAAC"}
|
|
@@ -22,6 +22,9 @@ export declare const enactedLawsTool: import("@cyanheads/mcp-ts-core").ToolDefin
|
|
|
22
22
|
count: z.ZodNumber;
|
|
23
23
|
nextOffset: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
24
24
|
}, z.core.$strip>>;
|
|
25
|
-
|
|
26
|
-
|
|
25
|
+
}, z.core.$loose>, undefined, {
|
|
26
|
+
effectiveQuery: z.ZodString;
|
|
27
|
+
totalCount: z.ZodNumber;
|
|
28
|
+
notice: z.ZodOptional<z.ZodString>;
|
|
29
|
+
}>;
|
|
27
30
|
//# 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;AAWjD,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;EA0E1B,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 { formatLaws } from '../../../mcp-server/tools/format-helpers.js';
|
|
8
|
-
import {
|
|
8
|
+
import { buildEffectiveQuery, listEnrichment, listOrDetail, } from '../../../mcp-server/tools/tool-helpers.js';
|
|
9
9
|
import { getCongressApi } from '../../../services/congress-api/congress-api-service.js';
|
|
10
10
|
export const enactedLawsTool = tool('congressgov_enacted_laws', {
|
|
11
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"}).`,
|
|
@@ -22,6 +22,7 @@ export const enactedLawsTool = tool('congressgov_enacted_laws', {
|
|
|
22
22
|
offset: z.number().int().min(0).default(0).describe('Pagination offset.'),
|
|
23
23
|
}),
|
|
24
24
|
output: listOrDetail('law', "Origin bill record for `get`; absent for `list`. The bill's `laws` array carries the law citation."),
|
|
25
|
+
enrichment: listEnrichment,
|
|
25
26
|
format: formatLaws,
|
|
26
27
|
async handler(input, ctx) {
|
|
27
28
|
const api = getCongressApi();
|
|
@@ -33,13 +34,11 @@ export const enactedLawsTool = tool('congressgov_enacted_laws', {
|
|
|
33
34
|
offset: input.offset,
|
|
34
35
|
}, ctx);
|
|
35
36
|
ctx.log.info('Laws listed', { congress: input.congress, count: result.data.length });
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
}),
|
|
42
|
-
};
|
|
37
|
+
ctx.enrich.echo(buildEffectiveQuery('enacted laws', { congress: input.congress, lawType: input.lawType }));
|
|
38
|
+
ctx.enrich.total(result.pagination.count);
|
|
39
|
+
if (result.data.length === 0)
|
|
40
|
+
ctx.enrich.notice('No laws matched the filters. Verify the congress number or try a different lawType.');
|
|
41
|
+
return result;
|
|
43
42
|
}
|
|
44
43
|
if (!input.lawType || !input.lawNumber) {
|
|
45
44
|
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 });
|
|
@@ -54,6 +53,8 @@ export const enactedLawsTool = tool('congressgov_enacted_laws', {
|
|
|
54
53
|
lawType: input.lawType,
|
|
55
54
|
lawNumber: input.lawNumber,
|
|
56
55
|
});
|
|
56
|
+
ctx.enrich.echo(`${input.lawType === 'pub' ? 'Public' : 'Private'} Law ${input.congress}-${input.lawNumber}`);
|
|
57
|
+
ctx.enrich.total(1);
|
|
57
58
|
return result;
|
|
58
59
|
},
|
|
59
60
|
});
|
|
@@ -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,
|
|
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,OA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AAC,SAAS,EAAE,CACvD,CAAC;QACJ,CAAC;QAED,MAAM,MAAM,GAAG,MAAM,GAAG,CAAC,MAAM,CAC7B;YACE,QAAQ,EAAE,KAAK,CAAC,QAAQ;YACxB,OAAO,EAAE,KAAK,CAAC,OAAO;YACtB,SAAS,EAAE,KAAK,CAAC,SAAS;SAC3B,EACD,GAAG,CACJ,CAAC;QACF,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,eAAe,EAAE;YAC5B,QAAQ,EAAE,KAAK,CAAC,QAAQ;YACxB,OAAO,EAAE,KAAK,CAAC,OAAO;YACtB,SAAS,EAAE,KAAK,CAAC,SAAS;SAC3B,CAAC,CAAC;QACH,GAAG,CAAC,MAAM,CAAC,IAAI,CACb,GAAG,KAAK,CAAC,OAAO,KAAK,KAAK,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,SAAS,QAAQ,KAAK,CAAC,QAAQ,IAAI,KAAK,CAAC,SAAS,EAAE,CAC7F,CAAC;QACF,GAAG,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;QACpB,OAAO,MAAM,CAAC;IAChB,CAAC;CACF,CAAC,CAAC"}
|
|
@@ -23,6 +23,9 @@ export declare const memberLookupTool: import("@cyanheads/mcp-ts-core").ToolDefi
|
|
|
23
23
|
count: z.ZodNumber;
|
|
24
24
|
nextOffset: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
25
25
|
}, z.core.$strip>>;
|
|
26
|
-
|
|
27
|
-
|
|
26
|
+
}, z.core.$loose>, undefined, {
|
|
27
|
+
effectiveQuery: z.ZodString;
|
|
28
|
+
totalCount: z.ZodNumber;
|
|
29
|
+
notice: z.ZodOptional<z.ZodString>;
|
|
30
|
+
}>;
|
|
28
31
|
//# 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;AAWjD,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;EAmH3B,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 { formatMembers } from '../../../mcp-server/tools/format-helpers.js';
|
|
8
|
-
import {
|
|
8
|
+
import { buildEffectiveQuery, listEnrichment, listOrDetail, } from '../../../mcp-server/tools/tool-helpers.js';
|
|
9
9
|
import { getCongressApi } from '../../../services/congress-api/congress-api-service.js';
|
|
10
10
|
export const memberLookupTool = tool('congressgov_member_lookup', {
|
|
11
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.`,
|
|
@@ -38,6 +38,7 @@ export const memberLookupTool = tool('congressgov_member_lookup', {
|
|
|
38
38
|
offset: z.number().int().min(0).default(0).describe('Pagination offset.'),
|
|
39
39
|
}),
|
|
40
40
|
output: listOrDetail('member', 'Member profile for `get` (name, state, terms, party history, leadership, legislation counts); absent for `list`, `sponsored`, `cosponsored`.'),
|
|
41
|
+
enrichment: listEnrichment,
|
|
41
42
|
format: formatMembers,
|
|
42
43
|
async handler(input, ctx) {
|
|
43
44
|
const api = getCongressApi();
|
|
@@ -54,15 +55,16 @@ export const memberLookupTool = tool('congressgov_member_lookup', {
|
|
|
54
55
|
offset: input.offset,
|
|
55
56
|
}, ctx);
|
|
56
57
|
ctx.log.info('Members listed', { count: result.data.length });
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
58
|
+
ctx.enrich.echo(buildEffectiveQuery('members', {
|
|
59
|
+
congress: input.congress,
|
|
60
|
+
stateCode: input.stateCode,
|
|
61
|
+
district: input.district,
|
|
62
|
+
currentMember: input.currentMember,
|
|
63
|
+
}));
|
|
64
|
+
ctx.enrich.total(result.pagination.count);
|
|
65
|
+
if (result.data.length === 0)
|
|
66
|
+
ctx.enrich.notice('No members matched the filters. Try removing stateCode or district, or check the congress number.');
|
|
67
|
+
return result;
|
|
66
68
|
}
|
|
67
69
|
if (!input.bioguideId) {
|
|
68
70
|
throw validationError(`The '${input.operation}' operation requires bioguideId. Use 'list' with stateCode or congress to discover members.`, { field: 'bioguideId', operation: input.operation });
|
|
@@ -70,6 +72,8 @@ export const memberLookupTool = tool('congressgov_member_lookup', {
|
|
|
70
72
|
if (input.operation === 'get') {
|
|
71
73
|
const result = await api.getMember(input.bioguideId, ctx);
|
|
72
74
|
ctx.log.info('Member retrieved', { bioguideId: input.bioguideId });
|
|
75
|
+
ctx.enrich.echo(`member ${input.bioguideId}`);
|
|
76
|
+
ctx.enrich.total(1);
|
|
73
77
|
return result;
|
|
74
78
|
}
|
|
75
79
|
const type = input.operation === 'sponsored' ? 'sponsored-legislation' : 'cosponsored-legislation';
|
|
@@ -83,10 +87,11 @@ export const memberLookupTool = tool('congressgov_member_lookup', {
|
|
|
83
87
|
bioguideId: input.bioguideId,
|
|
84
88
|
type: input.operation,
|
|
85
89
|
});
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
+
ctx.enrich.echo(`${input.operation} legislation for ${input.bioguideId}`);
|
|
91
|
+
ctx.enrich.total(result.pagination.count);
|
|
92
|
+
if (result.data.length === 0)
|
|
93
|
+
ctx.enrich.notice(`No ${input.operation} legislation found for member ${input.bioguideId}.`);
|
|
94
|
+
return result;
|
|
90
95
|
},
|
|
91
96
|
});
|
|
92
97
|
//# 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,
|
|
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,EACL,mBAAmB,EACnB,cAAc,EACd,YAAY,GACb,MAAM,oCAAoC,CAAC;AAC5C,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,CA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KAAK,CAAC;YAC1B,GAAG,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,KAAK,CAAC,SAAS,iCAAiC,KAAK,CAAC,UAAU,GAAG,CAAC,CAAC;QAC/F,OAAO,MAAM,CAAC;IAChB,CAAC;CACF,CAAC,CAAC"}
|
|
@@ -24,6 +24,9 @@ export declare const rollVotesTool: import("@cyanheads/mcp-ts-core").ToolDefinit
|
|
|
24
24
|
count: z.ZodNumber;
|
|
25
25
|
nextOffset: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
26
26
|
}, z.core.$strip>>;
|
|
27
|
-
|
|
28
|
-
|
|
27
|
+
}, z.core.$loose>, undefined, {
|
|
28
|
+
effectiveQuery: z.ZodString;
|
|
29
|
+
totalCount: z.ZodNumber;
|
|
30
|
+
notice: z.ZodOptional<z.ZodString>;
|
|
31
|
+
}>;
|
|
29
32
|
//# 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;AAGH,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;
|
|
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;AAWjD,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;EAyHxB,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 { formatVotes } from '../../../mcp-server/tools/format-helpers.js';
|
|
8
|
-
import {
|
|
8
|
+
import { buildEffectiveQuery, listEnrichment, listOrDetail, } from '../../../mcp-server/tools/tool-helpers.js';
|
|
9
9
|
import { getCongressApi } from '../../../services/congress-api/congress-api-service.js';
|
|
10
10
|
export const rollVotesTool = tool('congressgov_roll_votes', {
|
|
11
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.`,
|
|
@@ -33,11 +33,12 @@ export const rollVotesTool = tool('congressgov_roll_votes', {
|
|
|
33
33
|
offset: z.number().int().min(0).default(0).describe('Pagination offset.'),
|
|
34
34
|
}),
|
|
35
35
|
output: listOrDetail('vote', 'Vote record for `get` and `members` (question, result, party totals, member positions); absent for `list`.'),
|
|
36
|
+
enrichment: listEnrichment,
|
|
36
37
|
format: formatVotes,
|
|
37
38
|
async handler(input, ctx) {
|
|
38
39
|
const api = getCongressApi();
|
|
39
40
|
if (input.operation === 'list') {
|
|
40
|
-
const
|
|
41
|
+
const effectiveQuery = buildEffectiveQuery('roll call votes', {
|
|
41
42
|
congress: input.congress,
|
|
42
43
|
session: input.session,
|
|
43
44
|
});
|
|
@@ -48,7 +49,11 @@ export const rollVotesTool = tool('congressgov_roll_votes', {
|
|
|
48
49
|
limit: input.limit,
|
|
49
50
|
offset: input.offset,
|
|
50
51
|
}, ctx);
|
|
51
|
-
|
|
52
|
+
ctx.enrich.echo(effectiveQuery);
|
|
53
|
+
ctx.enrich.total(recent.pagination.count);
|
|
54
|
+
if (recent.data.length === 0)
|
|
55
|
+
ctx.enrich.notice('No votes found. Verify the congress and session numbers.');
|
|
56
|
+
return recent;
|
|
52
57
|
}
|
|
53
58
|
const result = await api.listVotes({
|
|
54
59
|
congress: input.congress,
|
|
@@ -57,7 +62,11 @@ export const rollVotesTool = tool('congressgov_roll_votes', {
|
|
|
57
62
|
offset: input.offset,
|
|
58
63
|
}, ctx);
|
|
59
64
|
ctx.log.info('Votes listed', { congress: input.congress, session: input.session });
|
|
60
|
-
|
|
65
|
+
ctx.enrich.echo(effectiveQuery);
|
|
66
|
+
ctx.enrich.total(result.pagination.count);
|
|
67
|
+
if (result.data.length === 0)
|
|
68
|
+
ctx.enrich.notice('No votes found. Verify the congress and session numbers.');
|
|
69
|
+
return result;
|
|
61
70
|
}
|
|
62
71
|
if (!input.voteNumber) {
|
|
63
72
|
throw validationError(`The '${input.operation}' operation requires voteNumber. Use 'list' to browse available votes.`, { field: 'voteNumber', operation: input.operation });
|
|
@@ -74,11 +83,21 @@ export const rollVotesTool = tool('congressgov_roll_votes', {
|
|
|
74
83
|
...voteParams,
|
|
75
84
|
operation: input.operation,
|
|
76
85
|
});
|
|
86
|
+
if (input.operation === 'get') {
|
|
87
|
+
ctx.enrich.echo(`roll call ${input.voteNumber} in the ${input.congress}th Congress, session ${input.session}`);
|
|
88
|
+
ctx.enrich.total(1);
|
|
89
|
+
return result;
|
|
90
|
+
}
|
|
77
91
|
if (input.operation === 'members') {
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
92
|
+
const membersResult = result;
|
|
93
|
+
ctx.enrich.echo(`member votes for roll ${input.voteNumber} in the ${input.congress}th Congress, session ${input.session}`);
|
|
94
|
+
ctx.enrich.total(membersResult.pagination?.count ?? 0);
|
|
95
|
+
const voteResults = Array.isArray(membersResult.vote?.results)
|
|
96
|
+
? membersResult.vote.results
|
|
97
|
+
: [];
|
|
98
|
+
if (voteResults.length === 0)
|
|
99
|
+
ctx.enrich.notice(`No member vote records found for roll ${input.voteNumber}.`);
|
|
100
|
+
return result;
|
|
82
101
|
}
|
|
83
102
|
return result;
|
|
84
103
|
},
|
|
@@ -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;AAGH,OAAO,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,wBAAwB,CAAC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AAE,EAAE,KAAK,EAAE,GAAG,CAAC,MAAM,EAAE,UAAU,EAAE,EAAE,CAAC;AAClF,CAAC"}
|
|
@@ -23,6 +23,9 @@ export declare const senateNominationsTool: import("@cyanheads/mcp-ts-core").Too
|
|
|
23
23
|
count: z.ZodNumber;
|
|
24
24
|
nextOffset: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
25
25
|
}, z.core.$strip>>;
|
|
26
|
-
|
|
27
|
-
|
|
26
|
+
}, z.core.$loose>, undefined, {
|
|
27
|
+
effectiveQuery: z.ZodString;
|
|
28
|
+
totalCount: z.ZodNumber;
|
|
29
|
+
notice: z.ZodOptional<z.ZodString>;
|
|
30
|
+
}>;
|
|
28
31
|
//# 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;
|
|
1
|
+
{"version":3,"file":"senate-nominations.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/senate-nominations.tool.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;AAUjD,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;EA2HhC,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 { formatNominations } from '../../../mcp-server/tools/format-helpers.js';
|
|
8
|
-
import {
|
|
8
|
+
import { buildEffectiveQuery, listEnrichment, listOrDetail, } from '../../../mcp-server/tools/tool-helpers.js';
|
|
9
9
|
import { getCongressApi } from '../../../services/congress-api/congress-api-service.js';
|
|
10
10
|
export const senateNominationsTool = tool('congressgov_senate_nominations', {
|
|
11
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.`,
|
|
@@ -29,6 +29,7 @@ export const senateNominationsTool = tool('congressgov_senate_nominations', {
|
|
|
29
29
|
offset: z.number().int().min(0).default(0).describe('Pagination offset.'),
|
|
30
30
|
}),
|
|
31
31
|
output: listOrDetail('nomination', 'Nomination record for `get` (description, dates, nominees array, sub-resource counts); absent for `list` and sub-resources.'),
|
|
32
|
+
enrichment: listEnrichment,
|
|
32
33
|
format: formatNominations,
|
|
33
34
|
async handler(input, ctx) {
|
|
34
35
|
const api = getCongressApi();
|
|
@@ -42,10 +43,11 @@ export const senateNominationsTool = tool('congressgov_senate_nominations', {
|
|
|
42
43
|
congress: input.congress,
|
|
43
44
|
count: result.data.length,
|
|
44
45
|
});
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
46
|
+
ctx.enrich.echo(buildEffectiveQuery('nominations', { congress: input.congress }));
|
|
47
|
+
ctx.enrich.total(result.pagination.count);
|
|
48
|
+
if (result.data.length === 0)
|
|
49
|
+
ctx.enrich.notice('No nominations found for this congress. Verify the congress number.');
|
|
50
|
+
return result;
|
|
49
51
|
}
|
|
50
52
|
if (!input.nominationNumber) {
|
|
51
53
|
throw validationError(`The '${input.operation}' operation requires nominationNumber. Use 'list' to browse nominations.`, { field: 'nominationNumber', operation: input.operation });
|
|
@@ -56,6 +58,8 @@ export const senateNominationsTool = tool('congressgov_senate_nominations', {
|
|
|
56
58
|
congress: input.congress,
|
|
57
59
|
nominationNumber: input.nominationNumber,
|
|
58
60
|
});
|
|
61
|
+
ctx.enrich.echo(`nomination PN${input.nominationNumber} in the ${input.congress}th Congress`);
|
|
62
|
+
ctx.enrich.total(1);
|
|
59
63
|
return result;
|
|
60
64
|
}
|
|
61
65
|
if (input.operation === 'nominees') {
|
|
@@ -71,7 +75,10 @@ export const senateNominationsTool = tool('congressgov_senate_nominations', {
|
|
|
71
75
|
nominationNumber: input.nominationNumber,
|
|
72
76
|
ordinal: input.ordinal,
|
|
73
77
|
});
|
|
74
|
-
|
|
78
|
+
ctx.enrich.echo(`nominees for nomination ${input.nominationNumber}, ordinal ${input.ordinal}`);
|
|
79
|
+
ctx.enrich.total(result.pagination.count);
|
|
80
|
+
applyParentFormNotice(ctx, result, input.nominationNumber);
|
|
81
|
+
return result;
|
|
75
82
|
}
|
|
76
83
|
const result = await api.getNominationSubResource({
|
|
77
84
|
congress: input.congress,
|
|
@@ -85,22 +92,21 @@ export const senateNominationsTool = tool('congressgov_senate_nominations', {
|
|
|
85
92
|
nominationNumber: input.nominationNumber,
|
|
86
93
|
subResource: input.operation,
|
|
87
94
|
});
|
|
88
|
-
|
|
95
|
+
ctx.enrich.echo(`${input.operation} for nomination ${input.nominationNumber}`);
|
|
96
|
+
ctx.enrich.total(result.pagination.count);
|
|
97
|
+
applyParentFormNotice(ctx, result, input.nominationNumber);
|
|
98
|
+
return result;
|
|
89
99
|
},
|
|
90
100
|
});
|
|
91
101
|
/**
|
|
92
102
|
* Sub-resource calls (actions/committees/hearings/nominees) against a bare
|
|
93
103
|
* parent number (e.g. '851') silently return 0 results when the nomination is
|
|
94
104
|
* a multi-part parent — those sub-resources live on the partitioned children.
|
|
95
|
-
*
|
|
96
|
-
* form.
|
|
105
|
+
* Emits an enrichment notice so agents know to try the partitioned form.
|
|
97
106
|
*/
|
|
98
|
-
function
|
|
107
|
+
function applyParentFormNotice(ctx, result, nominationNumber) {
|
|
99
108
|
if (result.data.length > 0 || nominationNumber.includes('-'))
|
|
100
|
-
return
|
|
101
|
-
|
|
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
|
-
};
|
|
109
|
+
return;
|
|
110
|
+
ctx.enrich.notice(`If \`${nominationNumber}\` is a multi-part parent, its actions/committees/hearings/nominees live on the partitioned children. Try \`${nominationNumber}-1\` (and -2, -3, …) instead.`);
|
|
105
111
|
}
|
|
106
112
|
//# sourceMappingURL=senate-nominations.tool.js.map
|