turkiye-secim-mcp
Server Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
| TURKIYE_SECIM_CACHE_DIR | No | Directory used for the local cache where YSK election data is downloaded. Overrides the default user cache directory. The package bundles no data. |
Instructions
Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.
Turkish election results from the YSK Open Data API: parliamentary elections 2011, Jun 2015, Nov 2015, 2018, 2023; presidential elections 2014, 2018, 2023 (rounds 1 and 2); local elections 31 Mar 2019 and 31 Mar 2024 (metropolitan mayor and mayor races; plus the 23 Jun 2019 Istanbul re-run); constitutional referendums 2010 and 2017 (EVET/HAYIR); at Turkey, province (il) and district (ilce) level, plus cross-election comparison and district rankings. In LOCAL elections 'ilce' means the municipality: every district-centre municipality and every belde municipality is its own row (belde rows are named 'DISTRICT - BELDE'); in the mayor election (belediye_baskani) 'il' and 'turkiye' are sums of many separate races, in the metropolitan one (buyuksehir_belediye_baskani) 'turkiye' is the sum of the 30 metropolitan provinces. Always read each election's 'note' (list_elections) before interpreting local results. All figures are RAW API totals, not officially declared results: alliance-marked votes (2018, 2023) are not distributed to parties, so party totals can be lower than the YSK-declared ones; get_sources lists, per election, the official reference and how the API differs from it. Always quote the 'data_label' and 'sources' fields. The package ships no election data: it is downloaded into the user's cache on first use. Province-level questions are fast right away; Turkey-wide district questions need a one-time download per election (about 1.5 minutes): if a tool says the district data is not ready, tell the user plainly and call prepare_data (repeat until complete=true) or ask them to run turkiye-secim-mcp --hazirla. Do not infer or comment politically beyond the returned numbers.
Capabilities
Features and capabilities supported by this server
Protocol revision2025-11-25
| Capability | Details |
|---|---|
| tools | {
"listChanged": true
} |
| logging | {} |
| prompts | {
"listChanged": true
} |
| resources | {
"subscribe": false,
"listChanged": true
} |
Tools
Functions exposed to the LLM to take actions
| Name | Description |
|---|---|
| list_electionsA | List the elections available in this server with ids, dates, kind and supported levels (turkiye, il, ilce): parliamentary 2011, 2015 June, 2015 November, 2018, 2023; presidential 2014, 2018, 2023 (rounds 1 and 2); referendums 2010 and 2017 (kind 'halkoylamasi', EVET/HAYIR); local 2019 and 2024: 'buyuksehir_belediye_baskani' (metropolitan mayor, 30 provinces; also the 23 June 2019 Istanbul re-run) and 'belediye_baskani' (all other mayor races). Local elections carry a 'note' explaining what 'il' and 'ilce' (= municipality) mean for them; read it. |
| search_placeA | Find a province (il) or district (ilce) by name. Case, Turkish characters and accents are ignored ('hatay', 'ISKENDERUN', 'urfa' all work). Province search always works; district search needs the one-time district download (see prepare_data) and says so if it is missing. Pass 'election' (e.g. a local election id) to search that election's own units: in local elections these are municipalities, including belde municipalities named 'DISTRICT - BELDE'. |
| get_resultsA | Vote totals for an election at Turkey, province or district level (omit province for Turkey; pass province, plus district for a district). 'election' is an id from list_elections, e.g. '2023-05-14-mv'. Returns RAW YSK API figures (data_label='ham'): registered voters, turnout, valid and invalid votes, and per-party (or per-candidate; referendums: 'choices' EVET/HAYIR) votes with percent of valid votes. Alliance votes are listed separately and never distributed; vote_basis='alliance_distributed' is not available. In local elections 'district' selects a municipality (district-centre or belde, e.g. 'Besni' or 'Besni - Kesmetepe'); a province result is the sum of all mayor races there (belediye_baskani) or the metropolitan mayor race (buyuksehir_belediye_baskani). |
| get_turnoutA | Voter turnout (registered voters, voters who voted, turnout percent) ranked by turnout. level='il' ranks provinces (or returns one province if 'province' is given); level='ilce' returns the districts of the given province, or all districts of Turkey when province is omitted (that needs the one-time district download, see prepare_data). RAW YSK API figures. scope_total holds the total for the whole scope. |
| compare_electionsA | Compare two elections (A = earlier, B = later): change in vote share (percentage POINTS, B minus A), votes and turnout. With no province/district/level it compares Turkey as a whole (all parties). With province it compares that province; with province+district one district. With level='il' (or level='ilce', optionally with province) it returns a table of units sorted by the change in 'party' (or by turnout change if no party is given), biggest rise first (order='desc'). Party and candidate names are matched by name across elections; a documented lineage note is attached when a party did not run under its own name (e.g. HDP 2018 vs Yesil Sol Parti 2023); votes are never merged. Turkey-wide district tables need the one-time district download for both elections (prepare_data). RAW YSK API figures. |
| rank_districtsA | Rank districts (ilce) by a party's vote share ('pct'), votes ('votes'), turnout ('turnout', no party needed) or the change in vote share versus another election ('change_vs', needs compare_to; change = election minus compare_to, percentage points). Within one province (province given) or across Turkey (province omitted; needs the one-time district download for the election, see prepare_data). Districts are matched across elections by (province, district name); unmatched ones are counted in 'unmatched'. RAW YSK API figures. |
| get_sourcesB | Provenance of every dataset: data owner (YSK), API base, per election the endpoints used, download dates, official reference (YSK decision / Official Gazette), what 'ham' (raw) means versus official results, the licence note, the party lineage table with its sources, and fetch politeness settings. |
| prepare_dataA | Download the district-level data of an election to this computer (one-time, ~81 small requests, about 1.5 minutes; YSK is queried politely, at most 2 requests per second). Call with election=None to see the status of all elections. Each call downloads for at most max_seconds (default 45) and can be repeated; progress is kept. 'complete': true means district queries for that election are fast. |
Prompts
Interactive templates invoked by user choice
| Name | Description |
|---|---|
No prompts | |
Resources
Contextual data attached and managed by the client
| Name | Description |
|---|---|
No resources | |
TDQS
Scored across 8 tools
Each tool has a reasonably distinct role, but there is some overlap between get_results, get_turnout, compare_elections and rank_districts — turnout and district rankings can partly be derived from get_results. Descriptions do a good job disambiguating by spelling out parameters and levels, though an agent may still hesitate between rank_districts(change_vs) and compare_elections(level='ilce').
All eight tools follow a consistent snake_case verb_noun pattern: list_elections, search_place, get_results, get_sources, get_turnout, compare_elections, rank_districts, prepare_data. The verbs (list/get/search/compare/rank/prepare) map sensibly onto the action performed.
Eight tools is well within the ideal 3-15 range and each one earns its place: discovery, place lookup, results, turnout, comparison, ranking, provenance and a data-preparation step. No tool looks redundant or filler.
The surface covers the full analysis lifecycle: list elections, find places, fetch raw results, turnout, compare, rank, verify provenance and pre-download district data. Minor gaps exist — no tool to list parties/candidates or party lineage directly, and province-level ranking (as opposed to district ranking) is not available — but agents can work around these via get_results and get_sources.