29N Elections MCP
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@29N Elections MCP What's the latest turnout in Spain for the 29N election?"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
29N Elections MCP
Official results of Spain's general election of 29 November 2026, for any AI assistant.
A Model Context Protocol server for the public results website of the 29N general election (Congreso de los Diputados and Senado), published by the Ministerio del Interior.
Quick start · Connect a client · Available tools · Available data
English · Spanish
Give your AI assistant direct access to the official 29N results.
This server lets any MCP client (Claude, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Zed and others) read the results that the Ministerio del Interior publishes on resultados.29neleccionesgenerales.com. Ask in plain language, for example "What was the turnout in Madrid at 18:00, compared with 2023?", and the assistant will check the publication phase, find the territory, and answer with the official figures and a link to the official page.
Unofficial project. This server is not affiliated with, endorsed by or sponsored by the Ministerio del Interior or any other public body. It reads the same public data that the official website shows. See Data source and attribution.
Hosted endpoint | Available soon (meanwhile, run it locally) |
Transport |
|
Protocol | MCP revision |
Authentication | None, the data is public |
Coverage | Congreso and Senado: Spain, autonomous communities, provinces, islands, municipalities, municipal districts, polling places and their polling stations (tally sheets as PDF) |
Phases | Constitution of polling stations, turnout updates (14:00 and 18:00) and vote count (from 20:00) |
Language | Tool descriptions in English; territory and party names in Spanish, as the website publishes them |
Reference | Chambers, levels, phases and identifiers in the catalogue |
Why use it
Real data, not memory. Every figure is read from the official results website when the tool is called.
Phase-aware. The server knows whether turnout or votes are being published and tells the assistant not to report party results before the count starts.
Always sourced. Each result carries a
sourceobject with the publisher, the official page, the API URLs read, the phase, the data source (provisional or definitive) and the time the data was retrieved.Typed. Every tool declares an
outputSchemaand returnsstructuredContent, plus anext_stephint for the assistant.
Contents
Related MCP server: onpe-mcp
Quick start
Register the server in your client, for example with Claude Code:
claude mcp add elecciones29n -- uv run --directory /path/to/elecciones29n-mcp elecciones29n-mcpAsk a question: "What is the latest turnout in Spain for the 29N election?"
Installation
Two ways to use the server: the hosted endpoint (available soon) or a local copy running on your machine. The local setup is available today.
Hosted server
Available soon. A public endpoint has not been published yet. Once it is, this section will list the URL and the configuration snippets for each client.
Endpoint | Available soon |
Transport | Streamable HTTP |
Authentication | None |
Run locally
Requirements: Python 3.11 or later, and uv.
git clone <repository-url> elecciones29n-mcpcd elecciones29n-mcpuv syncuv run elecciones29n-mcpThe server starts on the stdio transport and waits for an MCP client. It prints nothing until a client connects; that is expected.
To serve Streamable HTTP instead (for example, for a shared deployment), set MCP_TRANSPORT=http. The server listens on MCP_HOST:MCP_PORT (by default 127.0.0.1:8000, reachable only from the same machine) and the endpoint path is /mcp, so a local client connects to http://localhost:8000/mcp:
MCP_TRANSPORT=http MCP_PORT=8000 uv run elecciones29n-mcpTo update an existing clone, run git pull and then uv sync again.
Connect a client
In the snippets below, replace /path/to/elecciones29n-mcp with the absolute path of your clone.
Command-line clients (one line)
Client | Command |
Claude Code |
|
Codex (OpenAI) |
|
VS Code |
|
Clients with a JSON file
Most clients read the same block. Paste it into the file for your client and restart it:
{
"mcpServers": {
"elecciones29n": {
"command": "uv",
"args": ["run", "--directory", "/path/to/elecciones29n-mcp", "elecciones29n-mcp"]
}
}
}Client | Configuration file |
Claude Desktop (macOS) |
|
Claude Desktop (Windows) |
|
Claude Desktop (Microsoft Store) |
|
Cursor |
|
Windsurf |
|
Gemini CLI |
|
Cline, LM Studio and others | The client's MCP settings file (same |
Some clients use a different format:
{
"servers": {
"elecciones29n": {
"type": "stdio",
"command": "uv",
"args": ["run", "--directory", "/path/to/elecciones29n-mcp", "elecciones29n-mcp"]
}
}
}[mcp_servers.elecciones29n]
command = "uv"
args = ["run", "--directory", "/path/to/elecciones29n-mcp", "elecciones29n-mcp"]Configuration
The server is configured with environment variables. All of them are optional.
Variable | Default | Description |
|
|
|
|
| Bind address in HTTP mode. Set |
|
| Port in HTTP mode. The endpoint path is |
|
| Origin of the results website and its API. Also used to build the official page links. |
| A current desktop Chrome User-Agent | User-Agent sent to the website. The website firewall rejects non-browser agents (see Troubleshooting). |
Built-in behaviour (not configurable):
Caching. Responses are cached in memory (at most 256 entries; expired entries are dropped first, then the least recently used): the website configuration for 10 seconds; territory results for the website polling interval (30 seconds today); the territory tree and the candidacies catalogue for 6 hours, or until the configuration announces a new version. If a refreshed catalogue still carries the old version (the website copy lags behind its configuration), it is kept for 60 seconds before checking again. Concurrent requests for the same data share one upstream request. Tally sheet PDFs are kept for 5 minutes (at most 4).
Retrieval time.
source.fetched_atis the time the data was actually retrieved from the website, so a cached answer keeps its original time.Retries. Up to 3 attempts on HTTP 429, 502, 503 and 504 and on transport errors (timeouts, refused, reset or truncated connections), with exponential backoff or the
Retry-Afterdelay of 429/503 answers (at most 10 seconds). At most 8 requests run at the same time.
Example questions
"What was the turnout in Spain at 18:00, and how does it compare with 2023?"
"How many polling stations opened in the province of Sevilla?"
"Give me the turnout of every province of Andalucía."
"How many seats does each party have in the Congreso right now, and how much has been counted?"
"Which party is winning in each province?"
"Who was elected senator for Madrid?"
"Which polling stations does my polling place have, and can I see the tally sheet of one of them?"
"How does Compromís appear in the results, and what is its acronym and color?"
Available tools
The server exposes seven read-only tools. It is stateless: the tools are chained by passing the scope_id values that the search returns (and the polling station codes that elecciones29n_get_polling_stations returns). Every tool except elecciones29n_get_status takes a single params object.
Step | Tool | Description |
1 |
| Publication status: current phase (0 constitution, 1 turnout, 2 count), turnout update announced by the configuration (indicative), active data source ( |
2 |
| Finds territories (scopes) by name or official territory code, ignoring accents, case and word order. Returns |
3 |
| Results of one territory: polling stations constituted, turnout updates compared with 2023 and, from phase 2, vote totals, parties (votes, %, seats, change vs 2023) and Senate candidates. Optionally summarizes every child territory of one level. During the count, constitution and turnout come from the election-day snapshot. |
4 |
| The winning or leading candidacy of every child territory of a scope (for example, each province of Spain), with its seats and the share of the census counted, plus a tally per candidacy. Each entry says whether it is the official winner, an inferred leader or a tie. Phase 2 only. |
5 |
| Candidacies of the 29N call (code, acronym, name, color and group), optionally filtered by a word of the name or acronym. |
6 |
| Polling stations of one polling place (level 110): code, short label (district-section-letter) and whether each one has been counted. |
7 |
| Metadata of the tally sheet (acta) of one polling station (send and processing dates, size, SHA-256) and the URI of the resource that serves the PDF. Only when the website publishes tally sheets. |
Parameters (all inside params):
Tool | Parameters |
|
|
|
|
|
|
|
|
|
|
|
|
Levels can be given as a number or a name in Spanish or English: 1 nacional, 20 comunidad, 30 provincia, 70 isla, 90 municipio, 100 distrito, 110 local. See the catalogue.
The server also publishes two resources:
Resource | Content |
| The usage guide (the same text it sends as server instructions), Markdown. |
| Resource template: the tally sheet PDF ( |
How it uses the tools (simple case):
sequenceDiagram
participant A as AI assistant
participant S as 29N MCP server
participant W as Results website API
Note over A,S: Step 1 · what is published?
A->>S: elecciones29n_get_status()
S->>W: getConfig
S-->>A: phase, turnout update, data source, alert
Note over A,S: Step 2 · find the territory
A->>S: elecciones29n_search_scopes(queries=["Madrid"])
S->>W: getNomenclator (cached)
S-->>A: scopes (scope_id, parents, child_levels)
Note over A,S: Step 3 · get the figures
A->>S: elecciones29n_get_scope_results(scope_id, children_level?)
S->>W: getScopeData (phase 2 with children: getScopeDataTopPartidosGanadores)
S->>W: phase 2: getScopeData day snapshot (turnout)
S-->>A: constitution, turnout or count + source
Note over A,S: Step 4 (phase 2) · winners by territory
A->>S: elecciones29n_get_winners_map(scope_id, level=30)
S->>W: getScopeDataTopPartidosGanadores
S-->>A: winner, leader or tie of each child territory + tally
Note over A,S: Step 5 (optional) · polling stations and tally sheets
A->>S: elecciones29n_get_polling_stations(scope_id of a polling place)
S->>W: getScopesLocalMesa
A->>S: elecciones29n_get_tally_sheet(mesa_code)
S->>W: getImagen
S-->>A: metadata + resource URI
A->>S: resources/read elecciones29n://tally-sheet/...
S-->>A: PDF blobEvery result includes next_step, a short instruction that tells the assistant what to report and what to call next (for example, not to report party results while the count has not started).
All seven tools are annotated readOnlyHint, idempotentHint and openWorldHint, and not destructiveHint.
Recommended order
The server is stateless, so this order is recommended, not enforced: each tool validates its own inputs and, when one is missing or wrong, answers with an error that says which tool to call first.
Step | Tool | Input it expects |
1 |
| Nothing. Call it at the start and again to learn about new data. |
2 |
| Names or official territory codes of the places the user mentions. |
3 |
| A |
4 |
| A |
5 |
| Nothing, or a word of a party name or acronym. Any time. |
6 |
| The |
7 |
| A polling station |
Available data
The server covers the 2 chambers of the 29N general election (Congreso, 350 deputies; Senado, 208 senators), 3 publication phases and 8 territory levels, from Spain down to polling stations, with every figure in its provisional and definitive versions and the 2023 election as the comparison baseline.
See Resources/Catalogue.md for the chambers, election calls, phases, data
sources, levels, example identifiers, polling station codes, official website routes and API
endpoints, plus a glossary.
MCP protocol compliance
The server targets MCP specification revision 2026-07-28 and is built on the official Python SDK (mcp[cli]>=2.3.0,<3).
Stateless. No session state is kept between requests; tools are chained through explicit
scope_idvalues, not through a server-side flow. Clients negotiate withserver/discover. Clients on earlier revisions (2024-11-05to2025-11-25) can still connect through theinitializehandshake that the SDK keeps.Typed results. Every tool returns a Pydantic model: the SDK publishes its JSON Schema as the tool
outputSchemaand sends the result asstructuredContent(with a JSON text copy incontentfor clients that ignore structured output).Cache hints.
tools/list,resources/listandresources/templates/listcarryttlMs= 3,600,000 (one hour) andcacheScope=public, because they do not change while the server runs;resources/readcarriesttlMs= 300,000 (five minutes), because tally sheets can be resent.Binary resources. The tally sheet template returns the PDF as a
blobwithmimeTypeapplication/pdf;elecciones29n_get_tally_sheetadds aresource_linkcontent block next to its structured metadata.Errors. Upstream failures become tool errors (
isError) with an actionable message, never protocol errors.No subscriptions. The server sends no change notifications; clients call
elecciones29n_get_statusagain to learn about new data.
Development
The server is a small package under src/elecciones29n_mcp/:
File | Role |
| Entry point ( |
| The MCP server instance, the instructions resource, the tally sheet resource template and the seven tools. |
| HTTP client for the results API (retries, concurrency limit, version-aware cache) and in-memory TTL cache. |
| Pydantic input and output models (the source of every |
| Territory search, provisional/definitive value selection and payload normalization. |
| Environment variables, election constants and the instruction text. |
Resources/elecciones29n_mcp_instructions.md is the usage guide the server sends to the client; it is bundled into the package.
Install the dependencies (including the development group) and run the tests:
uv syncuv run pytestThe tests use trimmed copies of real responses in tests/fixtures/, synthetic payloads (synthetic_*.json, including a tiny PDF) for the endpoints not published yet, and a fake API, so they never call the website.
Troubleshooting
Symptom | Fix |
The server does not appear in the client | Check that |
| The website firewall rejected the request: it blocks clients that do not look like a browser and may rate limit. Set |
| The data is not published yet for the current phase, or the identifier does not exist. Check the phase with |
A response that is not JSON | The website returned an HTML error page, usually for data that is not published yet. Try again later. |
Timeouts or | The website is under heavy load. The server already retries; try again in a moment. |
No party results or empty winners map | Expected before phase 2 (polls close at 20:00) or while |
| The identifier does not belong to the chosen chamber, or was typed by hand. Search again with the same |
| The website returned a configuration without a valid phase or data source. It is usually a transient glitch: try again in about 10 seconds. |
Polling stations or tally sheets | The website publishes them late (usually after the count), and tally sheets only when |
Limitations
Phases. Phase 0 publishes the constitution of polling stations, phase 1 the turnout updates (14:00 and 18:00) and phase 2 the vote count. Party results and winners exist only in phase 2.
Senado before the count. Polling stations and turnout are common to both chambers and are published only under the Congreso; Senado results start in phase 2.
Provisional vs definitive. Every figure exists as
pro(provisional count on election night) anddef(definitive count, published days later).data_source="auto"uses the source the website marks as active. Provisional figures can change.Turnout update number.
turnout_updatecomes from the website configuration and can lag behind the territory data;turnout.latest_publishedis the update to report.Baselines. Previous-election figures (totals, turnout and party comparisons) are always the definitive 2023 count, as on the website; current figures and their deltas use the selected data source.
Winners. A territory has no winner until the selected data source has counted part of its census.
winner_basissays whether the winner is the one marked by the website (official), a leader computed from seats and votes (inferred_leader) or atie.Polling stations and tally sheets.
elecciones29n_get_polling_stationsandelecciones29n_get_tally_sheetuse endpoints inferred from the website code (getScopesLocalMesa,getImagen) that were not published yet when they were written: they are not validated live. Tally sheets are capped at 10 MB and served only as PDF resources; their figures are not machine-read.Not exposed. Polling-station level results, logos and candidate portraits, map geometry, downloadable files, and other presentation-only assets of the website: translation files (
/assets/locales/{lng}/{ns}.json), versioned shared assets (/shared-assets/...: logos,-leaderportraits,topojsonmaps includingreal_{level}variants), the live video stream and the markup of official alerts (the alert text is returned byelecciones29n_get_status).Official links.
official_urlpoints to routes of the website's single-page app. The website answers those URLs with HTTP 404 and the app shell, which then renders the page in a browser; tools that only check the HTTP status may report them as broken.Unofficial client. The API is the website's own backend. It is not documented as a public API and can change or block automated clients without notice.
Comparisons. Previous-election figures refer to the general election of 23 July 2023 (call
07-23).Hosted endpoint. It is not available yet; use the local setup.
Privacy
No authentication and no personal data are needed. The server only forwards the requests required to answer the question to the public results website, with a browser User-Agent and a Referer header pointing to the website itself. It stores nothing on disk and sends no telemetry; its only log output is the list of API requests written to the server's standard error. Candidate names in Senate results are public electoral information, as published by the website.
Data source and attribution
The results are published by the Ministerio del Interior (Gobierno de España) on the official results website of the 29N general election, resultados.29neleccionesgenerales.com. When you reuse the figures, cite the Ministerio del Interior as the source and link to the official_url returned with each result; check the website's legal notice for the reuse conditions.
This project is independent. It is not affiliated with, endorsed by or sponsored by the Ministerio del Interior, the Government of Spain or any electoral authority. The provisional results published on election night are informative; the definitive results come from the general count (escrutinio general) carried out by the electoral boards.
Links
WIP and disclaimer
Work in progress
This project is currently under active development. The polling station and tally sheet tools rely on endpoints that the website had not published yet when they were written.
Disclaimer
This repository and its contents are provided for informational and technical purposes only. Use of this code is at your own risk.
The software is provided "as is", without warranty of any kind, either expressed or implied. The figures it returns are copied from the official website at request time and may be incomplete, provisional or out of date.
By using this repository, you acknowledge that:
You are responsible for reviewing and testing the code before using it in any production or critical environment.
You must check any figure that matters against the official website before relying on it.
The authors are not liable for any direct, indirect or consequential damages arising from the use of this software.
Package maintenance and contributing
Any contribution is welcome and should be done through pull requests and/or issues. Pull requests should include updated tests and updated documentation. If functionality is changed, the tool docstrings (the descriptions that the assistant reads) should be added or updated.
Licensing
The code of this project is licensed under the MIT License.
Available Tools
7 toolselecciones29n_get_polling_stationsList 29N polling stations of a polling placeARead-onlyIdempotent
Use this tool to list the polling stations (mesas) of ONE polling place (local electoral):
their codes, the short label the official website shows and whether each one has been
counted. The codes are the input of 'elecciones29n_get_tally_sheet'.
WHEN TO USE IT:
When the user asks about a specific polling place or polling station, or wants the tally
sheet (acta) of a polling station.
INPUT PARAMETERS (What it receives):
- params.scope_id (str, required): scope_id of a polling place (level 110), found with
'elecciones29n_search_scopes' and level=110 (or 'local').
- params.chamber ('congreso' default | 'senado').
- params.data_source ('auto' default | 'pro' | 'def'): source of the 'scrutinized' flags.
WHAT IT RETURNS:
- local and parents: the polling place and its enclosing territories.
- polling_stations: code (e.g. '2807903650A'), label ('03-650-A': district-section-letter),
name, scope_id, municipality_code, district, section, letter and 'scrutinized'.
- total, scrutinized_count, tally_sheets_available, next_step and source.
OPERATING NOTES:
- The website publishes this list late (often only after the count); until then the tool
says it is not published yet. This endpoint is inferred from the website code and has
not been validated live yet.
- It contains no votes: use 'elecciones29n_get_scope_results' for results.Inputs: params (required). Returns: Polling stations of one polling place.
elecciones29n_get_scope_resultsGet 29N results of a territoryARead-onlyIdempotent
Use this tool to get the official 29N figures of ONE territory: polling stations constituted,
turnout updates compared with 2023 and, once counting has started, votes, percentages and
seats of every candidacy (and Senate candidates).
WHEN TO USE IT:
After 'elecciones29n_search_scopes' returned the scope_id of the territory the user asks about.
INPUT PARAMETERS (What it receives):
- params.scope_id (str, required): 24-hex scope_id from 'elecciones29n_search_scopes'.
- params.chamber ('congreso' default | 'senado'): must match the chamber used in the search.
- params.data_source ('auto' default | 'pro' | 'def'): provisional or definitive figures;
'auto' uses the source the website marks as active.
- params.children_level (optional, number or name): also summarize every child territory of
that level. It must be one of the scope 'child_levels'.
- params.children_limit (1-500, default 60).
WHAT IT RETURNS:
- scope: name, official territory code, level, census, polling stations, parents and child_levels.
- constitution: polling stations opened/suspended (absolute and %).
- turnout: turnout updates (time, votes, %), each with 'published' and the 2023 figure at the
same time ('previous', with deltas). 'latest_published' is the one to report.
- count (phase 2): totals (votes, valid, blank, null, abstention, turnout), 'counted_pct',
'seats_at_stake', 'parties' (code, acronym, name, color, votes, votes_pct, seats and the
2023 counterpart with deltas), 'candidates' (Senado: votes and elected flag), 'previous'
totals of 2023 and 'change_vs_previous'. 'started' is false until counting begins.
- children / children_total / children_truncated: per-child summary when 'children_level'
was given: turnout, or count progress ('census_counted_pct' = share of the census counted,
'polling_stations_counted_pct' = share of polling stations counted, when reported) and
the leading party (only once the selected source has counted).
- next_step and source (cite it, including data_source and fetched_at = retrieval time).
OPERATING NOTES:
- Never report party results before phase 2 or while 'count.started' is false.
- While counting, always say which percentage has been counted and that figures are provisional.
- Report figures exactly as returned; do not round seats or invent missing values.
- During the count, constitution and turnout come from the day snapshot published under the
Congreso (common to both chambers); the 2023 baseline is always the definitive count.Inputs: params (required). Returns: Results of one territory for the current phase.
elecciones29n_get_statusGet 29N results publication statusARead-onlyIdempotent
Use this tool FIRST for any question about Spain's general election of 29 November 2026
(29N): turnout, polling stations, votes, seats, winners, elected senators. It tells you what
the Ministerio del Interior has published so far. Never answer such questions from memory.
WHEN TO USE IT:
At the start of every conversation about 29N results, and again later to know whether new
data (a new turnout update, the start of the count, definitive results) is available.
INPUT PARAMETERS (What it receives):
None.
WHAT IT RETURNS:
- phase / phase_label: 0 constitution of polling stations, 1 voter turnout updates,
2 vote count (scrutiny). Party votes and seats exist only in phase 2.
- turnout_update: turnout update announced by the website configuration (1 = 14:00,
2 = 18:00). It is only indicative: it can lag behind the published data. The latest
turnout to report is 'turnout.latest_published' of 'elecciones29n_get_scope_results'.
- active_data_source: 'pro' (provisional, election night) or 'def' (definitive).
- is_open, polling_active, polling_interval_seconds: publication state of the website.
- alert: official alert message in Spanish, if one is active. Relay it to the user.
- versions: data versions announced by the website.
- next_step: what to call next.
- source: attribution (official website, URL, phase, fetch time). Always cite it.
OPERATING NOTES:
- The figures change during election night: re-check the status before reporting a final result.
- Then use 'elecciones29n_search_scopes' to find the territory the user asks about.Inputs: no named parameters. Returns: Current state of the official results publication.
elecciones29n_get_tally_sheetGet the 29N tally sheet of a polling stationARead-onlyIdempotent
Use this tool to get the official tally sheet (acta de escrutinio) of ONE polling station:
the scanned PDF that the polling station sent after counting its votes.
WHEN TO USE IT:
When the user asks to see or check the tally sheet of a specific polling station, after
'elecciones29n_get_polling_stations' returned its code.
INPUT PARAMETERS (What it receives):
- params.mesa_code (str, required): polling station 'code' from
'elecciones29n_get_polling_stations', e.g. '2807903650A'.
- params.chamber ('congreso' default | 'senado').
WHAT IT RETURNS:
- Metadata only (never the file contents): mesa_code, label, election_code, record_id,
scope_id, sent_at, processing_state, processing_date, document_type, mime_type,
size_bytes and sha256 of the PDF.
- resource_uri: 'elecciones29n://tally-sheet/{chamber}/{mesa_code}'. Read that resource
(resources/read) to get the PDF; the result also carries it as a resource link.
- next_step and source.
OPERATING NOTES:
- Tally sheets exist only when the website reports 'scrutiny_records_available' (see
'elecciones29n_get_status') and only for polling stations already counted.
- This endpoint is inferred from the website code and has not been validated live yet.
- The figures of a tally sheet are not machine-read: use 'elecciones29n_get_scope_results'
for results.Inputs: params (required). Returns: Metadata of the tally sheet (acta) of one polling station; the PDF is a resourc…
elecciones29n_get_winners_mapGet 29N winners by territoryARead-onlyIdempotent
Use this tool to know which candidacy won (or leads) in EVERY child territory of a scope:
e.g. the winner in each province of Spain, or in each municipality of a province, with the
seats it obtained there and how much has been counted.
WHEN TO USE IT:
During or after the vote count (phase 2), for questions like "who won in each province",
"how many provinces did X win", or to draw a winners map.
INPUT PARAMETERS (What it receives):
- params.scope_id (str, required): parent territory from 'elecciones29n_search_scopes'
(España is '00000000000000000000000b').
- params.chamber ('congreso' default | 'senado').
- params.level (number or name, required): level of the children, one of the scope
'child_levels' (e.g. 30 'provincia' for España). For the Senado, 'circunscripciones' returns
every Senate constituency (provinces and islands); it is only offered on España.
- params.data_source ('auto' default | 'pro' | 'def').
- params.limit (1-1000, default 200).
WHAT IT RETURNS:
- territories: per child: scope_id, code, name, 'count_started', 'winner_basis' ('official'
winner marked by the website, 'inferred_leader' computed from seats then votes, 'tie' or
'not_started'), 'winner' (code, acronym, name, color, votes, votes_pct, seats; null while
not started or tied), 'official_winner', 'inferred_leader', 'winner_seats',
'seats_at_stake', 'census_counted_pct', 'turnout_pct' and the reported ties.
- tally: territories won and seats per candidacy, most territories first (ties excluded).
- count_started, total, truncated, next_step and source.
OPERATING NOTES:
- Before phase 2 it returns no territories and explains why: winners do not exist until
votes are counted. Never infer winners from turnout.
- Seats in 'tally' are the seats won by each territory's winner only, not each party's total:
use 'elecciones29n_get_scope_results' on the parent scope for national seat totals.Inputs: params (required). Returns: Winning party of every child territory.
elecciones29n_list_partiesList 29N candidaciesARead-onlyIdempotent
Use this tool to list the candidacies (parties and coalitions) of the 29N call with their
official name, acronym and color, or to resolve how a party appears in the results.
WHEN TO USE IT:
When the user asks which parties run, or uses a name/acronym you need to match with the
'code' or 'acronym' of the results.
INPUT PARAMETERS (What it receives):
- params.chamber ('congreso' default | 'senado'): candidacies differ between chambers.
- params.query (optional str): words matched against name and acronym, ignoring accents and
case (e.g. 'psoe', 'sumar', 'compromis').
WHAT IT RETURNS:
- parties: code, acronym, name, color and group (agrupación) of each candidacy.
- total, call ('11-26'), next_step and source.
OPERATING NOTES:
- Candidacies that run under different names in some territories share the same 'group'.
- This catalog does not contain votes: use 'elecciones29n_get_scope_results' for results.Inputs: params (required). Returns: Candidacies of the 29N call.
elecciones29n_search_scopesSearch 29N territoriesARead-onlyIdempotent
Use this tool to find the territory (scope) the user asks about: the whole country (España),
an autonomous community, a province, an island, a municipality, a municipal district or a
polling place. Every other results tool needs the 'scope_id' it returns.
WHEN TO USE IT:
After 'elecciones29n_get_status', whenever the user names a place, and to disambiguate
homonyms (e.g. Madrid the community, the province and the city).
INPUT PARAMETERS (What it receives):
- params.queries (list[str], 1-15 terms): names or official territory codes, searched in ONE call. Include
alternative spellings and official names (e.g. ['Alicante', 'Alacant'], ['Gerona', 'Girona']).
Matching ignores accents, case, articles and word order. Numeric terms match official territory codes.
- params.chamber ('congreso' default | 'senado'): the scope tree of that chamber.
- params.level (optional, number or name): 1 nacional, 20 comunidad, 30 provincia, 70 isla,
90 municipio, 100 distrito, 110 local.
- params.limit (1-100, default 20).
WHAT IT RETURNS:
- scopes: matches ordered by exactness and level. Each has 'scope_id' (pass it to the other
tools), 'code' (official territory code), 'name', 'level'/'level_label', 'parents' (enclosing territories
from the country down), 'child_levels' (levels accepted as 'children_level' or winners map
'level'), 'is_constituency' (electoral constituency of the chamber), 'matched_queries' and
'official_url'.
- total_matches / truncated: refine the terms or add 'level' when truncated.
- next_step and source.
OPERATING NOTES:
- Read 'parents' to pick the right homonym; ask the user if it is still ambiguous.
- Polling places (level 110 'local') feed 'elecciones29n_get_polling_stations'.
- Never build a scope_id yourself.Inputs: params (required). Returns: Territories matching the search terms.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 7 tools
Each tool has a clearly distinct role: status, scope search, scope results, winners map, party catalog, polling station listing, and tally sheet retrieval. The descriptions explicitly sequence the workflow and state what each tool does not cover, reducing misselection. Overlap is minimal and handled by cross-references rather than duplicated functionality.
All tools use the same `elecciones29n_` prefix followed by a readable verb_noun pattern in snake_case, such as `get_status`, `search_scopes`, `get_scope_results`, and `list_parties`. The convention is predictable throughout, with no mixed casing or inconsistent verb styles.
Seven tools is well scoped for an election-results server: status, territory discovery, results, winners, parties, polling stations, and tally sheets each earn their place. There is no obvious redundancy or missing bridge tool that would justify adding or removing one.
The surface covers the core 29N lifecycle from publication status through territory search, results, winners, parties, polling places, and tally sheets. Minor gaps exist, such as tally-sheet file access depending on a separate MCP resource read and some endpoints being inferred rather than live-validated, but agents can work around these.
Maintenance
Related MCP Connectors
Web search, structured extraction, page monitor, link check & CVE scan for AI agents over MCP.
Read-only MCP server for 16 German & EU open AI datasets (procurement, budgets, DSA, enforcement).
A shared, open store of facts for AI agents. When an agent needs a specific fact (a software version, a price, a date, who holds a role), it looks it up and gets the value with its sources and a status: agreed (independent sources agree), reported (one source, worth verifying), contested, stale, or a Wikidata record. A lookup can save a web search. After an agent verifies a fact on a public page, it can propose it with the link and the sentence that states it; proposals are checked and held up to 24 hours, then become open data (CC0). Reads work without an account at https://mcp.consci.us/mcp; https://mcp.consci.us/mcp/account signs you in to a free account so your lookups and shared facts count on it. Docs: https://consci.us/docs
Independent directory of agentic AI tools — search, compare & recommend via MCP. Read-only.
Related MCP Servers
- AlicenseAqualityDmaintenanceMCP server for querying Spanish government open data APIs including grants, legislation, company registry, statistics, and open data catalog. Enables LLMs to access Spanish public information on-the-fly.265MIT
- FlicenseNot gradedqualityDmaintenanceMCP server for querying Peruvian electoral data (ONPE) including mesa results, candidate votes, and regional statistics. Enables natural language queries about the 2026 presidential election with local SQLite cache and live API fallback.-
- AlicenseBqualityBmaintenanceEnables querying official partial results from Brazil's 2026 elections directly from TSE data as MCP tools, covering national, state, and municipal races by office with turnout and candidate vote counts. Responses are normalized, cached, and include the TSE update timestamp and percentage of votes counted.241MIT
- AlicenseAqualityBmaintenanceEnables AI assistants to answer Brazilian voters' pre-election questions from TSE open data, including comparing candidates, finding polling places, checking election dates and voting hours, and retrieving candidate details through MCP tools without personal registration data.7MIT