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

NameTypeRequiredDescription
jurisdictionstringno2-letter state code or name
namestringnoName fragment
org_classificationstringnoupper | lower | legislature
districtstringnoDistrict identifier
partystringnoParty name (e.g., “Democratic”, “Republican”)
per_pagenumberno1-50 (default 20)
pagenumberno1-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

FieldTypeDescription
totalnumberTotal matching legislators
pagenumber | nullCurrent page number
total_pagesnumber | nullTotal number of pages
returnednumberNumber of legislators in response
legislatorsarray
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.

Regenerated from source · build July 6, 2026