@cyanheads/congressgov-mcp-server 0.3.25 → 0.3.27
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 +16 -6
- package/CLAUDE.md +16 -6
- package/README.md +7 -6
- package/dist/index.js +3 -1
- package/dist/index.js.map +1 -1
- package/dist/mcp-server/tools/definitions/committee-lookup.tool.d.ts +1 -0
- package/dist/mcp-server/tools/definitions/committee-lookup.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/committee-lookup.tool.js +107 -9
- package/dist/mcp-server/tools/definitions/committee-lookup.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/roll-votes.tool.d.ts +7 -1
- package/dist/mcp-server/tools/definitions/roll-votes.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/roll-votes.tool.js +64 -3
- package/dist/mcp-server/tools/definitions/roll-votes.tool.js.map +1 -1
- package/dist/mcp-server/tools/format-helpers.d.ts +5 -1
- package/dist/mcp-server/tools/format-helpers.d.ts.map +1 -1
- package/dist/mcp-server/tools/format-helpers.js +179 -6
- package/dist/mcp-server/tools/format-helpers.js.map +1 -1
- package/dist/services/congress-api/congress-api-service.js +2 -2
- package/dist/services/congress-api/congress-api-service.js.map +1 -1
- package/dist/services/congress-api/types.d.ts +2 -0
- package/dist/services/congress-api/types.d.ts.map +1 -1
- package/dist/services/senate-lis/parse.d.ts +32 -0
- package/dist/services/senate-lis/parse.d.ts.map +1 -0
- package/dist/services/senate-lis/parse.js +229 -0
- package/dist/services/senate-lis/parse.js.map +1 -0
- package/dist/services/senate-lis/senate-vote-service.d.ts +73 -0
- package/dist/services/senate-lis/senate-vote-service.d.ts.map +1 -0
- package/dist/services/senate-lis/senate-vote-service.js +182 -0
- package/dist/services/senate-lis/senate-vote-service.js.map +1 -0
- package/dist/services/senate-lis/types.d.ts +122 -0
- package/dist/services/senate-lis/types.d.ts.map +1 -0
- package/dist/services/senate-lis/types.js +16 -0
- package/dist/services/senate-lis/types.js.map +1 -0
- package/package.json +2 -1
- package/server.json +3 -3
package/AGENTS.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# Agent Protocol
|
|
2
2
|
|
|
3
3
|
**Server:** congressgov-mcp-server
|
|
4
|
-
**Version:** 0.3.
|
|
4
|
+
**Version:** 0.3.27
|
|
5
5
|
**Framework:** [@cyanheads/mcp-ts-core](https://www.npmjs.com/package/@cyanheads/mcp-ts-core) `^0.9.16`
|
|
6
6
|
**Engines:** Bun ≥1.3.0, Node ≥24.0.0
|
|
7
7
|
**MCP SDK:** `@modelcontextprotocol/sdk` ^1.29.0
|
|
@@ -68,7 +68,7 @@ Tailor suggestions to what's actually missing or stale — don't recite the full
|
|
|
68
68
|
| `congressgov_enacted_laws` | Browse enacted public and private laws by congress |
|
|
69
69
|
| `congressgov_member_lookup` | Discover members by state/district/congress, retrieve legislative portfolios |
|
|
70
70
|
| `congressgov_committee_lookup` | Browse committees and retrieve legislation, reports, nominations |
|
|
71
|
-
| `congressgov_roll_votes` | Retrieve House roll call votes and member voting positions |
|
|
71
|
+
| `congressgov_roll_votes` | Retrieve House and Senate roll call votes and member voting positions |
|
|
72
72
|
| `congressgov_senate_nominations` | Browse presidential nominations, track Senate confirmation pipeline |
|
|
73
73
|
| `congressgov_bill_summaries` | Browse recent CRS bill summaries — the "what's happening" feed |
|
|
74
74
|
| `congressgov_crs_reports` | Browse and retrieve nonpartisan CRS policy analysis reports |
|
|
@@ -105,6 +105,10 @@ src/
|
|
|
105
105
|
congress-api/
|
|
106
106
|
congress-api-service.ts # API client — auth, pagination, rate limiting
|
|
107
107
|
types.ts # API response types
|
|
108
|
+
senate-lis/
|
|
109
|
+
senate-vote-service.ts # Senate LIS XML client — fetch, retry, not-found
|
|
110
|
+
parse.ts # pure XML → domain parsers (fast-xml-parser)
|
|
111
|
+
types.ts # Senate vote domain types
|
|
108
112
|
mcp-server/
|
|
109
113
|
tools/definitions/
|
|
110
114
|
bill-lookup.tool.ts # congressgov_bill_lookup
|
|
@@ -130,17 +134,23 @@ src/
|
|
|
130
134
|
|
|
131
135
|
---
|
|
132
136
|
|
|
133
|
-
##
|
|
137
|
+
## Services
|
|
134
138
|
|
|
135
|
-
|
|
139
|
+
Two services. `CongressApiService` backs nine tools and the House branch of `congressgov_roll_votes`; `SenateVoteService` backs only the Senate branch of `congressgov_roll_votes` (the Congress.gov API exposes no Senate vote namespace).
|
|
136
140
|
|
|
137
|
-
|
|
138
|
-
- API key via
|
|
141
|
+
**`CongressApiService`** — wraps the Congress.gov REST API v3:
|
|
142
|
+
- API key via `X-Api-Key` header (never logged; kept out of the URL so it can't leak in upstream error messages)
|
|
139
143
|
- Pagination: `offset` + `limit` query params, max 250 per request
|
|
140
144
|
- Rate limiting: 5,000 requests/hour per key
|
|
141
145
|
- Response normalization: request `format=json`, return typed data
|
|
142
146
|
- Native `fetch` — no SDK dependency
|
|
143
147
|
|
|
148
|
+
**`SenateVoteService`** — wraps the Senate's official LIS roll-call XML feed (`senate.gov/legislative/LIS`):
|
|
149
|
+
- No API key, no JSON. XML parsed via `fast-xml-parser` in `parse.ts` (pure, fixture-tested)
|
|
150
|
+
- The whole session menu is one file; each vote's roster ships inline — pagination is client-side
|
|
151
|
+
- The host returns HTTP 200 with an HTML page for unknown congress/session/vote, so "not found" is detected from the body, not the status code
|
|
152
|
+
- Party totals are derived from the roster (the feed publishes none)
|
|
153
|
+
|
|
144
154
|
**Usage in tools:**
|
|
145
155
|
```ts
|
|
146
156
|
import { getCongressApi } from '@/services/congress-api/congress-api-service.js';
|
package/CLAUDE.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# Agent Protocol
|
|
2
2
|
|
|
3
3
|
**Server:** congressgov-mcp-server
|
|
4
|
-
**Version:** 0.3.
|
|
4
|
+
**Version:** 0.3.27
|
|
5
5
|
**Framework:** [@cyanheads/mcp-ts-core](https://www.npmjs.com/package/@cyanheads/mcp-ts-core) `^0.9.16`
|
|
6
6
|
**Engines:** Bun ≥1.3.0, Node ≥24.0.0
|
|
7
7
|
**MCP SDK:** `@modelcontextprotocol/sdk` ^1.29.0
|
|
@@ -68,7 +68,7 @@ Tailor suggestions to what's actually missing or stale — don't recite the full
|
|
|
68
68
|
| `congressgov_enacted_laws` | Browse enacted public and private laws by congress |
|
|
69
69
|
| `congressgov_member_lookup` | Discover members by state/district/congress, retrieve legislative portfolios |
|
|
70
70
|
| `congressgov_committee_lookup` | Browse committees and retrieve legislation, reports, nominations |
|
|
71
|
-
| `congressgov_roll_votes` | Retrieve House roll call votes and member voting positions |
|
|
71
|
+
| `congressgov_roll_votes` | Retrieve House and Senate roll call votes and member voting positions |
|
|
72
72
|
| `congressgov_senate_nominations` | Browse presidential nominations, track Senate confirmation pipeline |
|
|
73
73
|
| `congressgov_bill_summaries` | Browse recent CRS bill summaries — the "what's happening" feed |
|
|
74
74
|
| `congressgov_crs_reports` | Browse and retrieve nonpartisan CRS policy analysis reports |
|
|
@@ -105,6 +105,10 @@ src/
|
|
|
105
105
|
congress-api/
|
|
106
106
|
congress-api-service.ts # API client — auth, pagination, rate limiting
|
|
107
107
|
types.ts # API response types
|
|
108
|
+
senate-lis/
|
|
109
|
+
senate-vote-service.ts # Senate LIS XML client — fetch, retry, not-found
|
|
110
|
+
parse.ts # pure XML → domain parsers (fast-xml-parser)
|
|
111
|
+
types.ts # Senate vote domain types
|
|
108
112
|
mcp-server/
|
|
109
113
|
tools/definitions/
|
|
110
114
|
bill-lookup.tool.ts # congressgov_bill_lookup
|
|
@@ -130,17 +134,23 @@ src/
|
|
|
130
134
|
|
|
131
135
|
---
|
|
132
136
|
|
|
133
|
-
##
|
|
137
|
+
## Services
|
|
134
138
|
|
|
135
|
-
|
|
139
|
+
Two services. `CongressApiService` backs nine tools and the House branch of `congressgov_roll_votes`; `SenateVoteService` backs only the Senate branch of `congressgov_roll_votes` (the Congress.gov API exposes no Senate vote namespace).
|
|
136
140
|
|
|
137
|
-
|
|
138
|
-
- API key via
|
|
141
|
+
**`CongressApiService`** — wraps the Congress.gov REST API v3:
|
|
142
|
+
- API key via `X-Api-Key` header (never logged; kept out of the URL so it can't leak in upstream error messages)
|
|
139
143
|
- Pagination: `offset` + `limit` query params, max 250 per request
|
|
140
144
|
- Rate limiting: 5,000 requests/hour per key
|
|
141
145
|
- Response normalization: request `format=json`, return typed data
|
|
142
146
|
- Native `fetch` — no SDK dependency
|
|
143
147
|
|
|
148
|
+
**`SenateVoteService`** — wraps the Senate's official LIS roll-call XML feed (`senate.gov/legislative/LIS`):
|
|
149
|
+
- No API key, no JSON. XML parsed via `fast-xml-parser` in `parse.ts` (pure, fixture-tested)
|
|
150
|
+
- The whole session menu is one file; each vote's roster ships inline — pagination is client-side
|
|
151
|
+
- The host returns HTTP 200 with an HTML page for unknown congress/session/vote, so "not found" is detected from the body, not the status code
|
|
152
|
+
- Party totals are derived from the roster (the feed publishes none)
|
|
153
|
+
|
|
144
154
|
**Usage in tools:**
|
|
145
155
|
```ts
|
|
146
156
|
import { getCongressApi } from '@/services/congress-api/congress-api-service.js';
|
package/README.md
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
|
|
8
8
|
<div align="center">
|
|
9
9
|
|
|
10
|
-
[](./CHANGELOG.md) [](./LICENSE) [](https://github.com/users/cyanheads/packages/container/package/congressgov-mcp-server) [](https://modelcontextprotocol.io/) [](https://www.npmjs.com/package/@cyanheads/congressgov-mcp-server) [](https://www.typescriptlang.org/) [](https://bun.sh/)
|
|
11
11
|
|
|
12
12
|
</div>
|
|
13
13
|
|
|
@@ -37,7 +37,7 @@ Ten read-only tools for querying U.S. legislative data:
|
|
|
37
37
|
| `congressgov_enacted_laws` | Browse enacted public and private laws by congress |
|
|
38
38
|
| `congressgov_member_lookup` | Discover congressional members by state/district/congress, retrieve legislative portfolios |
|
|
39
39
|
| `congressgov_committee_lookup` | Browse congressional committees and their legislation, reports, and nominations |
|
|
40
|
-
| `congressgov_roll_votes` | Retrieve House roll call
|
|
40
|
+
| `congressgov_roll_votes` | Retrieve House and Senate roll call votes and individual member voting positions |
|
|
41
41
|
| `congressgov_senate_nominations` | Browse presidential nominations to federal positions and track the Senate confirmation process |
|
|
42
42
|
| `congressgov_bill_summaries` | Browse recent CRS bill summaries — the "what's happening" feed |
|
|
43
43
|
| `congressgov_crs_reports` | Browse and retrieve nonpartisan CRS policy analysis reports |
|
|
@@ -78,11 +78,12 @@ Browse congressional committees and their legislation, reports, and nominations.
|
|
|
78
78
|
|
|
79
79
|
### `congressgov_roll_votes`
|
|
80
80
|
|
|
81
|
-
Retrieve House roll call
|
|
81
|
+
Retrieve House and Senate roll call votes and individual member voting positions.
|
|
82
82
|
|
|
83
|
-
-
|
|
84
|
-
-
|
|
85
|
-
- `
|
|
83
|
+
- Set `chamber` to `house` (default, from the Congress.gov API) or `senate` (from the Senate's official LIS feed — the API exposes no Senate votes)
|
|
84
|
+
- `list` browses votes by congress and session, newest first; pass `order='oldest'` for ascending
|
|
85
|
+
- `get` returns the question, result, tallies, party breakdown, and associated bill/nomination/amendment
|
|
86
|
+
- `members` returns each member's recorded position
|
|
86
87
|
|
|
87
88
|
---
|
|
88
89
|
|
package/dist/index.js
CHANGED
|
@@ -22,6 +22,7 @@ import { memberLookupTool } from './mcp-server/tools/definitions/member-lookup.t
|
|
|
22
22
|
import { rollVotesTool } from './mcp-server/tools/definitions/roll-votes.tool.js';
|
|
23
23
|
import { senateNominationsTool } from './mcp-server/tools/definitions/senate-nominations.tool.js';
|
|
24
24
|
import { initCongressApi } from './services/congress-api/congress-api-service.js';
|
|
25
|
+
import { initSenateVoteService } from './services/senate-lis/senate-vote-service.js';
|
|
25
26
|
const REPO_ROOT = 'https://github.com/cyanheads/congressgov-mcp-server';
|
|
26
27
|
/**
|
|
27
28
|
* File names strip the `congressgov_` name prefix (e.g. `congressgov_bill_lookup` →
|
|
@@ -55,7 +56,7 @@ await createApp({
|
|
|
55
56
|
withSource(billAnalysisPrompt, 'prompts', 'bill-analysis.prompt.ts'),
|
|
56
57
|
withSource(legislativeResearchPrompt, 'prompts', 'legislative-research.prompt.ts'),
|
|
57
58
|
],
|
|
58
|
-
instructions: `Use the congressgov_* tools to access U.S. legislative data via the Congress.gov API v3: bills, enacted laws, members, committees,
|
|
59
|
+
instructions: `Use the congressgov_* tools to access U.S. legislative data via the Congress.gov API v3: bills, enacted laws, members, committees, roll call votes, presidential nominations, CRS reports, and the daily Congressional Record. There is no keyword search — browse by congress number, bill/report type, date range, chamber, state, and district. Bills are addressed by congress + billType + billNumber (e.g. 118/hr/1234), members by bioguideId, committees by chamber-prefix codes. congressgov_roll_votes serves both chambers via its 'chamber' parameter — House votes come from the Congress.gov API, Senate votes from the Senate's official LIS feed.`,
|
|
59
60
|
landing: {
|
|
60
61
|
repoRoot: REPO_ROOT,
|
|
61
62
|
tagline: 'U.S. legislative data — bills, votes, members, committees — via MCP.',
|
|
@@ -63,6 +64,7 @@ await createApp({
|
|
|
63
64
|
},
|
|
64
65
|
setup() {
|
|
65
66
|
initCongressApi();
|
|
67
|
+
initSenateVoteService();
|
|
66
68
|
},
|
|
67
69
|
});
|
|
68
70
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAEA;;;GAGG;AAOH,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACnD,OAAO,EAAE,kBAAkB,EAAE,MAAM,0DAA0D,CAAC;AAC9F,OAAO,EAAE,yBAAyB,EAAE,MAAM,iEAAiE,CAAC;AAC5G,OAAO,EAAE,YAAY,EAAE,MAAM,qDAAqD,CAAC;AACnF,OAAO,EAAE,iBAAiB,EAAE,MAAM,2DAA2D,CAAC;AAC9F,OAAO,EAAE,iBAAiB,EAAE,MAAM,0DAA0D,CAAC;AAC7F,OAAO,EAAE,uBAAuB,EAAE,MAAM,iEAAiE,CAAC;AAC1G,OAAO,EAAE,cAA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AAC;QACxE,UAAU,CAAC,iBAAiB,EAAE,OAAO,EAAE,wBAAwB,CAAC;QAChE,UAAU,CAAC,cAAc,EAAE,OAAO,EAAE,qBAAqB,CAAC;QAC1D,UAAU,CAAC,oBAAoB,EAAE,OAAO,EAAE,2BAA2B,CAAC;QACtE,UAAU,CAAC,eAAe,EAAE,OAAO,EAAE,sBAAsB,CAAC;KAC7D;IACD,SAAS,EAAE;QACT,UAAU,CAAC,uBAAuB,EAAE,WAAW,EAAE,8BAA8B,CAAC;QAChF,UAAU,CAAC,iBAAiB,EAAE,WAAW,EAAE,wBAAwB,CAAC;QACpE,UAAU,CAAC,cAAc,EAAE,WAAW,EAAE,oBAAoB,CAAC;QAC7D,UAAU,CAAC,YAAY,EAAE,WAAW,EAAE,kBAAkB,CAAC;QACzD,UAAU,CAAC,iBAAiB,EAAE,WAAW,EAAE,uBAAuB,CAAC;KACpE;IACD,OAAO,EAAE;QACP,UAAU,CAAC,kBAAkB,EAAE,SAAS,EAAE,yBAAyB,CAAC;QACpE,UAAU,CAAC,yBAAyB,EAAE,SAAS,EAAE,gCAAgC,CAAC;KACnF;IACD,YAAY,EAAE,moBAAmoB;IACjpB,OAAO,EAAE;QACP,QAAQ,EAAE,SAAS;QACnB,OAAO,EAAE,sEAAsE;QAC/E,WAAW,EAAE,KAAK;KACnB;IACD,KAAK;QACH,eAAe,EAAE,CAAC;QAClB,qBAAqB,EAAE,CAAC;IAC1B,CAAC;CACF,CAAC,CAAC"}
|
|
@@ -18,6 +18,7 @@ export declare const committeeLookupTool: import("@cyanheads/mcp-ts-core").ToolD
|
|
|
18
18
|
joint: "joint";
|
|
19
19
|
}>>;
|
|
20
20
|
committeeCode: z.ZodOptional<z.ZodString>;
|
|
21
|
+
filter: z.ZodOptional<z.ZodString>;
|
|
21
22
|
limit: z.ZodDefault<z.ZodNumber>;
|
|
22
23
|
offset: z.ZodDefault<z.ZodNumber>;
|
|
23
24
|
order: z.ZodDefault<z.ZodEnum<{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"committee-lookup.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/committee-lookup.tool.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"committee-lookup.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/committee-lookup.tool.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;AAqGjD,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAiK9B,CAAC"}
|
|
@@ -7,6 +7,78 @@ import { validationError } from '@cyanheads/mcp-ts-core/errors';
|
|
|
7
7
|
import { formatCommittees } from '../../../mcp-server/tools/format-helpers.js';
|
|
8
8
|
import { buildEffectiveQuery, congressErrorContracts, listEnrichment, listOrDetail, } from '../../../mcp-server/tools/tool-helpers.js';
|
|
9
9
|
import { getCongressApi } from '../../../services/congress-api/congress-api-service.js';
|
|
10
|
+
// ── Client-side committee name filter ────────────────────────────────────────
|
|
11
|
+
/** Normalize a string for matching: lowercase, strip punctuation/diacritics, collapse whitespace. */
|
|
12
|
+
function normalizeForMatch(str) {
|
|
13
|
+
return str
|
|
14
|
+
.toLowerCase()
|
|
15
|
+
.normalize('NFD')
|
|
16
|
+
.replace(/[̀-ͯ]/g, '')
|
|
17
|
+
.replace(/[^\w\s]/g, ' ')
|
|
18
|
+
.replace(/\s+/g, ' ')
|
|
19
|
+
.trim();
|
|
20
|
+
}
|
|
21
|
+
/** Extract bigrams from a normalized string. */
|
|
22
|
+
function bigrams(str) {
|
|
23
|
+
const result = new Set();
|
|
24
|
+
for (let i = 0; i < str.length - 1; i++)
|
|
25
|
+
result.add(str.slice(i, i + 2));
|
|
26
|
+
return result;
|
|
27
|
+
}
|
|
28
|
+
/** Dice coefficient between two bigram sets. */
|
|
29
|
+
function diceCoeff(a, b) {
|
|
30
|
+
if (a.size === 0 && b.size === 0)
|
|
31
|
+
return 1;
|
|
32
|
+
if (a.size === 0 || b.size === 0)
|
|
33
|
+
return 0;
|
|
34
|
+
let intersection = 0;
|
|
35
|
+
for (const bg of a)
|
|
36
|
+
if (b.has(bg))
|
|
37
|
+
intersection++;
|
|
38
|
+
return (2 * intersection) / (a.size + b.size);
|
|
39
|
+
}
|
|
40
|
+
const FUZZY_THRESHOLD = 0.5;
|
|
41
|
+
const FUZZY_MAX_RESULTS = 5;
|
|
42
|
+
/**
|
|
43
|
+
* Filter a committee list by name using a two-pass strategy:
|
|
44
|
+
* 1. Primary: every token in `filter` appears in the normalized committee name.
|
|
45
|
+
* 2. Fuzzy fallback (only when primary is empty): rank by bigram-Dice similarity of
|
|
46
|
+
* the query against each name's best-matching token (full-name scoring lets long
|
|
47
|
+
* names accrue spurious overlap), keep the top few above the threshold, labeled
|
|
48
|
+
* `approximate: true`.
|
|
49
|
+
*
|
|
50
|
+
* Never throws — no match returns an empty array.
|
|
51
|
+
*/
|
|
52
|
+
function filterCommittees(items, filter) {
|
|
53
|
+
const normFilter = normalizeForMatch(filter);
|
|
54
|
+
const tokens = normFilter.split(' ').filter(Boolean);
|
|
55
|
+
if (tokens.length === 0)
|
|
56
|
+
return items;
|
|
57
|
+
// Primary: all-token match (order-independent, partial-word OK)
|
|
58
|
+
const primary = items.filter((item) => {
|
|
59
|
+
const name = typeof item.name === 'string' ? normalizeForMatch(item.name) : '';
|
|
60
|
+
return tokens.every((tok) => name.includes(tok));
|
|
61
|
+
});
|
|
62
|
+
if (primary.length > 0)
|
|
63
|
+
return primary;
|
|
64
|
+
// Fuzzy fallback: score the query against each name's best-matching token, not
|
|
65
|
+
// the whole name — long committee names share common bigrams with the query and
|
|
66
|
+
// would otherwise rank as spurious "approximate" matches. Keep the top few.
|
|
67
|
+
const filterBigrams = bigrams(normFilter);
|
|
68
|
+
const scored = items
|
|
69
|
+
.map((item) => {
|
|
70
|
+
const name = typeof item.name === 'string' ? normalizeForMatch(item.name) : '';
|
|
71
|
+
const score = Math.max(0, ...name
|
|
72
|
+
.split(' ')
|
|
73
|
+
.filter(Boolean)
|
|
74
|
+
.map((tok) => diceCoeff(filterBigrams, bigrams(tok))));
|
|
75
|
+
return { item, score };
|
|
76
|
+
})
|
|
77
|
+
.filter(({ score }) => score >= FUZZY_THRESHOLD)
|
|
78
|
+
.sort((a, b) => b.score - a.score)
|
|
79
|
+
.slice(0, FUZZY_MAX_RESULTS);
|
|
80
|
+
return scored.map(({ item }) => ({ ...item, approximate: true }));
|
|
81
|
+
}
|
|
10
82
|
/** Committee codes carry chamber in the first letter (h=House, s=Senate, j=Joint). */
|
|
11
83
|
function inferChamberFromCode(code) {
|
|
12
84
|
const first = code[0]?.toLowerCase();
|
|
@@ -19,7 +91,7 @@ function inferChamberFromCode(code) {
|
|
|
19
91
|
return;
|
|
20
92
|
}
|
|
21
93
|
export const committeeLookupTool = tool('congressgov_committee_lookup', {
|
|
22
|
-
description: `Browse congressional committees and their legislation, reports, and nominations. Committee codes follow the pattern chamber-prefix (h/s/j) + abbreviation + number — use 'list' to discover codes, then 'get' or drill into 'bills', 'reports', or 'nominations' ('nominations' is Senate-only). 'get' and sub-resources only need committeeCode (chamber is inferred from the prefix); pass chamber explicitly to override. The 'bills' sub-resource defaults to 'recent' order (newest update-date first); pass order='oldest' for ascending update-date order. Upstream omits bill titles from the 'bills' sub-resource — rows carry only {congress, billType, billNumber, actionDate, relationshipType, url}; chain 'congressgov_bill_lookup get' per row to retrieve titles and policy area.`,
|
|
94
|
+
description: `Browse congressional committees and their legislation, reports, and nominations. Committee codes follow the pattern chamber-prefix (h/s/j) + abbreviation + number — use 'list' (with optional 'filter' for name→code resolution) to discover codes, then 'get' or drill into 'bills', 'reports', or 'nominations' ('nominations' is Senate-only). 'get' and sub-resources only need committeeCode (chamber is inferred from the prefix); pass chamber explicitly to override. The 'bills' sub-resource defaults to 'recent' order (newest update-date first); pass order='oldest' for ascending update-date order. Upstream omits bill titles from the 'bills' sub-resource — rows carry only {congress, billType, billNumber, actionDate, relationshipType, url}; chain 'congressgov_bill_lookup get' per row to retrieve titles and policy area.`,
|
|
23
95
|
annotations: { readOnlyHint: true, idempotentHint: true, openWorldHint: true },
|
|
24
96
|
errors: congressErrorContracts,
|
|
25
97
|
input: z.object({
|
|
@@ -35,6 +107,11 @@ export const committeeLookupTool = tool('congressgov_committee_lookup', {
|
|
|
35
107
|
.string()
|
|
36
108
|
.optional()
|
|
37
109
|
.describe("Committee system code (e.g., 'hsju00'). Required for get and sub-resources."),
|
|
110
|
+
// Provisional param name — tracking fleet-wide convention in cyanheads/mcp-ts-core#186.
|
|
111
|
+
filter: z
|
|
112
|
+
.string()
|
|
113
|
+
.optional()
|
|
114
|
+
.describe("Filter committee list results by name (e.g., 'transportation', 'armed services'). Only meaningful for 'list'. Fetches the full chamber set and matches client-side; fuzzy-matched rows are labeled approximate."),
|
|
38
115
|
limit: z.number().int().min(1).max(250).default(20).describe('Results per page (1-250).'),
|
|
39
116
|
offset: z.number().int().min(0).default(0).describe('Pagination offset.'),
|
|
40
117
|
order: z
|
|
@@ -48,22 +125,43 @@ export const committeeLookupTool = tool('congressgov_committee_lookup', {
|
|
|
48
125
|
async handler(input, ctx) {
|
|
49
126
|
const api = getCongressApi();
|
|
50
127
|
if (input.operation === 'list') {
|
|
128
|
+
const filter = input.filter?.trim() || undefined;
|
|
129
|
+
// When filtering, fetch the full chamber set so client-side matching covers all rows.
|
|
130
|
+
const fetchLimit = filter ? 250 : input.limit;
|
|
131
|
+
const fetchOffset = filter ? 0 : input.offset;
|
|
51
132
|
const result = await api.listCommittees({
|
|
52
133
|
congress: input.congress,
|
|
53
134
|
chamber: input.chamber,
|
|
54
|
-
limit:
|
|
55
|
-
offset:
|
|
135
|
+
limit: fetchLimit,
|
|
136
|
+
offset: fetchOffset,
|
|
56
137
|
}, ctx);
|
|
57
|
-
|
|
58
|
-
ctx.
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
138
|
+
const matched = filter ? filterCommittees(result.data, filter) : result.data;
|
|
139
|
+
ctx.log.info('Committees listed', {
|
|
140
|
+
count: matched.length,
|
|
141
|
+
total: result.pagination.count,
|
|
142
|
+
filter,
|
|
143
|
+
});
|
|
144
|
+
ctx.enrich.echo(buildEffectiveQuery('committees', {
|
|
145
|
+
congress: input.congress,
|
|
146
|
+
chamber: input.chamber,
|
|
147
|
+
filter,
|
|
148
|
+
}));
|
|
149
|
+
ctx.enrich.total(filter ? matched.length : result.pagination.count);
|
|
150
|
+
if (matched.length === 0)
|
|
151
|
+
ctx.enrich.notice(filter
|
|
152
|
+
? `No committees matched '${filter}'. Call 'list' without filter to browse all committees.`
|
|
153
|
+
: 'No committees found. Try removing the chamber filter or check the congress number.');
|
|
154
|
+
return filter
|
|
155
|
+
? { ...result, data: matched, pagination: { count: matched.length, nextOffset: null } }
|
|
156
|
+
: { ...result, data: matched };
|
|
63
157
|
}
|
|
64
158
|
if (!input.committeeCode) {
|
|
65
159
|
throw validationError(`The '${input.operation}' operation requires committeeCode. Use 'list' to discover available committees.`, { operation: input.operation, committeeCode: input.committeeCode });
|
|
66
160
|
}
|
|
161
|
+
// Pre-validate: a committeeCode containing whitespace is a name, not a code.
|
|
162
|
+
if (/\s/.test(input.committeeCode)) {
|
|
163
|
+
throw validationError(`committeeCode '${input.committeeCode}' contains whitespace — that looks like a committee name, not a code. Committee system codes look like \`hspw00\` (chamber prefix + abbreviation + digits). Use \`operation: 'list'\` with \`filter\` to find the code for a committee by name.`, { field: 'committeeCode', committeeCode: input.committeeCode });
|
|
164
|
+
}
|
|
67
165
|
const chamber = input.chamber ?? inferChamberFromCode(input.committeeCode);
|
|
68
166
|
if (!chamber) {
|
|
69
167
|
throw validationError(`Could not infer chamber from committeeCode '${input.committeeCode}'. Pass chamber explicitly ('house', 'senate', or 'joint').`, { field: 'committeeCode', committeeCode: input.committeeCode });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"committee-lookup.tool.js","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/committee-lookup.tool.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAEhE,OAAO,EAAE,gBAAgB,EAAE,MAAM,sCAAsC,CAAC;AACxE,OAAO,EACL,mBAAmB,EACnB,sBAAsB,EACtB,cAAc,EACd,YAAY,GACb,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EAAE,cAAc,EAAE,MAAM,iDAAiD,CAAC;AAGjF,sFAAsF;AACtF,SAAS,oBAAoB,CAAC,IAAY;IACxC,MAAM,KAAK,GAAG,IAAI,CAAC,CAAC,CAAC,EAAE,WAAW,EAAE,CAAC;IACrC,IAAI,KAAK,KAAK,GAAG;QAAE,OAAO,QAAQ,CAAC;IACnC,IAAI,KAAK,KAAK,GAAG;QAAE,OAAO,OAAO,CAAC;IAClC,IAAI,KAAK,KAAK,GAAG;QAAE,OAAO,OAAO,CAAC;IAClC,OAAO;AACT,CAAC;AAED,MAAM,CAAC,MAAM,mBAAmB,GAAG,IAAI,CAAC,8BAA8B,EAAE;IACtE,WAAW,EAAE,
|
|
1
|
+
{"version":3,"file":"committee-lookup.tool.js","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/committee-lookup.tool.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAEhE,OAAO,EAAE,gBAAgB,EAAE,MAAM,sCAAsC,CAAC;AACxE,OAAO,EACL,mBAAmB,EACnB,sBAAsB,EACtB,cAAc,EACd,YAAY,GACb,MAAM,oCAAo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view Tool for retrieving House roll call vote data and member
|
|
2
|
+
* @fileoverview Tool for retrieving House and Senate roll call vote data and member
|
|
3
|
+
* voting positions. House votes come from the Congress.gov API; Senate votes from the
|
|
4
|
+
* Senate's official LIS XML feed (the API exposes no Senate vote namespace).
|
|
3
5
|
* @module mcp-server/tools/definitions/roll-votes
|
|
4
6
|
*/
|
|
5
7
|
import { z } from '@cyanheads/mcp-ts-core';
|
|
@@ -9,6 +11,10 @@ export declare const rollVotesTool: import("@cyanheads/mcp-ts-core").ToolDefinit
|
|
|
9
11
|
get: "get";
|
|
10
12
|
list: "list";
|
|
11
13
|
}>;
|
|
14
|
+
chamber: z.ZodDefault<z.ZodEnum<{
|
|
15
|
+
house: "house";
|
|
16
|
+
senate: "senate";
|
|
17
|
+
}>>;
|
|
12
18
|
congress: z.ZodNumber;
|
|
13
19
|
session: z.ZodNumber;
|
|
14
20
|
voteNumber: z.ZodOptional<z.ZodNumber>;
|
|
@@ -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
|
|
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;AAajD,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA0HxB,CAAC"}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @fileoverview Tool for retrieving House roll call vote data and member
|
|
2
|
+
* @fileoverview Tool for retrieving House and Senate roll call vote data and member
|
|
3
|
+
* voting positions. House votes come from the Congress.gov API; Senate votes from the
|
|
4
|
+
* Senate's official LIS XML feed (the API exposes no Senate vote namespace).
|
|
3
5
|
* @module mcp-server/tools/definitions/roll-votes
|
|
4
6
|
*/
|
|
5
7
|
import { tool, z } from '@cyanheads/mcp-ts-core';
|
|
@@ -7,12 +9,17 @@ import { validationError } from '@cyanheads/mcp-ts-core/errors';
|
|
|
7
9
|
import { formatVotes } from '../../../mcp-server/tools/format-helpers.js';
|
|
8
10
|
import { buildEffectiveQuery, congressErrorContracts, listEnrichment, listOrDetail, } from '../../../mcp-server/tools/tool-helpers.js';
|
|
9
11
|
import { getCongressApi } from '../../../services/congress-api/congress-api-service.js';
|
|
12
|
+
import { getSenateVoteService } from '../../../services/senate-lis/senate-vote-service.js';
|
|
10
13
|
export const rollVotesTool = tool('congressgov_roll_votes', {
|
|
11
|
-
description: `Retrieve
|
|
14
|
+
description: `Retrieve U.S. congressional roll call votes and individual member voting positions for either chamber. Set 'chamber' to 'house' (default, from the Congress.gov API) or 'senate' (from the Senate's official LIS feed). Use 'list' to find votes by congress and session (newest first by default), 'get' for vote details (question, result, tallies, party breakdown, associated bill/nomination/amendment), or 'members' for how each member voted.`,
|
|
12
15
|
annotations: { readOnlyHint: true, idempotentHint: true, openWorldHint: true },
|
|
13
16
|
errors: congressErrorContracts,
|
|
14
17
|
input: z.object({
|
|
15
18
|
operation: z.enum(['list', 'get', 'members']).describe('Which data to retrieve.'),
|
|
19
|
+
chamber: z
|
|
20
|
+
.enum(['house', 'senate'])
|
|
21
|
+
.default('house')
|
|
22
|
+
.describe("Chamber whose votes to query. 'house' (default) draws from the Congress.gov API; 'senate' draws from the Senate's official LIS roll-call feed. Roll call numbers reset each session and are specific to one chamber."),
|
|
16
23
|
congress: z.number().int().positive().describe('Congress number.'),
|
|
17
24
|
session: z
|
|
18
25
|
.number()
|
|
@@ -29,7 +36,7 @@ export const rollVotesTool = tool('congressgov_roll_votes', {
|
|
|
29
36
|
order: z
|
|
30
37
|
.enum(['recent', 'oldest'])
|
|
31
38
|
.default('recent')
|
|
32
|
-
.describe("Sort order for 'list'
|
|
39
|
+
.describe("Sort order for 'list'. 'recent' (default) returns newest first; 'oldest' returns ascending. House sorts by vote update date (with 'recent', offset=0 always returns the strictly newest page); Senate sorts by roll call number. Ignored by 'get' and 'members'."),
|
|
33
40
|
limit: z.number().int().min(1).max(250).default(20).describe('Results per page (1-250).'),
|
|
34
41
|
offset: z.number().int().min(0).default(0).describe('Pagination offset.'),
|
|
35
42
|
}),
|
|
@@ -37,6 +44,9 @@ export const rollVotesTool = tool('congressgov_roll_votes', {
|
|
|
37
44
|
enrichment: listEnrichment,
|
|
38
45
|
format: formatVotes,
|
|
39
46
|
async handler(input, ctx) {
|
|
47
|
+
if (input.chamber === 'senate') {
|
|
48
|
+
return handleSenateVotes(input, ctx);
|
|
49
|
+
}
|
|
40
50
|
const api = getCongressApi();
|
|
41
51
|
if (input.operation === 'list') {
|
|
42
52
|
const effectiveQuery = buildEffectiveQuery('roll call votes', {
|
|
@@ -93,6 +103,57 @@ export const rollVotesTool = tool('congressgov_roll_votes', {
|
|
|
93
103
|
return result;
|
|
94
104
|
},
|
|
95
105
|
});
|
|
106
|
+
/**
|
|
107
|
+
* Senate branch of `congressgov_roll_votes`. Mirrors the House operation surface
|
|
108
|
+
* (`list` / `get` / `members`) but sources data from the Senate LIS XML feed via
|
|
109
|
+
* `SenateVoteService`. The feed serves a whole session's menu in one file and each
|
|
110
|
+
* vote's roster inline, so pagination is client-side (handled in the service).
|
|
111
|
+
*/
|
|
112
|
+
async function handleSenateVotes(input, ctx) {
|
|
113
|
+
const senate = getSenateVoteService();
|
|
114
|
+
if (input.operation === 'list') {
|
|
115
|
+
const result = await senate.listVotes({
|
|
116
|
+
congress: input.congress,
|
|
117
|
+
session: input.session,
|
|
118
|
+
order: input.order,
|
|
119
|
+
limit: input.limit,
|
|
120
|
+
offset: input.offset,
|
|
121
|
+
}, ctx);
|
|
122
|
+
ctx.log.info('Senate votes listed', { congress: input.congress, session: input.session });
|
|
123
|
+
ctx.enrich.echo(buildEffectiveQuery('Senate roll call votes', {
|
|
124
|
+
congress: input.congress,
|
|
125
|
+
session: input.session,
|
|
126
|
+
}));
|
|
127
|
+
ctx.enrich.total(result.pagination.count);
|
|
128
|
+
if (result.data.length === 0) {
|
|
129
|
+
ctx.enrich.notice('No Senate votes found. Verify the congress and session — the Senate publishes roll call votes from the 101st Congress (1989) onward.');
|
|
130
|
+
}
|
|
131
|
+
return result;
|
|
132
|
+
}
|
|
133
|
+
if (!input.voteNumber) {
|
|
134
|
+
throw validationError(`The '${input.operation}' operation requires voteNumber. Use 'list' to browse available votes.`, { field: 'voteNumber', operation: input.operation });
|
|
135
|
+
}
|
|
136
|
+
const voteParams = {
|
|
137
|
+
congress: input.congress,
|
|
138
|
+
session: input.session,
|
|
139
|
+
voteNumber: input.voteNumber,
|
|
140
|
+
};
|
|
141
|
+
if (input.operation === 'members') {
|
|
142
|
+
const result = await senate.getVoteMembers({ ...voteParams, limit: input.limit, offset: input.offset }, ctx);
|
|
143
|
+
ctx.log.info('Senate vote retrieved', { ...voteParams, operation: input.operation });
|
|
144
|
+
ctx.enrich.echo(`member votes for Senate roll ${input.voteNumber} in the ${input.congress}th Congress, session ${input.session}`);
|
|
145
|
+
ctx.enrich.total(result.pagination.count);
|
|
146
|
+
if (result.data.length === 0) {
|
|
147
|
+
ctx.enrich.notice(`No member vote records found for Senate roll ${input.voteNumber}.`);
|
|
148
|
+
}
|
|
149
|
+
return result;
|
|
150
|
+
}
|
|
151
|
+
const result = await senate.getVote(voteParams, ctx);
|
|
152
|
+
ctx.log.info('Senate vote retrieved', { ...voteParams, operation: input.operation });
|
|
153
|
+
ctx.enrich.echo(`Senate roll call ${input.voteNumber} in the ${input.congress}th Congress, session ${input.session}`);
|
|
154
|
+
ctx.enrich.total(1);
|
|
155
|
+
return result;
|
|
156
|
+
}
|
|
96
157
|
/**
|
|
97
158
|
* Fetch roll call votes in strict newest-first order. The /house-vote/{c}/{s}
|
|
98
159
|
* endpoint returns rows in opaque insertion order (loosely correlated with roll
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"roll-votes.tool.js","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/roll-votes.tool.ts"],"names":[],"mappings":"AAAA
|
|
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;AACjD,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAEhE,OAAO,EAAE,WAAW,EAAE,MAAM,sCAAsC,CAAC;AACnE,OAAO,EACL,mBAAmB,EACnB,sBAAsB,EACtB,cAAc,EACd,YAAY,GACb,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EAAE,cAAc,EAAE,MAAM,iDAAiD,CAAC;AACjF,OAAO,EAAE,oBAAoB,EAAE,MAAM,8CAA8C,CAAC;AAEpF,MAAM,CAAC,MAAM,aAAa,GAAG,IAAI,CAAC,wBAAwB,EAAE;IAC1D,WAAW,EAAE,wbAAwb;IACrc,WAAW,EAAE,EAAE,YAAY,EAAE,IAAI,EAAE,cAAc,EAAE,IAAI,EAAE,aAAa,EAAE,IAAI,EAAE;IAC9E,MAAM,EAAE,sBAAsB;IAC9B,KAAK,EAAE,CAAC,CAAC,MAAM,CAAC;QACd,SAAS,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,KAAK,EAAE,SAAS,CAAC,CAAC,CAAC,QAAQ,CAAC,yBAAyB,CAAC;QACjF,OAAO,EAAE,CAAC;aACP,IAAI,CAAC,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC;aACzB,OAAO,CAAC,OAAO,CAAC;aAChB,QAAQ,CACP,sNAAsN,CACvN;QACH,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,kBAAkB,CAAC;QAClE,OAAO,EAA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ACzB,OAAO,EAAE,MAAM,CAAC,OAAO;QACvB,KAAK,EAAE,GAAG,CAAC,MAAM;QACjB,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"}
|
|
@@ -30,7 +30,11 @@ export declare function formatCrsReports(result: Record<string, unknown>): TextB
|
|
|
30
30
|
export declare function formatDailyRecord(result: Record<string, unknown>): TextBlock[];
|
|
31
31
|
/** Enacted public and private laws. Upstream /law mirrors /bill, so reuse bill formatters. */
|
|
32
32
|
export declare const formatLaws: (result: Record<string, unknown>) => TextBlock[];
|
|
33
|
-
/**
|
|
33
|
+
/**
|
|
34
|
+
* Roll call votes and member voting positions for both chambers. House payloads
|
|
35
|
+
* come from the Congress.gov JSON API; Senate payloads from the LIS XML feed and
|
|
36
|
+
* carry a `chamber: 'senate'` marker — dispatch to the matching renderer set.
|
|
37
|
+
*/
|
|
34
38
|
export declare function formatVotes(result: Record<string, unknown>): TextBlock[];
|
|
35
39
|
/** Presidential nominations and Senate confirmation pipeline. */
|
|
36
40
|
export declare function formatNominations(result: Record<string, unknown>): TextBlock[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"format-helpers.d.ts","sourceRoot":"","sources":["../../../src/mcp-server/tools/format-helpers.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,KAAK,SAAS,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC;
|
|
1
|
+
{"version":3,"file":"format-helpers.d.ts","sourceRoot":"","sources":["../../../src/mcp-server/tools/format-helpers.ts"],"names":[],"mappings":"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