@cyanheads/openstates-mcp-server 0.1.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/CLAUDE.md +397 -0
- package/Dockerfile +99 -0
- package/LICENSE +201 -0
- package/README.md +324 -0
- package/changelog/0.1.x/0.1.0.md +23 -0
- package/changelog/0.1.x/0.1.1.md +29 -0
- package/changelog/template.md +119 -0
- package/dist/config/server-config.d.ts +13 -0
- package/dist/config/server-config.d.ts.map +1 -0
- package/dist/config/server-config.js +19 -0
- package/dist/config/server-config.js.map +1 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +50 -0
- package/dist/index.js.map +1 -0
- package/dist/mcp-server/prompts/definitions/bill-research.prompt.d.ts +11 -0
- package/dist/mcp-server/prompts/definitions/bill-research.prompt.d.ts.map +1 -0
- package/dist/mcp-server/prompts/definitions/bill-research.prompt.js +65 -0
- package/dist/mcp-server/prompts/definitions/bill-research.prompt.js.map +1 -0
- package/dist/mcp-server/prompts/definitions/legislator-profile.prompt.d.ts +10 -0
- package/dist/mcp-server/prompts/definitions/legislator-profile.prompt.d.ts.map +1 -0
- package/dist/mcp-server/prompts/definitions/legislator-profile.prompt.js +55 -0
- package/dist/mcp-server/prompts/definitions/legislator-profile.prompt.js.map +1 -0
- package/dist/mcp-server/resources/definitions/jurisdiction.resource.d.ts +9 -0
- package/dist/mcp-server/resources/definitions/jurisdiction.resource.d.ts.map +1 -0
- package/dist/mcp-server/resources/definitions/jurisdiction.resource.js +60 -0
- package/dist/mcp-server/resources/definitions/jurisdiction.resource.js.map +1 -0
- package/dist/mcp-server/tools/definitions/get-bill.tool.d.ts +121 -0
- package/dist/mcp-server/tools/definitions/get-bill.tool.d.ts.map +1 -0
- package/dist/mcp-server/tools/definitions/get-bill.tool.js +319 -0
- package/dist/mcp-server/tools/definitions/get-bill.tool.js.map +1 -0
- package/dist/mcp-server/tools/definitions/get-committee.tool.d.ts +30 -0
- package/dist/mcp-server/tools/definitions/get-committee.tool.d.ts.map +1 -0
- package/dist/mcp-server/tools/definitions/get-committee.tool.js +89 -0
- package/dist/mcp-server/tools/definitions/get-committee.tool.js.map +1 -0
- package/dist/mcp-server/tools/definitions/get-event.tool.d.ts +65 -0
- package/dist/mcp-server/tools/definitions/get-event.tool.d.ts.map +1 -0
- package/dist/mcp-server/tools/definitions/get-event.tool.js +231 -0
- package/dist/mcp-server/tools/definitions/get-event.tool.js.map +1 -0
- package/dist/mcp-server/tools/definitions/get-jurisdiction.tool.d.ts +34 -0
- package/dist/mcp-server/tools/definitions/get-jurisdiction.tool.d.ts.map +1 -0
- package/dist/mcp-server/tools/definitions/get-jurisdiction.tool.js +99 -0
- package/dist/mcp-server/tools/definitions/get-jurisdiction.tool.js.map +1 -0
- package/dist/mcp-server/tools/definitions/get-legislators-by-location.tool.d.ts +53 -0
- package/dist/mcp-server/tools/definitions/get-legislators-by-location.tool.d.ts.map +1 -0
- package/dist/mcp-server/tools/definitions/get-legislators-by-location.tool.js +156 -0
- package/dist/mcp-server/tools/definitions/get-legislators-by-location.tool.js.map +1 -0
- package/dist/mcp-server/tools/definitions/list-jurisdictions.tool.d.ts +42 -0
- package/dist/mcp-server/tools/definitions/list-jurisdictions.tool.d.ts.map +1 -0
- package/dist/mcp-server/tools/definitions/list-jurisdictions.tool.js +110 -0
- package/dist/mcp-server/tools/definitions/list-jurisdictions.tool.js.map +1 -0
- package/dist/mcp-server/tools/definitions/search-bills.tool.d.ts +102 -0
- package/dist/mcp-server/tools/definitions/search-bills.tool.d.ts.map +1 -0
- package/dist/mcp-server/tools/definitions/search-bills.tool.js +285 -0
- package/dist/mcp-server/tools/definitions/search-bills.tool.js.map +1 -0
- package/dist/mcp-server/tools/definitions/search-committees.tool.d.ts +44 -0
- package/dist/mcp-server/tools/definitions/search-committees.tool.d.ts.map +1 -0
- package/dist/mcp-server/tools/definitions/search-committees.tool.js +127 -0
- package/dist/mcp-server/tools/definitions/search-committees.tool.js.map +1 -0
- package/dist/mcp-server/tools/definitions/search-events.tool.d.ts +62 -0
- package/dist/mcp-server/tools/definitions/search-events.tool.d.ts.map +1 -0
- package/dist/mcp-server/tools/definitions/search-events.tool.js +198 -0
- package/dist/mcp-server/tools/definitions/search-events.tool.js.map +1 -0
- package/dist/mcp-server/tools/definitions/search-people.tool.d.ts +64 -0
- package/dist/mcp-server/tools/definitions/search-people.tool.d.ts.map +1 -0
- package/dist/mcp-server/tools/definitions/search-people.tool.js +193 -0
- package/dist/mcp-server/tools/definitions/search-people.tool.js.map +1 -0
- package/dist/services/openstates/openstates-service.d.ts +30 -0
- package/dist/services/openstates/openstates-service.d.ts.map +1 -0
- package/dist/services/openstates/openstates-service.js +246 -0
- package/dist/services/openstates/openstates-service.js.map +1 -0
- package/dist/services/openstates/types.d.ts +324 -0
- package/dist/services/openstates/types.d.ts.map +1 -0
- package/dist/services/openstates/types.js +6 -0
- package/dist/services/openstates/types.js.map +1 -0
- package/package.json +91 -0
- package/server.json +99 -0
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview List all jurisdictions covered by Open States.
|
|
3
|
+
* @module mcp-server/tools/definitions/list-jurisdictions
|
|
4
|
+
*/
|
|
5
|
+
import { z } from '@cyanheads/mcp-ts-core';
|
|
6
|
+
export declare const listJurisdictions: import("@cyanheads/mcp-ts-core").ToolDefinition<z.ZodObject<{
|
|
7
|
+
classification: z.ZodDefault<z.ZodEnum<{
|
|
8
|
+
state: "state";
|
|
9
|
+
municipality: "municipality";
|
|
10
|
+
country: "country";
|
|
11
|
+
}>>;
|
|
12
|
+
include: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
13
|
+
legislative_sessions: "legislative_sessions";
|
|
14
|
+
organizations: "organizations";
|
|
15
|
+
latest_runs: "latest_runs";
|
|
16
|
+
}>>>;
|
|
17
|
+
page: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
|
|
18
|
+
per_page: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
|
|
19
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
20
|
+
results: z.ZodArray<z.ZodObject<{
|
|
21
|
+
id: z.ZodString;
|
|
22
|
+
name: z.ZodString;
|
|
23
|
+
classification: z.ZodString;
|
|
24
|
+
url: z.ZodString;
|
|
25
|
+
latest_bill_update: z.ZodString;
|
|
26
|
+
latest_people_update: z.ZodString;
|
|
27
|
+
legislative_sessions: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
28
|
+
identifier: z.ZodString;
|
|
29
|
+
name: z.ZodString;
|
|
30
|
+
classification: z.ZodString;
|
|
31
|
+
start_date: z.ZodString;
|
|
32
|
+
end_date: z.ZodString;
|
|
33
|
+
}, z.core.$strip>>>;
|
|
34
|
+
}, z.core.$strip>>;
|
|
35
|
+
pagination: z.ZodObject<{
|
|
36
|
+
page: z.ZodNumber;
|
|
37
|
+
per_page: z.ZodNumber;
|
|
38
|
+
max_page: z.ZodNumber;
|
|
39
|
+
total_items: z.ZodNumber;
|
|
40
|
+
}, z.core.$strip>;
|
|
41
|
+
}, z.core.$strip>, undefined>;
|
|
42
|
+
//# sourceMappingURL=list-jurisdictions.tool.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list-jurisdictions.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/list-jurisdictions.tool.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;AAKjD,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;6BAuH5B,CAAC"}
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview List all jurisdictions covered by Open States.
|
|
3
|
+
* @module mcp-server/tools/definitions/list-jurisdictions
|
|
4
|
+
*/
|
|
5
|
+
import { tool, z } from '@cyanheads/mcp-ts-core';
|
|
6
|
+
import { getOpenStatesApiService } from '../../../services/openstates/openstates-service.js';
|
|
7
|
+
const JurisdictionIncludeEnum = z.enum(['organizations', 'legislative_sessions', 'latest_runs']);
|
|
8
|
+
export const listJurisdictions = tool('openstates_list_jurisdictions', {
|
|
9
|
+
title: 'List Jurisdictions',
|
|
10
|
+
description: 'List all jurisdictions covered by Open States — all 50 states, DC, and Puerto Rico. Returns coverage metadata: latest bill update time, latest people update time, and optionally all legislative sessions with their identifiers. Use this when you need to discover valid session identifiers for a state before calling openstates_search_bills with a session filter. The legislative_sessions include option returns all historical and current sessions — always check valid session identifiers here before using them in bill searches, since formats vary widely by state (e.g., "2025", "2025-2026", "2025rs", "2025s1").',
|
|
11
|
+
annotations: { readOnlyHint: true, idempotentHint: true, openWorldHint: true },
|
|
12
|
+
input: z.object({
|
|
13
|
+
classification: z
|
|
14
|
+
.enum(['state', 'municipality', 'country'])
|
|
15
|
+
.default('state')
|
|
16
|
+
.describe('Filter by jurisdiction type. Use "state" (default) for all 50 states, DC, and Puerto Rico.'),
|
|
17
|
+
include: z
|
|
18
|
+
.array(JurisdictionIncludeEnum)
|
|
19
|
+
.optional()
|
|
20
|
+
.describe('Related data to inline. "legislative_sessions" returns all session identifiers and date ranges — required when you need to discover valid session values for bill searches.'),
|
|
21
|
+
page: z.coerce.number().int().min(1).default(1).describe('Page number (1-indexed).'),
|
|
22
|
+
per_page: z.coerce
|
|
23
|
+
.number()
|
|
24
|
+
.int()
|
|
25
|
+
.min(1)
|
|
26
|
+
.max(52)
|
|
27
|
+
.default(52)
|
|
28
|
+
.describe('Results per page. Default 52 to cover all states, DC, and Puerto Rico in one request.'),
|
|
29
|
+
}),
|
|
30
|
+
output: z.object({
|
|
31
|
+
results: z
|
|
32
|
+
.array(z
|
|
33
|
+
.object({
|
|
34
|
+
id: z
|
|
35
|
+
.string()
|
|
36
|
+
.describe('OCD jurisdiction ID — use as jurisdiction filter in other tools.'),
|
|
37
|
+
name: z.string().describe('Jurisdiction name (e.g., "Washington").'),
|
|
38
|
+
classification: z.string().describe('Jurisdiction type: "state", "municipality", etc.'),
|
|
39
|
+
url: z.string().describe('Official legislature URL.'),
|
|
40
|
+
latest_bill_update: z
|
|
41
|
+
.string()
|
|
42
|
+
.describe('ISO 8601 timestamp of most recent bill data update.'),
|
|
43
|
+
latest_people_update: z
|
|
44
|
+
.string()
|
|
45
|
+
.describe('ISO 8601 timestamp of most recent people data update.'),
|
|
46
|
+
legislative_sessions: z
|
|
47
|
+
.array(z
|
|
48
|
+
.object({
|
|
49
|
+
identifier: z
|
|
50
|
+
.string()
|
|
51
|
+
.describe('Session identifier — use as session= in bill searches.'),
|
|
52
|
+
name: z.string().describe('Human-readable session name.'),
|
|
53
|
+
classification: z.string().describe('Session type: "primary", "special", etc.'),
|
|
54
|
+
start_date: z.string().describe('Session start date.'),
|
|
55
|
+
end_date: z.string().describe('Session end date.'),
|
|
56
|
+
})
|
|
57
|
+
.describe('Legislative session record.'))
|
|
58
|
+
.optional()
|
|
59
|
+
.describe('Legislative sessions when include=legislative_sessions is requested.'),
|
|
60
|
+
})
|
|
61
|
+
.describe('Jurisdiction record.'))
|
|
62
|
+
.describe('Jurisdictions matching the filter.'),
|
|
63
|
+
pagination: z
|
|
64
|
+
.object({
|
|
65
|
+
page: z.number().describe('Current page number.'),
|
|
66
|
+
per_page: z.number().describe('Results per page.'),
|
|
67
|
+
max_page: z.number().describe('Total number of pages.'),
|
|
68
|
+
total_items: z.number().describe('Total matching jurisdictions.'),
|
|
69
|
+
})
|
|
70
|
+
.describe('Pagination metadata.'),
|
|
71
|
+
}),
|
|
72
|
+
async handler(input, ctx) {
|
|
73
|
+
const svc = getOpenStatesApiService();
|
|
74
|
+
const result = await svc.listJurisdictions({
|
|
75
|
+
classification: input.classification,
|
|
76
|
+
include: input.include && input.include.length > 0 ? input.include : undefined,
|
|
77
|
+
page: input.page,
|
|
78
|
+
per_page: input.per_page,
|
|
79
|
+
}, ctx);
|
|
80
|
+
ctx.log.info('Listed jurisdictions', {
|
|
81
|
+
classification: input.classification,
|
|
82
|
+
count: result.results.length,
|
|
83
|
+
total: result.pagination.total_items,
|
|
84
|
+
});
|
|
85
|
+
return result;
|
|
86
|
+
},
|
|
87
|
+
format: (result) => {
|
|
88
|
+
const lines = [
|
|
89
|
+
`**${result.pagination.total_items} jurisdictions** (page ${result.pagination.page}/${result.pagination.max_page}, per page ${result.pagination.per_page})`,
|
|
90
|
+
];
|
|
91
|
+
for (const jur of result.results) {
|
|
92
|
+
lines.push('');
|
|
93
|
+
lines.push(`## ${jur.name}`);
|
|
94
|
+
lines.push(`**ID:** ${jur.id}`);
|
|
95
|
+
lines.push(`**Classification:** ${jur.classification}`);
|
|
96
|
+
lines.push(`**URL:** ${jur.url}`);
|
|
97
|
+
lines.push(`**Latest bill update:** ${jur.latest_bill_update}`);
|
|
98
|
+
lines.push(`**Latest people update:** ${jur.latest_people_update}`);
|
|
99
|
+
if (jur.legislative_sessions?.length) {
|
|
100
|
+
lines.push('');
|
|
101
|
+
lines.push('**Legislative sessions:**');
|
|
102
|
+
for (const s of jur.legislative_sessions) {
|
|
103
|
+
lines.push(`- \`${s.identifier}\` — ${s.name} (${s.classification}) ${s.start_date}–${s.end_date}`);
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
return [{ type: 'text', text: lines.join('\n') }];
|
|
108
|
+
},
|
|
109
|
+
});
|
|
110
|
+
//# sourceMappingURL=list-jurisdictions.tool.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list-jurisdictions.tool.js","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/list-jurisdictions.tool.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,uBAAuB,EAAE,MAAM,6CAA6C,CAAC;AAEtF,MAAM,uBAAuB,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,eAAe,EA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CAAC,CAAC;YAChC,KAAK,CAAC,IAAI,CAAC,uBAAuB,GAAG,CAAC,cAAc,EAAE,CAAC,CAAC;YACxD,KAAK,CAAC,IAAI,CAAC,YAAY,GAAG,CAAC,GAAG,EAAE,CAAC,CAAC;YAClC,KAAK,CAAC,IAAI,CAAC,2BAA2B,GAAG,CAAC,kBAAkB,EAAE,CAAC,CAAC;YAChE,KAAK,CAAC,IAAI,CAAC,6BAA6B,GAAG,CAAC,oBAAoB,EAAE,CAAC,CAAC;YACpE,IAAI,GAAG,CAAC,oBAAoB,EAAE,MAAM,EAAE,CAAC;gBACrC,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;gBACf,KAAK,CAAC,IAAI,CAAC,2BAA2B,CAAC,CAAC;gBACxC,KAAK,MAAM,CAAC,IAAI,GAAG,CAAC,oBAAoB,EAAE,CAAC;oBACzC,KAAK,CAAC,IAAI,CACR,OAAO,CAAC,CAAC,UAAU,QAAQ,CAAC,CAAC,IAAI,KAAK,CAAC,CAAC,cAAc,KAAK,CAAC,CAAC,UAAU,IAAI,CAAC,CAAC,QAAQ,EAAE,CACxF,CAAC;gBACJ,CAAC;YACH,CAAC;QACH,CAAC;QACD,OAAO,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACpD,CAAC;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Search state legislative bills across all covered US jurisdictions.
|
|
3
|
+
* @module mcp-server/tools/definitions/search-bills
|
|
4
|
+
*/
|
|
5
|
+
import { z } from '@cyanheads/mcp-ts-core';
|
|
6
|
+
import { JsonRpcErrorCode } from '@cyanheads/mcp-ts-core/errors';
|
|
7
|
+
export declare const searchBills: import("@cyanheads/mcp-ts-core").ToolDefinition<z.ZodObject<{
|
|
8
|
+
jurisdiction: z.ZodOptional<z.ZodString>;
|
|
9
|
+
q: z.ZodOptional<z.ZodString>;
|
|
10
|
+
session: z.ZodOptional<z.ZodString>;
|
|
11
|
+
chamber: z.ZodOptional<z.ZodEnum<{
|
|
12
|
+
upper: "upper";
|
|
13
|
+
lower: "lower";
|
|
14
|
+
}>>;
|
|
15
|
+
classification: z.ZodOptional<z.ZodString>;
|
|
16
|
+
subject: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
17
|
+
sponsor: z.ZodOptional<z.ZodString>;
|
|
18
|
+
sponsor_classification: z.ZodOptional<z.ZodString>;
|
|
19
|
+
sort: z.ZodDefault<z.ZodEnum<{
|
|
20
|
+
updated_asc: "updated_asc";
|
|
21
|
+
updated_desc: "updated_desc";
|
|
22
|
+
first_action_asc: "first_action_asc";
|
|
23
|
+
first_action_desc: "first_action_desc";
|
|
24
|
+
latest_action_asc: "latest_action_asc";
|
|
25
|
+
latest_action_desc: "latest_action_desc";
|
|
26
|
+
}>>;
|
|
27
|
+
action_since: z.ZodOptional<z.ZodString>;
|
|
28
|
+
updated_since: z.ZodOptional<z.ZodString>;
|
|
29
|
+
include: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
30
|
+
sponsorships: "sponsorships";
|
|
31
|
+
abstracts: "abstracts";
|
|
32
|
+
other_titles: "other_titles";
|
|
33
|
+
other_identifiers: "other_identifiers";
|
|
34
|
+
actions: "actions";
|
|
35
|
+
sources: "sources";
|
|
36
|
+
documents: "documents";
|
|
37
|
+
versions: "versions";
|
|
38
|
+
votes: "votes";
|
|
39
|
+
related_bills: "related_bills";
|
|
40
|
+
}>>>;
|
|
41
|
+
page: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
|
|
42
|
+
per_page: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
|
|
43
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
44
|
+
results: z.ZodArray<z.ZodObject<{
|
|
45
|
+
id: z.ZodString;
|
|
46
|
+
identifier: z.ZodString;
|
|
47
|
+
title: z.ZodString;
|
|
48
|
+
session: z.ZodString;
|
|
49
|
+
jurisdiction: z.ZodObject<{
|
|
50
|
+
id: z.ZodString;
|
|
51
|
+
name: z.ZodString;
|
|
52
|
+
}, z.core.$strip>;
|
|
53
|
+
from_organization: z.ZodObject<{
|
|
54
|
+
name: z.ZodString;
|
|
55
|
+
classification: z.ZodString;
|
|
56
|
+
}, z.core.$strip>;
|
|
57
|
+
classification: z.ZodArray<z.ZodString>;
|
|
58
|
+
subject: z.ZodArray<z.ZodString>;
|
|
59
|
+
first_action_date: z.ZodNullable<z.ZodString>;
|
|
60
|
+
latest_action_date: z.ZodNullable<z.ZodString>;
|
|
61
|
+
latest_action_description: z.ZodNullable<z.ZodString>;
|
|
62
|
+
latest_passage_date: z.ZodNullable<z.ZodString>;
|
|
63
|
+
sponsorships: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
64
|
+
name: z.ZodString;
|
|
65
|
+
entity_type: z.ZodString;
|
|
66
|
+
primary: z.ZodBoolean;
|
|
67
|
+
classification: z.ZodString;
|
|
68
|
+
}, z.core.$strip>>>;
|
|
69
|
+
actions: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
70
|
+
description: z.ZodString;
|
|
71
|
+
date: z.ZodString;
|
|
72
|
+
classification: z.ZodArray<z.ZodString>;
|
|
73
|
+
order: z.ZodNumber;
|
|
74
|
+
organization: z.ZodObject<{
|
|
75
|
+
name: z.ZodString;
|
|
76
|
+
classification: z.ZodString;
|
|
77
|
+
}, z.core.$strip>;
|
|
78
|
+
}, z.core.$strip>>>;
|
|
79
|
+
abstracts: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
80
|
+
abstract: z.ZodString;
|
|
81
|
+
note: z.ZodString;
|
|
82
|
+
}, z.core.$strip>>>;
|
|
83
|
+
}, z.core.$strip>>;
|
|
84
|
+
pagination: z.ZodObject<{
|
|
85
|
+
page: z.ZodNumber;
|
|
86
|
+
per_page: z.ZodNumber;
|
|
87
|
+
max_page: z.ZodNumber;
|
|
88
|
+
total_items: z.ZodNumber;
|
|
89
|
+
}, z.core.$strip>;
|
|
90
|
+
message: z.ZodOptional<z.ZodString>;
|
|
91
|
+
}, z.core.$strip>, readonly [{
|
|
92
|
+
readonly reason: "missing_scope";
|
|
93
|
+
readonly code: JsonRpcErrorCode.InvalidParams;
|
|
94
|
+
readonly when: "Neither jurisdiction nor q (full-text search) was provided.";
|
|
95
|
+
readonly recovery: "Provide a jurisdiction (state name or OCD-ID) or a full-text search term via q, or both.";
|
|
96
|
+
}, {
|
|
97
|
+
readonly reason: "invalid_session";
|
|
98
|
+
readonly code: JsonRpcErrorCode.InvalidParams;
|
|
99
|
+
readonly when: "Session identifier was not recognized by the Open States API.";
|
|
100
|
+
readonly recovery: "Use openstates_get_jurisdiction with include=legislative_sessions to list valid session identifiers for this jurisdiction.";
|
|
101
|
+
}]>;
|
|
102
|
+
//# sourceMappingURL=search-bills.tool.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"search-bills.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/search-bills.tool.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAyBjE,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiStB,CAAC"}
|
|
@@ -0,0 +1,285 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Search state legislative bills across all covered US jurisdictions.
|
|
3
|
+
* @module mcp-server/tools/definitions/search-bills
|
|
4
|
+
*/
|
|
5
|
+
import { tool, z } from '@cyanheads/mcp-ts-core';
|
|
6
|
+
import { JsonRpcErrorCode } from '@cyanheads/mcp-ts-core/errors';
|
|
7
|
+
import { getOpenStatesApiService } from '../../../services/openstates/openstates-service.js';
|
|
8
|
+
const BillIncludeEnum = z.enum([
|
|
9
|
+
'sponsorships',
|
|
10
|
+
'abstracts',
|
|
11
|
+
'other_titles',
|
|
12
|
+
'other_identifiers',
|
|
13
|
+
'actions',
|
|
14
|
+
'sources',
|
|
15
|
+
'documents',
|
|
16
|
+
'versions',
|
|
17
|
+
'votes',
|
|
18
|
+
'related_bills',
|
|
19
|
+
]);
|
|
20
|
+
const BillSortEnum = z.enum([
|
|
21
|
+
'updated_asc',
|
|
22
|
+
'updated_desc',
|
|
23
|
+
'first_action_asc',
|
|
24
|
+
'first_action_desc',
|
|
25
|
+
'latest_action_asc',
|
|
26
|
+
'latest_action_desc',
|
|
27
|
+
]);
|
|
28
|
+
export const searchBills = tool('openstates_search_bills', {
|
|
29
|
+
title: 'Search Bills',
|
|
30
|
+
description: 'Search state legislative bills across all covered US jurisdictions. Supports full-text search, jurisdiction/session filtering, subject tags, sponsor lookups, and sort order. Either jurisdiction or q (full-text) is required — combining both is common and recommended for precision. Use include=sponsorships,actions to get sponsor and action history inline and avoid a follow-up openstates_get_bill call. Use sort=latest_action_desc to find bills currently moving. Use openstates_get_jurisdiction with include=legislative_sessions to discover valid session identifiers before filtering by session.',
|
|
31
|
+
annotations: { readOnlyHint: true, idempotentHint: true, openWorldHint: true },
|
|
32
|
+
input: z.object({
|
|
33
|
+
jurisdiction: z
|
|
34
|
+
.string()
|
|
35
|
+
.optional()
|
|
36
|
+
.describe('State name, two-letter abbreviation, or OCD-ID (e.g., "Washington", "wa", or "ocd-jurisdiction/country:us/state:wa/government"). Required unless q is provided.'),
|
|
37
|
+
q: z
|
|
38
|
+
.string()
|
|
39
|
+
.optional()
|
|
40
|
+
.describe('Full-text search across bill titles, abstracts, and text. Required unless jurisdiction is provided. Combining with jurisdiction is recommended for precision.'),
|
|
41
|
+
session: z
|
|
42
|
+
.string()
|
|
43
|
+
.optional()
|
|
44
|
+
.describe('Session identifier (e.g., "2025", "2025-2026", "2025rs"). Use openstates_get_jurisdiction with include=legislative_sessions to discover valid values. Omit to search across all sessions.'),
|
|
45
|
+
chamber: z
|
|
46
|
+
.enum(['upper', 'lower'])
|
|
47
|
+
.optional()
|
|
48
|
+
.describe('Filter by originating chamber. "upper" = Senate, "lower" = House/Assembly.'),
|
|
49
|
+
classification: z
|
|
50
|
+
.string()
|
|
51
|
+
.optional()
|
|
52
|
+
.describe('Bill classification: "bill", "resolution", "constitutional amendment", etc.'),
|
|
53
|
+
subject: z
|
|
54
|
+
.array(z.string())
|
|
55
|
+
.optional()
|
|
56
|
+
.describe('Filter to bills tagged with one or more subject categories.'),
|
|
57
|
+
sponsor: z.string().optional().describe('Filter by sponsor name or OCD person ID.'),
|
|
58
|
+
sponsor_classification: z
|
|
59
|
+
.string()
|
|
60
|
+
.optional()
|
|
61
|
+
.describe('Filter sponsor type: "primary", "cosponsor".'),
|
|
62
|
+
sort: BillSortEnum.default('updated_desc').describe('Sort order. Use "latest_action_desc" for bills currently moving through the legislature.'),
|
|
63
|
+
action_since: z
|
|
64
|
+
.string()
|
|
65
|
+
.optional()
|
|
66
|
+
.describe('ISO 8601 date — only return bills with an action after this date.'),
|
|
67
|
+
updated_since: z
|
|
68
|
+
.string()
|
|
69
|
+
.optional()
|
|
70
|
+
.describe('ISO 8601 date — only return bills updated after this date.'),
|
|
71
|
+
include: z
|
|
72
|
+
.array(BillIncludeEnum)
|
|
73
|
+
.optional()
|
|
74
|
+
.describe('Related data to inline. "sponsorships" and "actions" cover most research needs without a separate openstates_get_bill call. "votes" adds full vote tallies and per-legislator positions.'),
|
|
75
|
+
page: z.coerce.number().int().min(1).default(1).describe('Page number (1-indexed).'),
|
|
76
|
+
per_page: z.coerce
|
|
77
|
+
.number()
|
|
78
|
+
.int()
|
|
79
|
+
.min(1)
|
|
80
|
+
.max(20)
|
|
81
|
+
.default(10)
|
|
82
|
+
.describe('Results per page. Maximum 20. Default 10.'),
|
|
83
|
+
}),
|
|
84
|
+
output: z.object({
|
|
85
|
+
results: z
|
|
86
|
+
.array(z
|
|
87
|
+
.object({
|
|
88
|
+
id: z.string().describe('OCD bill ID — use as openstates_id in openstates_get_bill.'),
|
|
89
|
+
identifier: z
|
|
90
|
+
.string()
|
|
91
|
+
.describe('Bill identifier as used by the legislature (e.g., "HB 1000").'),
|
|
92
|
+
title: z.string().describe('Bill title.'),
|
|
93
|
+
session: z.string().describe('Legislative session identifier.'),
|
|
94
|
+
jurisdiction: z
|
|
95
|
+
.object({
|
|
96
|
+
id: z.string().describe('OCD jurisdiction ID.'),
|
|
97
|
+
name: z.string().describe('Jurisdiction name.'),
|
|
98
|
+
})
|
|
99
|
+
.describe('Originating jurisdiction.'),
|
|
100
|
+
from_organization: z
|
|
101
|
+
.object({
|
|
102
|
+
name: z.string().describe('Chamber name.'),
|
|
103
|
+
classification: z
|
|
104
|
+
.string()
|
|
105
|
+
.describe('Chamber classification (e.g., "lower", "upper").'),
|
|
106
|
+
})
|
|
107
|
+
.describe('Originating chamber.'),
|
|
108
|
+
classification: z.array(z.string()).describe('Bill classifications.'),
|
|
109
|
+
subject: z.array(z.string()).describe('Subject tags assigned by Open States scrapers.'),
|
|
110
|
+
first_action_date: z.string().nullable().describe('Date of first recorded action.'),
|
|
111
|
+
latest_action_date: z.string().nullable().describe('Date of most recent action.'),
|
|
112
|
+
latest_action_description: z
|
|
113
|
+
.string()
|
|
114
|
+
.nullable()
|
|
115
|
+
.describe('Description of most recent action.'),
|
|
116
|
+
latest_passage_date: z
|
|
117
|
+
.string()
|
|
118
|
+
.nullable()
|
|
119
|
+
.describe('Date bill passed (when applicable).'),
|
|
120
|
+
sponsorships: z
|
|
121
|
+
.array(z
|
|
122
|
+
.object({
|
|
123
|
+
name: z.string().describe('Sponsor name.'),
|
|
124
|
+
entity_type: z.string().describe('Entity type: "person", "organization".'),
|
|
125
|
+
primary: z.boolean().describe('Whether this is the primary sponsor.'),
|
|
126
|
+
classification: z.string().describe('Sponsorship type.'),
|
|
127
|
+
})
|
|
128
|
+
.describe('Sponsorship record.'))
|
|
129
|
+
.optional()
|
|
130
|
+
.describe('Sponsorships when include=sponsorships is requested.'),
|
|
131
|
+
actions: z
|
|
132
|
+
.array(z
|
|
133
|
+
.object({
|
|
134
|
+
description: z.string().describe('Action description.'),
|
|
135
|
+
date: z.string().describe('Action date.'),
|
|
136
|
+
classification: z.array(z.string()).describe('Action classifications.'),
|
|
137
|
+
order: z.number().describe('Action sequence order.'),
|
|
138
|
+
organization: z
|
|
139
|
+
.object({
|
|
140
|
+
name: z.string().describe('Organization name.'),
|
|
141
|
+
classification: z.string().describe('Organization classification.'),
|
|
142
|
+
})
|
|
143
|
+
.describe('Chamber or committee where action occurred.'),
|
|
144
|
+
})
|
|
145
|
+
.describe('Action record.'))
|
|
146
|
+
.optional()
|
|
147
|
+
.describe('Action history when include=actions is requested.'),
|
|
148
|
+
abstracts: z
|
|
149
|
+
.array(z
|
|
150
|
+
.object({
|
|
151
|
+
abstract: z.string().describe('Plain-language bill summary.'),
|
|
152
|
+
note: z.string().describe('Source note.'),
|
|
153
|
+
})
|
|
154
|
+
.describe('Abstract record.'))
|
|
155
|
+
.optional()
|
|
156
|
+
.describe('Bill abstracts when include=abstracts is requested.'),
|
|
157
|
+
})
|
|
158
|
+
.describe('Bill record.'))
|
|
159
|
+
.describe('Bills matching the search criteria.'),
|
|
160
|
+
pagination: z
|
|
161
|
+
.object({
|
|
162
|
+
page: z.number().describe('Current page.'),
|
|
163
|
+
per_page: z.number().describe('Results per page.'),
|
|
164
|
+
max_page: z.number().describe('Total pages available.'),
|
|
165
|
+
total_items: z.number().describe('Total matching bills.'),
|
|
166
|
+
})
|
|
167
|
+
.describe('Pagination metadata.'),
|
|
168
|
+
message: z
|
|
169
|
+
.string()
|
|
170
|
+
.optional()
|
|
171
|
+
.describe('Recovery hint when results are empty — echoes the filters applied and suggests how to broaden. Absent when results are returned.'),
|
|
172
|
+
}),
|
|
173
|
+
errors: [
|
|
174
|
+
{
|
|
175
|
+
reason: 'missing_scope',
|
|
176
|
+
code: JsonRpcErrorCode.InvalidParams,
|
|
177
|
+
when: 'Neither jurisdiction nor q (full-text search) was provided.',
|
|
178
|
+
recovery: 'Provide a jurisdiction (state name or OCD-ID) or a full-text search term via q, or both.',
|
|
179
|
+
},
|
|
180
|
+
{
|
|
181
|
+
reason: 'invalid_session',
|
|
182
|
+
code: JsonRpcErrorCode.InvalidParams,
|
|
183
|
+
when: 'Session identifier was not recognized by the Open States API.',
|
|
184
|
+
recovery: 'Use openstates_get_jurisdiction with include=legislative_sessions to list valid session identifiers for this jurisdiction.',
|
|
185
|
+
},
|
|
186
|
+
],
|
|
187
|
+
async handler(input, ctx) {
|
|
188
|
+
if (!input.jurisdiction && !input.q) {
|
|
189
|
+
throw ctx.fail('missing_scope', 'Either jurisdiction or q is required.', {
|
|
190
|
+
...ctx.recoveryFor('missing_scope'),
|
|
191
|
+
});
|
|
192
|
+
}
|
|
193
|
+
const svc = getOpenStatesApiService();
|
|
194
|
+
const result = await svc.searchBills({
|
|
195
|
+
jurisdiction: input.jurisdiction,
|
|
196
|
+
q: input.q,
|
|
197
|
+
session: input.session,
|
|
198
|
+
chamber: input.chamber,
|
|
199
|
+
classification: input.classification,
|
|
200
|
+
subject: input.subject && input.subject.length > 0 ? input.subject : undefined,
|
|
201
|
+
sponsor: input.sponsor,
|
|
202
|
+
sponsor_classification: input.sponsor_classification,
|
|
203
|
+
sort: input.sort,
|
|
204
|
+
action_since: input.action_since,
|
|
205
|
+
updated_since: input.updated_since,
|
|
206
|
+
include: input.include && input.include.length > 0 ? input.include : undefined,
|
|
207
|
+
page: input.page,
|
|
208
|
+
per_page: input.per_page,
|
|
209
|
+
}, ctx);
|
|
210
|
+
ctx.log.info('Searched bills', {
|
|
211
|
+
jurisdiction: input.jurisdiction,
|
|
212
|
+
q: input.q,
|
|
213
|
+
count: result.results.length,
|
|
214
|
+
total: result.pagination.total_items,
|
|
215
|
+
});
|
|
216
|
+
if (result.results.length === 0) {
|
|
217
|
+
const filters = [];
|
|
218
|
+
if (input.jurisdiction)
|
|
219
|
+
filters.push(`jurisdiction="${input.jurisdiction}"`);
|
|
220
|
+
if (input.q)
|
|
221
|
+
filters.push(`q="${input.q}"`);
|
|
222
|
+
if (input.session)
|
|
223
|
+
filters.push(`session="${input.session}"`);
|
|
224
|
+
if (input.chamber)
|
|
225
|
+
filters.push(`chamber="${input.chamber}"`);
|
|
226
|
+
return {
|
|
227
|
+
results: [],
|
|
228
|
+
pagination: result.pagination,
|
|
229
|
+
message: `No bills matched ${filters.join(', ')}. Try broadening the query, checking the session identifier with openstates_get_jurisdiction, or removing filters.`,
|
|
230
|
+
};
|
|
231
|
+
}
|
|
232
|
+
return { results: result.results, pagination: result.pagination };
|
|
233
|
+
},
|
|
234
|
+
format: (result) => {
|
|
235
|
+
const lines = [
|
|
236
|
+
`**${result.pagination.total_items} bills** (page ${result.pagination.page}/${result.pagination.max_page}, per page ${result.pagination.per_page}, showing ${result.results.length})`,
|
|
237
|
+
];
|
|
238
|
+
if (result.message) {
|
|
239
|
+
lines.push('');
|
|
240
|
+
lines.push(`> ${result.message}`);
|
|
241
|
+
}
|
|
242
|
+
for (const bill of result.results) {
|
|
243
|
+
lines.push('');
|
|
244
|
+
lines.push(`## ${bill.identifier} — ${bill.title}`);
|
|
245
|
+
lines.push(`**ID:** ${bill.id}`);
|
|
246
|
+
lines.push(`**Session:** ${bill.session} | **Jurisdiction:** ${bill.jurisdiction.name} (${bill.jurisdiction.id})`);
|
|
247
|
+
lines.push(`**Chamber:** ${bill.from_organization.name} (${bill.from_organization.classification})`);
|
|
248
|
+
if (bill.classification.length > 0)
|
|
249
|
+
lines.push(`**Classification:** ${bill.classification.join(', ')}`);
|
|
250
|
+
if (bill.subject.length > 0)
|
|
251
|
+
lines.push(`**Subjects:** ${bill.subject.join(', ')}`);
|
|
252
|
+
if (bill.first_action_date)
|
|
253
|
+
lines.push(`**First action:** ${bill.first_action_date}`);
|
|
254
|
+
if (bill.latest_action_date) {
|
|
255
|
+
lines.push(`**Latest action:** ${bill.latest_action_date} — ${bill.latest_action_description ?? 'N/A'}`);
|
|
256
|
+
}
|
|
257
|
+
if (bill.latest_passage_date)
|
|
258
|
+
lines.push(`**Passed:** ${bill.latest_passage_date}`);
|
|
259
|
+
if (bill.sponsorships?.length) {
|
|
260
|
+
lines.push('');
|
|
261
|
+
lines.push('**Sponsors:**');
|
|
262
|
+
for (const s of bill.sponsorships) {
|
|
263
|
+
const primary = s.primary ? '**Primary**' : 'Cosponsor';
|
|
264
|
+
lines.push(`- ${primary}: ${s.name} (${s.classification}, entity: ${s.entity_type})`);
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
if (bill.abstracts?.length) {
|
|
268
|
+
lines.push('');
|
|
269
|
+
for (const abs of bill.abstracts) {
|
|
270
|
+
lines.push(`*${abs.abstract}* _(${abs.note})_`);
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
if (bill.actions?.length) {
|
|
274
|
+
lines.push('');
|
|
275
|
+
lines.push('**Actions:**');
|
|
276
|
+
for (const a of bill.actions) {
|
|
277
|
+
const cls = a.classification.length > 0 ? ` [${a.classification.join(', ')}]` : '';
|
|
278
|
+
lines.push(`- #${a.order} ${a.date}: ${a.description}${cls} — ${a.organization.name} (${a.organization.classification})`);
|
|
279
|
+
}
|
|
280
|
+
}
|
|
281
|
+
}
|
|
282
|
+
return [{ type: 'text', text: lines.join('\n') }];
|
|
283
|
+
},
|
|
284
|
+
});
|
|
285
|
+
//# sourceMappingURL=search-bills.tool.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"search-bills.tool.js","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/search-bills.tool.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,EAAE,uBAAuB,EAA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,CAAC,IAAI,CACR,MAAM,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC,IAAI,KAAK,CAAC,CAAC,WAAW,GAAG,GAAG,MAAM,CAAC,CAAC,YAAY,CAAC,IAAI,KAAK,CAAC,CAAC,YAAY,CAAC,cAAc,GAAG,CAC9G,CAAC;gBACJ,CAAC;YACH,CAAC;QACH,CAAC;QACD,OAAO,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACpD,CAAC;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Search committees for a jurisdiction (experimental — not all states have coverage).
|
|
3
|
+
* @module mcp-server/tools/definitions/search-committees
|
|
4
|
+
*/
|
|
5
|
+
import { z } from '@cyanheads/mcp-ts-core';
|
|
6
|
+
export declare const searchCommittees: import("@cyanheads/mcp-ts-core").ToolDefinition<z.ZodObject<{
|
|
7
|
+
jurisdiction: z.ZodOptional<z.ZodString>;
|
|
8
|
+
classification: z.ZodOptional<z.ZodEnum<{
|
|
9
|
+
committee: "committee";
|
|
10
|
+
subcommittee: "subcommittee";
|
|
11
|
+
}>>;
|
|
12
|
+
chamber: z.ZodOptional<z.ZodEnum<{
|
|
13
|
+
upper: "upper";
|
|
14
|
+
lower: "lower";
|
|
15
|
+
}>>;
|
|
16
|
+
parent: z.ZodOptional<z.ZodString>;
|
|
17
|
+
include: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
18
|
+
memberships: "memberships";
|
|
19
|
+
sources: "sources";
|
|
20
|
+
links: "links";
|
|
21
|
+
}>>>;
|
|
22
|
+
page: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
|
|
23
|
+
per_page: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
|
|
24
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
25
|
+
results: z.ZodArray<z.ZodObject<{
|
|
26
|
+
id: z.ZodString;
|
|
27
|
+
name: z.ZodString;
|
|
28
|
+
classification: z.ZodString;
|
|
29
|
+
parent_id: z.ZodNullable<z.ZodString>;
|
|
30
|
+
memberships: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
31
|
+
person_id: z.ZodString;
|
|
32
|
+
person_name: z.ZodString;
|
|
33
|
+
role: z.ZodString;
|
|
34
|
+
}, z.core.$strip>>>;
|
|
35
|
+
}, z.core.$strip>>;
|
|
36
|
+
pagination: z.ZodObject<{
|
|
37
|
+
page: z.ZodNumber;
|
|
38
|
+
per_page: z.ZodNumber;
|
|
39
|
+
max_page: z.ZodNumber;
|
|
40
|
+
total_items: z.ZodNumber;
|
|
41
|
+
}, z.core.$strip>;
|
|
42
|
+
coverage_note: z.ZodString;
|
|
43
|
+
}, z.core.$strip>, undefined>;
|
|
44
|
+
//# sourceMappingURL=search-committees.tool.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"search-committees.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/search-committees.tool.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;AAKjD,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;6BAsI3B,CAAC"}
|