29N Elections MCP
Server Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
| MCP_HOST | No | Bind address in HTTP mode. Set `0.0.0.0` only to expose the server on purpose (for example, inside a container behind a reverse proxy): it has no authentication. | 127.0.0.1 |
| MCP_PORT | No | Port in HTTP mode. The endpoint path is `/mcp`. | 8000 |
| MCP_TRANSPORT | No | `stdio`, or `http` (also `streamable-http`) for Streamable HTTP. | stdio |
| ELECCIONES29N_BASE_URL | No | Origin of the results website and its API. Also used to build the official page links. | https://resultados.29neleccionesgenerales.com |
| ELECCIONES29N_USER_AGENT | No | User-Agent sent to the website. The website firewall rejects non-browser agents. | A current desktop Chrome User-Agent |
Instructions
Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.
elecciones29n MCP — User Guide
Tools to query the official results of Spain's general election of 29 November 2026 (29N)
for the Congreso de los Diputados and the Senado, as published by the Ministerio del
Interior on its results website https://resultados.29neleccionesgenerales.com.
Exclusive Data Source Policy
Always use these tools for any 29N figure: turnout, polling stations, votes, percentages, seats, elected senators, winners by territory.
Never invent, estimate, extrapolate or "complete" numbers. Report only values returned by the tools. If a value is missing, say it is not published yet.
Never present figures from memory, web search or other servers as official 29N results.
If the tools fail, report the actual limitation (the error message tells you what to do next).
Query Flow
The server is stateless: chain the tools by passing the scope_id values they return.
elecciones29n_get_status— call it first. It tells you the current phase, whether the provisional (pro) or definitive (def) data source is active, whether tally sheets are published, and any official alert. Itsturnout_updatenumber is only indicative (it can lag behind the data): report the turnout ofturnout.latest_publishedfrom step 3.elecciones29n_search_scopes— find the territory the user asks about (country, region, province, island, municipality, municipal district, polling place withlevel=110...) by name or official territory code. Pass several spellings in one call (["Madrid", "Comunidad de Madrid"]). Use the returnedscope_id.elecciones29n_get_scope_results— results for onescope_id: constitution of polling stations, turnout updates (with the 2023 comparison), and — once counting has started — vote totals, parties (votes, %, seats, change vs 2023) and, for the Senado, candidates. Usechildren_level(one of the scope'schild_levels) to also get a compact summary of every child territory. During the count, constitution and turnout come from the election-day snapshot.elecciones29n_get_winners_map— the winning party (and its seats) of every child territory of a scope: e.g. the winner in each province of Spain. For the Senado, passlevel="circunscripciones"on España to get every Senate constituency. Readwinner_basis:official(marked by the website),inferred_leader(only leading so far),tieornot_started; say which one applies.elecciones29n_list_parties— candidacies of the 29N call (name, acronym, color), useful to resolve acronyms or check how a party is named.elecciones29n_get_polling_stations— the polling stations (mesas) of one polling place (level 110): theircode, shortlabeland whether each one has been counted.elecciones29n_get_tally_sheet— the tally sheet (acta) of one polling station, by itscode. It returns metadata and aresource_uri; read that resource (elecciones29n://tally-sheet/{chamber}/{mesa_code}) to get the PDF. Only available whenscrutiny_records_availableis true. Do not transcribe figures from the PDF as results.
Key Concepts
Chambers
congreso(default): 350 deputies elected by province (plus Ceuta and Melilla).senado: senators elected by province or island; results include individual candidates.
Scope identifiers
scope_id: 24-character hexadecimal identifier used by the API (España is00000000000000000000000b). Always take it fromelecciones29n_search_scopes, or from thechildren/parentslists of a previous result. Never build it yourself.code: short official territory code shown to people (28= province of Madrid,28079= city of Madrid).level: 1 national, 20 autonomous community, 30 province, 70 island, 90 municipality, 100 municipal district, 110 polling place.child_levels: the levels that can be requested as children of that scope (children_levelinelecciones29n_get_scope_results,levelinelecciones29n_get_winners_map).is_constituency: whether the scope is an electoral constituency (circunscripción) of that chamber.Polling station
code(e.g.2807903650A): municipality, district, section and letter. It is not ascope_id; take it fromelecciones29n_get_polling_stations.
Phases (phase in the status)
0 — constitution of polling stations (morning): how many polling stations opened.
1 — voter turnout updates (14:00 and 18:00): participation so far, compared with 2023.
2 — vote count (from 20:00): votes, percentages and seats as they are counted. Before phase 2 there are no vote counts: do not report party results.
Provisional vs definitive data
Every number exists in two versions: pro (provisional count on election night) and def
(definitive count, published days later). By default (data_source="auto") the tools use the
source the website marks as active. State which one you used (it is in source.data_source).
Previous election
Comparisons refer to the previous general election (call 07-23, 23 July 2023). The 2023
baseline is always the definitive count; the current figures and the deltas use the selected
source.
Data Source and Attribution (MANDATORY)
Every result contains a source object. Always tell the user:
that the figures come from the Ministerio del Interior results website,
the
official_urlof the territory view,the data source used (
proprovisional /defdefinitive) and the phase,the time the data was retrieved from the website (
fetched_at) when the count is still in progress.
Every result also contains next_step: read it, it tells you what to do next.
Procedure if Information is Not Found
Do not invent data or search the web.
Retry the search with other spellings, the official name or the official territory code.
If the data is not published yet (e.g. the count has not started), say so and give the current phase from
elecciones29n_get_status.If it still cannot be found, answer literally: I cannot find this information in the official 29N results.
Capabilities
Features and capabilities supported by this server
Protocol revision2025-11-25
| Capability | Details |
|---|---|
| tools | {
"listChanged": false
} |
| prompts | {
"listChanged": false
} |
| resources | {
"subscribe": false,
"listChanged": false
} |
Tools
Functions exposed to the LLM to take actions
| Name | Description |
|---|---|
| elecciones29n_get_statusA | |
| elecciones29n_search_scopesA | |
| elecciones29n_get_scope_resultsA | |
| elecciones29n_get_winners_mapA | |
| elecciones29n_list_partiesA | |
| elecciones29n_get_polling_stationsA | |
| elecciones29n_get_tally_sheetA | |
Prompts
Interactive templates invoked by user choice
| Name | Description |
|---|---|
No prompts | |
Resources
Contextual data attached and managed by the client
| Name | Description |
|---|---|
| instructions | How to use the elecciones29n tools: flow, identifiers, phases, attribution rules. |
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.