election_results
Pack: us-elections · Connect: https://pipeworx.io/mcp (see Connect below for a single-pack URL)
No MCP client? Call it directly: GET https://gateway.pipeworx.io/v1/tools/election_results for the schema, then POST the same URL with its arguments for the data.
Candidate-level election results by state/year/office at state, county or precinct granularity.
Tool description as the model sees it
Candidate-level U.S. election results for one state, year and office, at state, county, or precinct granularity. State-level President and Senate cover every state 1976-2024 (MIT Election Data + Science Lab / MEDSL, Harvard Dataverse, CC0). County- and precinct-level President/Senate/House cover the 2024 general election in Pennsylvania, Michigan and Georgia only (OpenElections) — this is the current limit of coverage, not a bug. Pass state as a postal code (“PA”) or full name (“Pennsylvania”), office as “president”, “senate” or “house”. Use county to scope a county/precinct query (e.g. county=“Allegheny”); omit it at level=“county” to get every county in the state. Returns candidate, party, votes, the race total and the share of the vote, plus source/licence/data_as_of on every row. A state/year/office/level combination with no data returns a loud not-found (reason + available_levels hint), never an empty success.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
state | string | yes | US state, postal code (“PA”) or full name (“Pennsylvania”). |
year | number | yes | Election year, e.g. 2024. |
office | string | yes | ”president”, “senate”, or “house”. |
level | string | no | Granularity: “state”, “county”, or “precinct”. Default “county”. |
county | string | no | County name to scope a county- or precinct-level query (case-insensitive). Optional. |
limit | number | no | Max rows, 1-500. Default 50. A truncated response carries truncated:true, total_matching, and a hint for narrowing (county, level=“county”). |
offset | number | no | Pagination offset. Default 0. |
Example call
Arguments
{
"state": "PA",
"year": 2024,
"office": "president",
"level": "county"
}
curl
curl -X POST https://gateway.pipeworx.io/us-elections/mcp \
-H 'Content-Type: application/json' \
-d '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"election_results","arguments":{"state":"PA","year":2024,"office":"president","level":"county"}}}'
TypeScript (@pipeworx/sdk)
import { Pipeworx } from '@pipeworx/sdk';
const pipeworx = new Pipeworx();
const result = await pipeworx.call('election_results', {
"state": "PA",
"year": 2024,
"office": "president",
"level": "county"
});
Connect
Add this to your MCP client config — every tool in the catalog, including this one — or use one-click install buttons:
{
"mcpServers": {
"pipeworx": {
"url": "https://pipeworx.io/mcp"
}
}
}
Connect to just the us-elections pack
{
"mcpServers": {
"us-elections": {
"url": "https://gateway.pipeworx.io/us-elections/mcp"
}
}
}
See Getting Started for client-specific install steps.