search_legislators
Pack: openstates · Endpoint: https://gateway.pipeworx.io/openstates/mcp
Find state legislators. Filter by jurisdiction, name, chamber (upper/lower), party, or district. Returns name, current/prior roles, party, contact details, OpenStates IDs.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
jurisdiction | string | no | 2-letter state code or name |
name | string | no | Name fragment |
org_classification | string | no | upper | lower | legislature |
district | string | no | District identifier |
party | string | no | Party name (e.g., “Democratic”, “Republican”) |
per_page | number | no | 1-50 (default 20) |
page | number | no | 1-based page |
Example call
Arguments
{
"jurisdiction": "CA"
}
curl
curl -X POST https://gateway.pipeworx.io/openstates/mcp \
-H 'Content-Type: application/json' \
-d '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"search_legislators","arguments":{"jurisdiction":"CA"}}}'
TypeScript (@pipeworx/sdk)
import { Pipeworx } from '@pipeworx/sdk';
const pipeworx = new Pipeworx();
const result = await pipeworx.call('search_legislators', {
"jurisdiction": "CA"
});
More examples
{
"jurisdiction": "NY",
"name": "Johnson",
"org_classification": "lower",
"party": "Democratic"
}
Response shape
Always returns: total, page, total_pages, returned, legislators
| Field | Type | Description |
|---|---|---|
total | number | Total matching legislators |
page | number | null | Current page number |
total_pages | number | null | Total number of pages |
returned | number | Number of legislators in response |
legislators | array |
Full JSON Schema
{
"type": "object",
"properties": {
"total": {
"type": "number",
"description": "Total matching legislators"
},
"page": {
"type": [
"number",
"null"
],
"description": "Current page number"
},
"total_pages": {
"type": [
"number",
"null"
],
"description": "Total number of pages"
},
"returned": {
"type": "number",
"description": "Number of legislators in response"
},
"legislators": {
"type": "array",
"items": {
"type": "object",
"properties": {
"person_id": {
"type": [
"string",
"null"
],
"description": "OpenStates person ID"
},
"name": {
"type": [
"string",
"null"
],
"description": "Full name"
},
"party": {
"type": [
"string",
"null"
],
"description": "Political party"
},
"jurisdiction": {
"type": [
"string",
"null"
],
"description": "State or jurisdiction"
},
"chamber": {
"type": [
"string",
"null"
],
"description": "Chamber (upper/lower)"
},
"district": {
"type": [
"string",
"null"
],
"description": "District identifier"
},
"title": {
"type": [
"string",
"null"
],
"description": "Current title/role"
},
"image": {
"type": [
"string",
"null"
],
"description": "Image URL"
},
"email": {
"type": [
"string",
"null"
],
"description": "Email address"
},
"openstates_url": {
"type": [
"string",
"null"
],
"description": "Link to OpenStates profile"
}
}
}
}
},
"required": [
"total",
"page",
"total_pages",
"returned",
"legislators"
]
}
Connect
Add this to your MCP client config, or use one-click install buttons:
{
"mcpServers": {
"openstates": {
"url": "https://gateway.pipeworx.io/openstates/mcp"
}
}
}
See Getting Started for client-specific install steps.