Search 29N territories
elecciones29n_search_scopesFind and disambiguate territories—country, community, province, island, municipality, district, or polling place—and return the scope_id required by other election-result tools.
Instructions
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.Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"params": "<params>"
},
"name": "elecciones29n_search_scopes"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| params | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| level | No | ||
| scopes | Yes | ||
| source | Yes | ||
| chamber | Yes | ||
| queries | Yes | ||
| next_step | Yes | ||
| truncated | Yes | ||
| total_matches | Yes |