@cyanheads/congressgov-mcp-server 0.9.0 → 0.9.1
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 +25 -10
- package/CLAUDE.md +25 -10
- package/README.md +10 -5
- package/changelog/0.9.x/0.9.1.md +31 -0
- package/dist/config/server-config.d.ts +0 -7
- package/dist/config/server-config.d.ts.map +1 -1
- package/dist/config/server-config.js +1 -9
- package/dist/config/server-config.js.map +1 -1
- package/dist/mcp-server/tools/definitions/bill-lookup.tool.d.ts +9 -2
- package/dist/mcp-server/tools/definitions/bill-lookup.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/bill-summaries.tool.d.ts +9 -2
- package/dist/mcp-server/tools/definitions/bill-summaries.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/committee-lookup.tool.d.ts +9 -2
- package/dist/mcp-server/tools/definitions/committee-lookup.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/committee-reports.tool.d.ts +9 -2
- package/dist/mcp-server/tools/definitions/committee-reports.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/crs-reports.tool.d.ts +9 -2
- package/dist/mcp-server/tools/definitions/crs-reports.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/daily-record.tool.d.ts +9 -2
- package/dist/mcp-server/tools/definitions/daily-record.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/enacted-laws.tool.d.ts +9 -2
- package/dist/mcp-server/tools/definitions/enacted-laws.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/member-lookup.tool.d.ts +9 -2
- package/dist/mcp-server/tools/definitions/member-lookup.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/roll-votes.tool.d.ts +9 -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 +3 -2
- package/dist/mcp-server/tools/definitions/roll-votes.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/senate-nominations.tool.d.ts +49 -4
- package/dist/mcp-server/tools/definitions/senate-nominations.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/senate-nominations.tool.js +102 -5
- package/dist/mcp-server/tools/definitions/senate-nominations.tool.js.map +1 -1
- package/dist/mcp-server/tools/format-helpers.d.ts.map +1 -1
- package/dist/mcp-server/tools/format-helpers.js +37 -8
- package/dist/mcp-server/tools/format-helpers.js.map +1 -1
- package/dist/mcp-server/tools/tool-helpers.d.ts +11 -4
- package/dist/mcp-server/tools/tool-helpers.d.ts.map +1 -1
- package/dist/mcp-server/tools/tool-helpers.js +12 -4
- package/dist/mcp-server/tools/tool-helpers.js.map +1 -1
- package/dist/services/call-budget.d.ts +77 -0
- package/dist/services/call-budget.d.ts.map +1 -0
- package/dist/services/call-budget.js +118 -0
- package/dist/services/call-budget.js.map +1 -0
- package/dist/services/congress-api/congress-api-service.d.ts +4 -0
- package/dist/services/congress-api/congress-api-service.d.ts.map +1 -1
- package/dist/services/congress-api/congress-api-service.js +60 -32
- package/dist/services/congress-api/congress-api-service.js.map +1 -1
- package/dist/services/congress-documents/congress-documents-service.d.ts +46 -15
- package/dist/services/congress-documents/congress-documents-service.d.ts.map +1 -1
- package/dist/services/congress-documents/congress-documents-service.js +95 -24
- package/dist/services/congress-documents/congress-documents-service.js.map +1 -1
- package/dist/services/congress-documents/document-body-cache.d.ts +66 -0
- package/dist/services/congress-documents/document-body-cache.d.ts.map +1 -0
- package/dist/services/congress-documents/document-body-cache.js +122 -0
- package/dist/services/congress-documents/document-body-cache.js.map +1 -0
- package/dist/services/congress-mirror/ingest.d.ts +13 -7
- package/dist/services/congress-mirror/ingest.d.ts.map +1 -1
- package/dist/services/congress-mirror/ingest.js +33 -10
- package/dist/services/congress-mirror/ingest.js.map +1 -1
- package/dist/services/congress-mirror/schema.d.ts.map +1 -1
- package/dist/services/congress-mirror/schema.js +15 -1
- package/dist/services/congress-mirror/schema.js.map +1 -1
- package/dist/services/senate-lis/parse.d.ts +23 -0
- package/dist/services/senate-lis/parse.d.ts.map +1 -1
- package/dist/services/senate-lis/parse.js +49 -5
- package/dist/services/senate-lis/parse.js.map +1 -1
- package/dist/services/senate-lis/senate-vote-service.d.ts.map +1 -1
- package/dist/services/senate-lis/senate-vote-service.js +32 -25
- package/dist/services/senate-lis/senate-vote-service.js.map +1 -1
- package/dist/utils/congress-calendar.d.ts +15 -0
- package/dist/utils/congress-calendar.d.ts.map +1 -0
- package/dist/utils/congress-calendar.js +33 -0
- package/dist/utils/congress-calendar.js.map +1 -0
- package/package.json +3 -3
- package/scripts/_mirror-context.ts +15 -9
- package/scripts/congress-mirror-init.ts +1 -1
- package/scripts/congress-mirror-refresh.ts +1 -1
- package/scripts/congress-mirror-verify.ts +5 -4
- package/server.json +3 -3
- package/skills/congressgov-guide/SKILL.md +1 -1
|
@@ -49,19 +49,26 @@ export declare const dailyRecordTool: import("@cyanheads/mcp-ts-core").ToolDefin
|
|
|
49
49
|
readonly retryable: false;
|
|
50
50
|
readonly when: 'Congress.gov rejected the request as malformed — a bad date range or an identifier with an unexpected shape.';
|
|
51
51
|
readonly recovery: 'Check parameter formats: dates must be ISO 8601 like 2026-05-01T00:00:00Z and identifiers must match their documented shape.';
|
|
52
|
+
}, {
|
|
53
|
+
readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.ConfigurationError;
|
|
54
|
+
readonly reason: 'api_key_rejected';
|
|
55
|
+
readonly thrownBy: 'service';
|
|
56
|
+
readonly retryable: false;
|
|
57
|
+
readonly when: "The api.data.gov gateway rejected the server's configured CONGRESS_API_KEY (missing, invalid, disabled, unauthorized, or unverified); the gateway code is in data.upstreamCode. No change to the call's arguments can fix it.";
|
|
58
|
+
readonly recovery: 'This is a server configuration problem, not a request problem: the operator must replace CONGRESS_API_KEY with a valid api.data.gov key (https://api.data.gov/signup/) or unset it to fall back to the rate-limited DEMO_KEY, then restart the server.';
|
|
52
59
|
}, {
|
|
53
60
|
readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.ServiceUnavailable;
|
|
54
61
|
readonly reason: 'upstream_error';
|
|
55
62
|
readonly thrownBy: 'service';
|
|
56
63
|
readonly retryable: true;
|
|
57
|
-
readonly when: 'Congress.gov returned an unexpected error (5xx or another non-2xx status).';
|
|
64
|
+
readonly when: 'Congress.gov returned an unexpected error (5xx or another non-2xx status) or could not be reached, or the Senate LIS feed failed (5xx, a timeout, or a senate.gov HTTP 403 refusal, which carries retryable: false).';
|
|
58
65
|
readonly recovery: 'Retry after a short delay; if the failure persists the Congress.gov service may be temporarily degraded.';
|
|
59
66
|
}, {
|
|
60
67
|
readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.Timeout;
|
|
61
68
|
readonly reason: 'upstream_timeout';
|
|
62
69
|
readonly thrownBy: 'service';
|
|
63
70
|
readonly retryable: true;
|
|
64
|
-
readonly when:
|
|
71
|
+
readonly when: "A Congress.gov request or a congress.gov document fetch timed out or returned an HTTP timeout response, or the call's upstream requests could not finish inside its 50-second budget.";
|
|
65
72
|
readonly recovery: 'Retry after a short delay; if the failure persists the Congress.gov service may be temporarily degraded.';
|
|
66
73
|
}, {
|
|
67
74
|
readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.NotFound;
|
|
@@ -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;AAsBjD,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;AAsBjD,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAwK1B,CAAC"}
|
|
@@ -44,19 +44,26 @@ export declare const enactedLawsTool: import("@cyanheads/mcp-ts-core").ToolDefin
|
|
|
44
44
|
readonly retryable: false;
|
|
45
45
|
readonly when: 'Congress.gov rejected the request as malformed — a bad date range or an identifier with an unexpected shape.';
|
|
46
46
|
readonly recovery: 'Check parameter formats: dates must be ISO 8601 like 2026-05-01T00:00:00Z and identifiers must match their documented shape.';
|
|
47
|
+
}, {
|
|
48
|
+
readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.ConfigurationError;
|
|
49
|
+
readonly reason: 'api_key_rejected';
|
|
50
|
+
readonly thrownBy: 'service';
|
|
51
|
+
readonly retryable: false;
|
|
52
|
+
readonly when: "The api.data.gov gateway rejected the server's configured CONGRESS_API_KEY (missing, invalid, disabled, unauthorized, or unverified); the gateway code is in data.upstreamCode. No change to the call's arguments can fix it.";
|
|
53
|
+
readonly recovery: 'This is a server configuration problem, not a request problem: the operator must replace CONGRESS_API_KEY with a valid api.data.gov key (https://api.data.gov/signup/) or unset it to fall back to the rate-limited DEMO_KEY, then restart the server.';
|
|
47
54
|
}, {
|
|
48
55
|
readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.ServiceUnavailable;
|
|
49
56
|
readonly reason: 'upstream_error';
|
|
50
57
|
readonly thrownBy: 'service';
|
|
51
58
|
readonly retryable: true;
|
|
52
|
-
readonly when: 'Congress.gov returned an unexpected error (5xx or another non-2xx status).';
|
|
59
|
+
readonly when: 'Congress.gov returned an unexpected error (5xx or another non-2xx status) or could not be reached, or the Senate LIS feed failed (5xx, a timeout, or a senate.gov HTTP 403 refusal, which carries retryable: false).';
|
|
53
60
|
readonly recovery: 'Retry after a short delay; if the failure persists the Congress.gov service may be temporarily degraded.';
|
|
54
61
|
}, {
|
|
55
62
|
readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.Timeout;
|
|
56
63
|
readonly reason: 'upstream_timeout';
|
|
57
64
|
readonly thrownBy: 'service';
|
|
58
65
|
readonly retryable: true;
|
|
59
|
-
readonly when:
|
|
66
|
+
readonly when: "A Congress.gov request or a congress.gov document fetch timed out or returned an HTTP timeout response, or the call's upstream requests could not finish inside its 50-second budget.";
|
|
60
67
|
readonly recovery: 'Retry after a short delay; if the failure persists the Congress.gov service may be temporarily degraded.';
|
|
61
68
|
}], {
|
|
62
69
|
effectiveQuery: z.ZodString;
|
|
@@ -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;AAejD,eAAO,MAAM,eAAe
|
|
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;AAejD,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAkF1B,CAAC"}
|
|
@@ -45,19 +45,26 @@ export declare const memberLookupTool: import("@cyanheads/mcp-ts-core").ToolDefi
|
|
|
45
45
|
readonly retryable: false;
|
|
46
46
|
readonly when: 'Congress.gov rejected the request as malformed — a bad date range or an identifier with an unexpected shape.';
|
|
47
47
|
readonly recovery: 'Check parameter formats: dates must be ISO 8601 like 2026-05-01T00:00:00Z and identifiers must match their documented shape.';
|
|
48
|
+
}, {
|
|
49
|
+
readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.ConfigurationError;
|
|
50
|
+
readonly reason: 'api_key_rejected';
|
|
51
|
+
readonly thrownBy: 'service';
|
|
52
|
+
readonly retryable: false;
|
|
53
|
+
readonly when: "The api.data.gov gateway rejected the server's configured CONGRESS_API_KEY (missing, invalid, disabled, unauthorized, or unverified); the gateway code is in data.upstreamCode. No change to the call's arguments can fix it.";
|
|
54
|
+
readonly recovery: 'This is a server configuration problem, not a request problem: the operator must replace CONGRESS_API_KEY with a valid api.data.gov key (https://api.data.gov/signup/) or unset it to fall back to the rate-limited DEMO_KEY, then restart the server.';
|
|
48
55
|
}, {
|
|
49
56
|
readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.ServiceUnavailable;
|
|
50
57
|
readonly reason: 'upstream_error';
|
|
51
58
|
readonly thrownBy: 'service';
|
|
52
59
|
readonly retryable: true;
|
|
53
|
-
readonly when: 'Congress.gov returned an unexpected error (5xx or another non-2xx status).';
|
|
60
|
+
readonly when: 'Congress.gov returned an unexpected error (5xx or another non-2xx status) or could not be reached, or the Senate LIS feed failed (5xx, a timeout, or a senate.gov HTTP 403 refusal, which carries retryable: false).';
|
|
54
61
|
readonly recovery: 'Retry after a short delay; if the failure persists the Congress.gov service may be temporarily degraded.';
|
|
55
62
|
}, {
|
|
56
63
|
readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.Timeout;
|
|
57
64
|
readonly reason: 'upstream_timeout';
|
|
58
65
|
readonly thrownBy: 'service';
|
|
59
66
|
readonly retryable: true;
|
|
60
|
-
readonly when:
|
|
67
|
+
readonly when: "A Congress.gov request or a congress.gov document fetch timed out or returned an HTTP timeout response, or the call's upstream requests could not finish inside its 50-second budget.";
|
|
61
68
|
readonly recovery: 'Retry after a short delay; if the failure persists the Congress.gov service may be temporarily degraded.';
|
|
62
69
|
}], {
|
|
63
70
|
effectiveQuery: z.ZodString;
|
|
@@ -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;AAajD,eAAO,MAAM,gBAAgB
|
|
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;AAajD,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA0H3B,CAAC"}
|
|
@@ -52,19 +52,26 @@ export declare const rollVotesTool: import("@cyanheads/mcp-ts-core").ToolDefinit
|
|
|
52
52
|
readonly retryable: false;
|
|
53
53
|
readonly when: 'Congress.gov rejected the request as malformed — a bad date range or an identifier with an unexpected shape.';
|
|
54
54
|
readonly recovery: 'Check parameter formats: dates must be ISO 8601 like 2026-05-01T00:00:00Z and identifiers must match their documented shape.';
|
|
55
|
+
}, {
|
|
56
|
+
readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.ConfigurationError;
|
|
57
|
+
readonly reason: 'api_key_rejected';
|
|
58
|
+
readonly thrownBy: 'service';
|
|
59
|
+
readonly retryable: false;
|
|
60
|
+
readonly when: "The api.data.gov gateway rejected the server's configured CONGRESS_API_KEY (missing, invalid, disabled, unauthorized, or unverified); the gateway code is in data.upstreamCode. No change to the call's arguments can fix it.";
|
|
61
|
+
readonly recovery: 'This is a server configuration problem, not a request problem: the operator must replace CONGRESS_API_KEY with a valid api.data.gov key (https://api.data.gov/signup/) or unset it to fall back to the rate-limited DEMO_KEY, then restart the server.';
|
|
55
62
|
}, {
|
|
56
63
|
readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.ServiceUnavailable;
|
|
57
64
|
readonly reason: 'upstream_error';
|
|
58
65
|
readonly thrownBy: 'service';
|
|
59
66
|
readonly retryable: true;
|
|
60
|
-
readonly when: 'Congress.gov returned an unexpected error (5xx or another non-2xx status).';
|
|
67
|
+
readonly when: 'Congress.gov returned an unexpected error (5xx or another non-2xx status) or could not be reached, or the Senate LIS feed failed (5xx, a timeout, or a senate.gov HTTP 403 refusal, which carries retryable: false).';
|
|
61
68
|
readonly recovery: 'Retry after a short delay; if the failure persists the Congress.gov service may be temporarily degraded.';
|
|
62
69
|
}, {
|
|
63
70
|
readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.Timeout;
|
|
64
71
|
readonly reason: 'upstream_timeout';
|
|
65
72
|
readonly thrownBy: 'service';
|
|
66
73
|
readonly retryable: true;
|
|
67
|
-
readonly when:
|
|
74
|
+
readonly when: "A Congress.gov request or a congress.gov document fetch timed out or returned an HTTP timeout response, or the call's upstream requests could not finish inside its 50-second budget.";
|
|
68
75
|
readonly recovery: 'Retry after a short delay; if the failure persists the Congress.gov service may be temporarily degraded.';
|
|
69
76
|
}, {
|
|
70
77
|
readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.ValidationError;
|
|
@@ -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;;;;;GAKG;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;;;;;GAKG;AAGH,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;AAgBjD,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAqIxB,CAAC"}
|
|
@@ -9,6 +9,7 @@ import { validationError } from '@cyanheads/mcp-ts-core/errors';
|
|
|
9
9
|
import { formatVotes } from '../format-helpers.js';
|
|
10
10
|
import { buildEffectiveQuery, congressErrorContracts, identityErrorContracts, listEnrichment, listOrDetail, notifyIfNoMatches, } from '../tool-helpers.js';
|
|
11
11
|
import { getCongressApi } from '../../../services/congress-api/congress-api-service.js';
|
|
12
|
+
import { SENATE_VOTE_COVERAGE } from '../../../services/senate-lis/parse.js';
|
|
12
13
|
import { getSenateVoteService } from '../../../services/senate-lis/senate-vote-service.js';
|
|
13
14
|
export const rollVotesTool = tool('congressgov_roll_votes', {
|
|
14
15
|
title: 'Congress.gov Roll Votes',
|
|
@@ -27,7 +28,7 @@ export const rollVotesTool = tool('congressgov_roll_votes', {
|
|
|
27
28
|
.int()
|
|
28
29
|
.min(1)
|
|
29
30
|
.max(2)
|
|
30
|
-
.describe(
|
|
31
|
+
.describe("Session number (1 or 2). A congress's first year is session 1 and its second year session 2; a second session can run into January 1–3 of the following year (the 116th Congress's second session voted on 2021-01-01)."),
|
|
31
32
|
voteNumber: z
|
|
32
33
|
.number()
|
|
33
34
|
.int()
|
|
@@ -126,7 +127,7 @@ async function handleSenateVotes(input, ctx) {
|
|
|
126
127
|
session: input.session,
|
|
127
128
|
}));
|
|
128
129
|
ctx.enrich.total(result.pagination.count);
|
|
129
|
-
notifyIfNoMatches(ctx, result,
|
|
130
|
+
notifyIfNoMatches(ctx, result, `No Senate votes found. Verify the congress and session — ${SENATE_VOTE_COVERAGE}.`);
|
|
130
131
|
return result;
|
|
131
132
|
}
|
|
132
133
|
if (!input.voteNumber) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"roll-votes.tool.js","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/roll-votes.tool.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACj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B,QAAQ,EAAE,KAAK,CAAC,MAAM;QACtB,MAAM,EAAE,MAAM,CAAC,MAAM;QACrB,gBAAgB,EAAE,CAAC,GAAG,cAAc;KACrC,CAAC,CAAC;IACH,OAAO,EAAE,GAAG,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,UAAU,EAAE,EAAE,KAAK,EAAE,GAAG,CAAC,MAAM,EAAE,UAAU,EAAE,EAAE,CAAC;AAClF,CAAC"}
|
|
@@ -3,6 +3,19 @@
|
|
|
3
3
|
* @module mcp-server/tools/definitions/senate-nominations
|
|
4
4
|
*/
|
|
5
5
|
import { z } from '@cyanheads/mcp-ts-core';
|
|
6
|
+
declare const rollVoteSchema: z.ZodObject<{
|
|
7
|
+
chamber: z.ZodLiteral<"senate">;
|
|
8
|
+
congress: z.ZodNumber;
|
|
9
|
+
session: z.ZodNumber;
|
|
10
|
+
voteNumber: z.ZodNumber;
|
|
11
|
+
}, z.core.$strip>;
|
|
12
|
+
type RollVote = z.infer<typeof rollVoteSchema>;
|
|
13
|
+
/**
|
|
14
|
+
* The `congressgov_roll_votes` arguments for the Senate vote an action cites as its
|
|
15
|
+
* own, or `undefined` when it cites none, its date falls outside `congress`, or the
|
|
16
|
+
* vote predates the Senate feed.
|
|
17
|
+
*/
|
|
18
|
+
export declare function citedRollVote(action: unknown, congress: number): RollVote | undefined;
|
|
6
19
|
export declare const senateNominationsTool: import("@cyanheads/mcp-ts-core").ToolDefinition<z.ZodObject<{
|
|
7
20
|
operation: z.ZodEnum<{
|
|
8
21
|
actions: "actions";
|
|
@@ -18,12 +31,36 @@ export declare const senateNominationsTool: import("@cyanheads/mcp-ts-core").Too
|
|
|
18
31
|
limit: z.ZodDefault<z.ZodNumber>;
|
|
19
32
|
offset: z.ZodDefault<z.ZodNumber>;
|
|
20
33
|
}, z.core.$strip>, z.ZodObject<{
|
|
21
|
-
data: z.ZodOptional<z.ZodArray<z.ZodObject<{}, z.core.$loose>>>;
|
|
22
34
|
pagination: z.ZodOptional<z.ZodObject<{
|
|
23
35
|
count: z.ZodNumber;
|
|
24
36
|
nextOffset: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
25
37
|
}, z.core.$strip>>;
|
|
26
|
-
|
|
38
|
+
data: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
39
|
+
latestAction: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
40
|
+
rollVote: z.ZodOptional<z.ZodObject<{
|
|
41
|
+
chamber: z.ZodLiteral<"senate">;
|
|
42
|
+
congress: z.ZodNumber;
|
|
43
|
+
session: z.ZodNumber;
|
|
44
|
+
voteNumber: z.ZodNumber;
|
|
45
|
+
}, z.core.$strip>>;
|
|
46
|
+
}, z.core.$loose>>>;
|
|
47
|
+
rollVote: z.ZodOptional<z.ZodObject<{
|
|
48
|
+
chamber: z.ZodLiteral<"senate">;
|
|
49
|
+
congress: z.ZodNumber;
|
|
50
|
+
session: z.ZodNumber;
|
|
51
|
+
voteNumber: z.ZodNumber;
|
|
52
|
+
}, z.core.$strip>>;
|
|
53
|
+
}, z.core.$loose>>>;
|
|
54
|
+
nomination: z.ZodOptional<z.ZodObject<{
|
|
55
|
+
latestAction: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
56
|
+
rollVote: z.ZodOptional<z.ZodObject<{
|
|
57
|
+
chamber: z.ZodLiteral<"senate">;
|
|
58
|
+
congress: z.ZodNumber;
|
|
59
|
+
session: z.ZodNumber;
|
|
60
|
+
voteNumber: z.ZodNumber;
|
|
61
|
+
}, z.core.$strip>>;
|
|
62
|
+
}, z.core.$loose>>>;
|
|
63
|
+
}, z.core.$loose>>;
|
|
27
64
|
}, z.core.$loose>, readonly [{
|
|
28
65
|
readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.NotFound;
|
|
29
66
|
readonly reason: 'not_found';
|
|
@@ -45,19 +82,26 @@ export declare const senateNominationsTool: import("@cyanheads/mcp-ts-core").Too
|
|
|
45
82
|
readonly retryable: false;
|
|
46
83
|
readonly when: 'Congress.gov rejected the request as malformed — a bad date range or an identifier with an unexpected shape.';
|
|
47
84
|
readonly recovery: 'Check parameter formats: dates must be ISO 8601 like 2026-05-01T00:00:00Z and identifiers must match their documented shape.';
|
|
85
|
+
}, {
|
|
86
|
+
readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.ConfigurationError;
|
|
87
|
+
readonly reason: 'api_key_rejected';
|
|
88
|
+
readonly thrownBy: 'service';
|
|
89
|
+
readonly retryable: false;
|
|
90
|
+
readonly when: "The api.data.gov gateway rejected the server's configured CONGRESS_API_KEY (missing, invalid, disabled, unauthorized, or unverified); the gateway code is in data.upstreamCode. No change to the call's arguments can fix it.";
|
|
91
|
+
readonly recovery: 'This is a server configuration problem, not a request problem: the operator must replace CONGRESS_API_KEY with a valid api.data.gov key (https://api.data.gov/signup/) or unset it to fall back to the rate-limited DEMO_KEY, then restart the server.';
|
|
48
92
|
}, {
|
|
49
93
|
readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.ServiceUnavailable;
|
|
50
94
|
readonly reason: 'upstream_error';
|
|
51
95
|
readonly thrownBy: 'service';
|
|
52
96
|
readonly retryable: true;
|
|
53
|
-
readonly when: 'Congress.gov returned an unexpected error (5xx or another non-2xx status).';
|
|
97
|
+
readonly when: 'Congress.gov returned an unexpected error (5xx or another non-2xx status) or could not be reached, or the Senate LIS feed failed (5xx, a timeout, or a senate.gov HTTP 403 refusal, which carries retryable: false).';
|
|
54
98
|
readonly recovery: 'Retry after a short delay; if the failure persists the Congress.gov service may be temporarily degraded.';
|
|
55
99
|
}, {
|
|
56
100
|
readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.Timeout;
|
|
57
101
|
readonly reason: 'upstream_timeout';
|
|
58
102
|
readonly thrownBy: 'service';
|
|
59
103
|
readonly retryable: true;
|
|
60
|
-
readonly when:
|
|
104
|
+
readonly when: "A Congress.gov request or a congress.gov document fetch timed out or returned an HTTP timeout response, or the call's upstream requests could not finish inside its 50-second budget.";
|
|
61
105
|
readonly recovery: 'Retry after a short delay; if the failure persists the Congress.gov service may be temporarily degraded.';
|
|
62
106
|
}, {
|
|
63
107
|
readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.ValidationError;
|
|
@@ -70,4 +114,5 @@ export declare const senateNominationsTool: import("@cyanheads/mcp-ts-core").Too
|
|
|
70
114
|
totalCount: z.ZodNumber;
|
|
71
115
|
notice: z.ZodOptional<z.ZodString>;
|
|
72
116
|
}>;
|
|
117
|
+
export {};
|
|
73
118
|
//# 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;AAGH,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;AAGH,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;AA8BjD,QAAA,MAAM,cAAc;;;;;iBAoBjB,CAAC;AAEJ,KAAK,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC;AAmD/C;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,GAAG,QAAQ,GAAG,SAAS,CASrF;AAeD,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAwIhC,CAAC"}
|
|
@@ -7,9 +7,101 @@ import { validationError } from '@cyanheads/mcp-ts-core/errors';
|
|
|
7
7
|
import { formatNominations } from '../format-helpers.js';
|
|
8
8
|
import { buildEffectiveQuery, congressErrorContracts, identityErrorContracts, listEnrichment, listOrDetail, normalizeOptionalString, notifyIfNoMatches, } from '../tool-helpers.js';
|
|
9
9
|
import { getCongressApi } from '../../../services/congress-api/congress-api-service.js';
|
|
10
|
+
import { SENATE_VOTE_COVERAGE, SENATE_VOTE_FIRST_CONGRESS, senateSessionForDate, } from '../../../services/senate-lis/parse.js';
|
|
11
|
+
/**
|
|
12
|
+
* An action's citation of its own Senate record vote: `Record Vote Number: 225.`,
|
|
13
|
+
* `Record Vote No: 20.`, with `EX.` before or after the number (`No: EX. 3.`,
|
|
14
|
+
* `No: 309EX.`, `No: 104 EX.`). The colon is what separates it from a back-reference
|
|
15
|
+
* to another action's vote — `(Record Vote No. 318)`, `(Roll Call Vote No. 318)` —
|
|
16
|
+
* which never carries one. Linear: no nested quantifier and no unanchored `.*`.
|
|
17
|
+
*/
|
|
18
|
+
const OWN_VOTE_CITATION = /Record Vote (?:Number|No): ?(?:EX\. ?)?(\d+)/;
|
|
19
|
+
const rollVoteSchema = z
|
|
20
|
+
.object({
|
|
21
|
+
chamber: z
|
|
22
|
+
.literal('senate')
|
|
23
|
+
.describe("Always 'senate'. Pass it: congressgov_roll_votes defaults to 'house', whose vote with the same number is a different vote."),
|
|
24
|
+
congress: z.number().int().positive().describe('Congress the vote was cast in.'),
|
|
25
|
+
session: z
|
|
26
|
+
.number()
|
|
27
|
+
.int()
|
|
28
|
+
.min(1)
|
|
29
|
+
.max(2)
|
|
30
|
+
.describe("Session the vote was cast in, from the action date: the congress's first year is session 1; its second year, and January 1–3 of the year after, session 2."),
|
|
31
|
+
voteNumber: z.number().int().positive().describe('Senate roll call number the action cites.'),
|
|
32
|
+
})
|
|
33
|
+
.describe(`Arguments for congressgov_roll_votes that retrieve the Senate roll call vote this action cites as its own. Absent when the action cites no vote of its own (a back-reference such as "(Record Vote No. 318)" names another action's vote), and for votes before the feed starts — ${SENATE_VOTE_COVERAGE}.`);
|
|
34
|
+
const latestActionSchema = z
|
|
35
|
+
.object({ rollVote: rollVoteSchema.optional() })
|
|
36
|
+
.passthrough()
|
|
37
|
+
.nullable()
|
|
38
|
+
.optional()
|
|
39
|
+
.describe('Most recent action (`actionDate`, `text`), with `rollVote` when its text cites its own Senate record vote. Null or absent on a multi-part parent (e.g. PN730).');
|
|
40
|
+
const NOMINATION_RECORD_DESCRIPTION = 'Nomination record for `get` (description, dates, nominees array, sub-resource counts); absent for `list` and sub-resources.';
|
|
41
|
+
const nominationListOutput = listOrDetail({ nomination: 'record' }, NOMINATION_RECORD_DESCRIPTION);
|
|
42
|
+
/** Zod types a description as optional; `listOrDetail` sets one on every envelope it builds. */
|
|
43
|
+
const envelopeDescription = nominationListOutput.description;
|
|
44
|
+
if (envelopeDescription === undefined) {
|
|
45
|
+
throw new Error('listOrDetail built an envelope with no root description.');
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* The shared list/detail envelope with the two roots that can carry a `rollVote`
|
|
49
|
+
* declared. Zod keeps a description per schema instance, so the extended root
|
|
50
|
+
* re-applies the envelope's.
|
|
51
|
+
*/
|
|
52
|
+
const nominationOutput = nominationListOutput
|
|
53
|
+
.extend({
|
|
54
|
+
data: z
|
|
55
|
+
.array(z
|
|
56
|
+
.object({
|
|
57
|
+
latestAction: latestActionSchema,
|
|
58
|
+
rollVote: rollVoteSchema.optional(),
|
|
59
|
+
})
|
|
60
|
+
.passthrough()
|
|
61
|
+
.describe("Upstream JSON record: a nomination (`list`), an action (`actions`), a committee, a hearing, or a nominee. A `list` row's `latestAction` and an `actions` row carry `rollVote` when they cite their own Senate record vote."))
|
|
62
|
+
.optional()
|
|
63
|
+
.describe('Result rows for `list` and the sub-resource operations.'),
|
|
64
|
+
nomination: z
|
|
65
|
+
.object({ latestAction: latestActionSchema })
|
|
66
|
+
.passthrough()
|
|
67
|
+
.optional()
|
|
68
|
+
.describe(NOMINATION_RECORD_DESCRIPTION),
|
|
69
|
+
})
|
|
70
|
+
.describe(envelopeDescription);
|
|
71
|
+
/**
|
|
72
|
+
* The `congressgov_roll_votes` arguments for the Senate vote an action cites as its
|
|
73
|
+
* own, or `undefined` when it cites none, its date falls outside `congress`, or the
|
|
74
|
+
* vote predates the Senate feed.
|
|
75
|
+
*/
|
|
76
|
+
export function citedRollVote(action, congress) {
|
|
77
|
+
if (congress < SENATE_VOTE_FIRST_CONGRESS || !action || typeof action !== 'object')
|
|
78
|
+
return;
|
|
79
|
+
const { actionDate, text } = action;
|
|
80
|
+
if (typeof actionDate !== 'string' || typeof text !== 'string')
|
|
81
|
+
return;
|
|
82
|
+
const voteNumber = Number(OWN_VOTE_CITATION.exec(text)?.[1]);
|
|
83
|
+
if (!Number.isSafeInteger(voteNumber) || voteNumber < 1)
|
|
84
|
+
return;
|
|
85
|
+
const session = senateSessionForDate(congress, actionDate);
|
|
86
|
+
if (session === undefined)
|
|
87
|
+
return;
|
|
88
|
+
return { chamber: 'senate', congress, session, voteNumber };
|
|
89
|
+
}
|
|
90
|
+
/** `record`, with `rollVote` on its `latestAction` when that action cites its own Senate vote. */
|
|
91
|
+
function withLatestActionRollVote(record, congress) {
|
|
92
|
+
const rollVote = citedRollVote(record.latestAction, congress);
|
|
93
|
+
if (!rollVote)
|
|
94
|
+
return record;
|
|
95
|
+
return { ...record, latestAction: { ...record.latestAction, rollVote } };
|
|
96
|
+
}
|
|
97
|
+
/** An `actions` row, with `rollVote` when it cites its own Senate vote. */
|
|
98
|
+
function withRollVote(action, congress) {
|
|
99
|
+
const rollVote = citedRollVote(action, congress);
|
|
100
|
+
return rollVote ? { ...action, rollVote } : action;
|
|
101
|
+
}
|
|
10
102
|
export const senateNominationsTool = tool('congressgov_senate_nominations', {
|
|
11
103
|
title: 'Congress.gov Senate Nominations',
|
|
12
|
-
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.`,
|
|
104
|
+
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. An action that cites its own Senate record vote — an \`actions\` row, or \`latestAction\` on \`list\` and \`get\` — carries \`rollVote\`, the congressgov_roll_votes arguments for that vote.`,
|
|
13
105
|
annotations: { readOnlyHint: true, idempotentHint: true, openWorldHint: true },
|
|
14
106
|
errors: [...congressErrorContracts, ...identityErrorContracts],
|
|
15
107
|
input: z.object({
|
|
@@ -30,7 +122,7 @@ export const senateNominationsTool = tool('congressgov_senate_nominations', {
|
|
|
30
122
|
limit: z.number().int().min(1).max(250).default(20).describe('Results per page (1-250).'),
|
|
31
123
|
offset: z.number().int().min(0).default(0).describe('Pagination offset.'),
|
|
32
124
|
}),
|
|
33
|
-
output:
|
|
125
|
+
output: nominationOutput,
|
|
34
126
|
enrichment: listEnrichment,
|
|
35
127
|
format: formatNominations,
|
|
36
128
|
async handler(input, ctx) {
|
|
@@ -51,7 +143,10 @@ export const senateNominationsTool = tool('congressgov_senate_nominations', {
|
|
|
51
143
|
ctx.enrich.echo(buildEffectiveQuery('nominations', { congress: input.congress }));
|
|
52
144
|
ctx.enrich.total(result.pagination.count);
|
|
53
145
|
notifyIfNoMatches(ctx, result, 'No nominations found for this congress. Verify the congress number.');
|
|
54
|
-
return
|
|
146
|
+
return {
|
|
147
|
+
...result,
|
|
148
|
+
data: result.data.map((row) => withLatestActionRollVote(row, input.congress)),
|
|
149
|
+
};
|
|
55
150
|
}
|
|
56
151
|
if (!input.nominationNumber) {
|
|
57
152
|
throw validationError(`The '${input.operation}' operation requires nominationNumber. Use 'list' to browse nominations.`, { field: 'nominationNumber', operation: input.operation });
|
|
@@ -64,7 +159,7 @@ export const senateNominationsTool = tool('congressgov_senate_nominations', {
|
|
|
64
159
|
});
|
|
65
160
|
ctx.enrich.echo(`nomination PN${input.nominationNumber} in the ${input.congress}th Congress`);
|
|
66
161
|
ctx.enrich.total(1);
|
|
67
|
-
return result;
|
|
162
|
+
return { ...result, nomination: withLatestActionRollVote(result.nomination, input.congress) };
|
|
68
163
|
}
|
|
69
164
|
if (input.operation === 'nominees') {
|
|
70
165
|
if (!input.ordinal) {
|
|
@@ -99,7 +194,9 @@ export const senateNominationsTool = tool('congressgov_senate_nominations', {
|
|
|
99
194
|
ctx.enrich.echo(`${input.operation} for nomination ${input.nominationNumber}`);
|
|
100
195
|
ctx.enrich.total(result.pagination.count);
|
|
101
196
|
applyParentFormNotice(ctx, result, input.nominationNumber);
|
|
102
|
-
|
|
197
|
+
if (input.operation !== 'actions')
|
|
198
|
+
return result;
|
|
199
|
+
return { ...result, data: result.data.map((row) => withRollVote(row, input.congress)) };
|
|
103
200
|
},
|
|
104
201
|
});
|
|
105
202
|
/**
|
|
@@ -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;AAGH,OAAO,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAChE,OAAO,EAAE,iBAAiB,EAAE,MAAM,sCAAsC,CAAC;AACzE,OAAO,EACL,mBAAmB,EACnB,sBAAsB,EACtB,sBAAsB,EACtB,cAAc,EACd,YAAY,EACZ,uBAAuB,EACvB,iBAAiB,GAClB,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EAAE,cAAc,EAAE,MAAM,iDAAiD,CAAC;
|
|
1
|
+
{"version":3,"file":"senate-nominations.tool.js","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/senate-nominations.tool.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAChE,OAAO,EAAE,iBAAiB,EAAE,MAAM,sCAAsC,CAAC;AACzE,OAAO,EACL,mBAAmB,EACnB,sBAAsB,EACtB,sBAAsB,EACtB,cAAc,EACd,YAAY,EACZ,uBAAuB,EACvB,iBAAiB,GAClB,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EAAE,cAAc,EAAE,MAAM,iDAAiD,CAAC;AACjF,OAAO,EACL,oBAAoB,EACpB,0BAA0B,EAC1B,oBAAoB,GACrB,MAAM,gCAAgC,CAAC;AAIxC;;;;;;GAMG;AACH,MAAM,iBAAiB,GAAG,8CAA8C,CAAC;AAEzE,MAAM,cAAc,GAAG,CAAC;KACrB,MAAM,CAAC;IACN,OAAO,EAAE,CAAC;SACP,OAAO,CAAC,QAAQ,CAAC;SACjB,QAAQ,CACP,4HAA4H,CAC7H;IACH,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,gCAAgC,CAAC;IAChF,OAAO,EAAE,CAAC;SACP,MAAM,EAAE;SACR,GAAG,EAAE;SACL,GAAG,CAAC,CAAC,CAAC;SACN,GAAG,CAAC,CAAC,CAAC;SACN,QAAQ,CACP,4JAA4J,CAC7J;IACH,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,QAA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CAAC;QAC3D,IAAI,KAAK,CAAC,SAAS,KAAK,SAAS;YAAE,OAAO,MAAM,CAAC;QACjD,OAAO,EAAE,GAAG,MAAM,EAAE,IAAI,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,YAAY,CAAC,GAAG,EAAE,KAAK,CAAC,QAAQ,CAAC,CAAC,EAAE,CAAC;IAC1F,CAAC;CACF,CAAC,CAAC;AAEH;;;;;;;;;GASG;AACH,SAAS,qBAAqB,CAC5B,GAAY,EACZ,MAA0D,EAC1D,gBAAwB;IAExB,IAAI,gBAAgB,CAAC,QAAQ,CAAC,GAAG,CAAC;QAAE,OAAO;IAC3C,iBAAiB,CACf,GAAG,EACH,MAAM,EACN,QAAQ,gBAAgB,+GAA+G,gBAAgB,+BAA+B,CACvL,CAAC;AACJ,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"format-helpers.d.ts","sourceRoot":"","sources":["../../../src/mcp-server/tools/format-helpers.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAIH,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;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAIH,KAAK,SAAS,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC;AAu7DhD,sFAAsF;AACtF,wBAAgB,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,EAAE,CAYxE;AAgDD,2DAA2D;AAC3D,eAAO,MAAM,eAAe,WA/EhB,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,SAAS,EA+EkB,CAAC;AA8CpE,qDAAqD;AACrD,eAAO,MAAM,iBAAiB,WA9HlB,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,SAAS,EA8HuB,CAAC;AAEzE,oEAAoE;AACpE,wBAAgB,aAAa,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,EAAE,CAoB1E;AAWD,iFAAiF;AACjF,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,EAAE,CAkB7E;AAED,kDAAkD;AAClD,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,EAAE,CAWnF;AAED,mCAAmC;AACnC,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,EAAE,CAK7E;AAED,4FAA4F;AAC5F,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,EAAE,CAc9E;AAED,8FAA8F;AAC9F,eAAO,MAAM,UAAU,WA7NX,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,SAAS,EA6NiC,CAAC;AAEnF;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,EAAE,CAcxE;AAED,iEAAiE;AACjE,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,EAAE,CAgB9E"}
|
|
@@ -317,15 +317,17 @@ function renderGenericItem(item, index) {
|
|
|
317
317
|
}
|
|
318
318
|
return lines.join('\n');
|
|
319
319
|
}
|
|
320
|
-
/** Fields of a `latestAction` object the curated
|
|
321
|
-
const LATEST_ACTION_KEYS = new Set(['actionDate', 'text']);
|
|
320
|
+
/** Fields of a `latestAction` object the curated lines name — `actionTime` is not one. */
|
|
321
|
+
const LATEST_ACTION_KEYS = new Set(['actionDate', 'text', 'rollVote']);
|
|
322
322
|
/**
|
|
323
323
|
* The `**Latest Action:** date — text` line, followed by any sub-field that
|
|
324
324
|
* curation does not name. Every renderer that shows a `latestAction` object
|
|
325
325
|
* shows it the same lossy way, so the fall-through lives here rather than in
|
|
326
326
|
* each caller's key set — upstream carries `actionTime` on bill rows reached
|
|
327
327
|
* through `member_lookup sponsored`, and it reached no `content[]` client.
|
|
328
|
-
*
|
|
328
|
+
* A nomination's latest action that cites its Senate vote adds the
|
|
329
|
+
* `rollVoteLine` beneath. Returns undefined when the row carries no latest
|
|
330
|
+
* action at all.
|
|
329
331
|
*/
|
|
330
332
|
function latestActionLine(item) {
|
|
331
333
|
const action = item.latestAction;
|
|
@@ -334,8 +336,22 @@ function latestActionLine(item) {
|
|
|
334
336
|
const record = action;
|
|
335
337
|
const curated = [s(record, 'actionDate'), s(record, 'text')].filter(Boolean).join(' — ');
|
|
336
338
|
const line = withUnnamedFields(record, curated, LATEST_ACTION_KEYS);
|
|
337
|
-
|
|
339
|
+
const latest = line ? `**Latest Action:** ${line.replace(/^ — /, '')}` : undefined;
|
|
340
|
+
return [latest, rollVoteLine(record.rollVote)].filter(Boolean).join('\n') || undefined;
|
|
338
341
|
}
|
|
342
|
+
/**
|
|
343
|
+
* The `congressgov_roll_votes` call a nomination action's `rollVote` names, as one
|
|
344
|
+
* line. `congressgov_senate_nominations` derives `rollVote` from an action that cites
|
|
345
|
+
* its own Senate record vote; Congress.gov publishes none, so a bill action (which
|
|
346
|
+
* carries `recordedVotes` instead) never reaches this line.
|
|
347
|
+
*/
|
|
348
|
+
function rollVoteLine(rollVote) {
|
|
349
|
+
if (!rollVote || typeof rollVote !== 'object' || Array.isArray(rollVote))
|
|
350
|
+
return;
|
|
351
|
+
const args = ROLL_VOTE_ARGUMENTS.map((key) => `${key}=${s(rollVote, key)}`).join(', ');
|
|
352
|
+
return `**Senate Roll Vote:** congressgov_roll_votes ${args}`;
|
|
353
|
+
}
|
|
354
|
+
const ROLL_VOTE_ARGUMENTS = ['chamber', 'congress', 'session', 'voteNumber'];
|
|
339
355
|
/**
|
|
340
356
|
* Compact one-line render of a small object. Compact but never lossy: values are
|
|
341
357
|
* carried in full and nested objects/arrays recurse, so no field or character is
|
|
@@ -769,10 +785,20 @@ function renderBillActionItem(item, i) {
|
|
|
769
785
|
if (names.length > 0)
|
|
770
786
|
lines.push(`**Committees:** ${names.join(', ')}`);
|
|
771
787
|
}
|
|
788
|
+
const rollVote = rollVoteLine(item.rollVote);
|
|
789
|
+
if (rollVote)
|
|
790
|
+
lines.push(rollVote);
|
|
772
791
|
return withRowRest(item, lines, BILL_ACTION_ROW_KEYS);
|
|
773
792
|
}
|
|
774
793
|
/** `committees` is absent: the name list drops each committee's `systemCode`. */
|
|
775
|
-
const BILL_ACTION_ROW_KEYS = new Set([
|
|
794
|
+
const BILL_ACTION_ROW_KEYS = new Set([
|
|
795
|
+
'actionDate',
|
|
796
|
+
'text',
|
|
797
|
+
'type',
|
|
798
|
+
'actionCode',
|
|
799
|
+
'sourceSystem',
|
|
800
|
+
'rollVote',
|
|
801
|
+
]);
|
|
776
802
|
/** Committee report text — items wrap a `formats` array of {type, url, isErrata}. */
|
|
777
803
|
function renderCommitteeReportTextItem(item, i) {
|
|
778
804
|
const formats = item.formats;
|
|
@@ -2009,16 +2035,19 @@ export function formatVotes(result) {
|
|
|
2009
2035
|
}
|
|
2010
2036
|
/** Presidential nominations and Senate confirmation pipeline. */
|
|
2011
2037
|
export function formatNominations(result) {
|
|
2038
|
+
/** Each root renders on its own presence: a response carries one, and a result
|
|
2039
|
+
* carrying both (the linter's parity sample) renders both rather than dropping one. */
|
|
2040
|
+
const sections = [];
|
|
2012
2041
|
if (Array.isArray(result.data)) {
|
|
2013
2042
|
const first = result.data[0];
|
|
2014
2043
|
const firstRecord = typeof first === 'object' && first !== null ? first : undefined;
|
|
2015
2044
|
const renderer = firstRecord
|
|
2016
2045
|
? pickNominationListRenderer(firstRecord)
|
|
2017
2046
|
: renderNominationListItem;
|
|
2018
|
-
|
|
2047
|
+
sections.push(renderList(result, renderer));
|
|
2019
2048
|
}
|
|
2020
2049
|
if (result.nomination != null)
|
|
2021
|
-
|
|
2022
|
-
return tb(renderDetail(result));
|
|
2050
|
+
sections.push(renderNominationDetail(result.nomination));
|
|
2051
|
+
return tb(sections.length > 0 ? sections.join('\n\n') : renderDetail(result));
|
|
2023
2052
|
}
|
|
2024
2053
|
//# sourceMappingURL=format-helpers.js.map
|