Skip to main content
Glama
29N Elections MCP

29N Elections MCP

Search 29N territories

elecciones29n_search_scopes
Read-onlyIdempotent

Find 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

NameRequiredDescriptionDefault
paramsYes

Output Schema

NameRequiredDescriptionDefault
levelNo
scopesYes
sourceYes
chamberYes
queriesYes
next_stepYes
truncatedYes
total_matchesYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.9/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Beyond the read-only/idempotent annotations, the description discloses matching semantics (accents, case, articles and word order ignored; numeric terms match official codes), truncation handling via 'total_matches'/'truncated', and the safety rule 'Never build a scope_id yourself'. It also tells the agent to inspect 'parents' to resolve homonyms.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The definition is front-loaded with purpose and organized under WHEN TO USE / INPUT PARAMETERS / WHAT IT RETURNS / OPERATING NOTES headings. It is longer than strictly necessary because the parameter block duplicates schema descriptions, but no section is irrelevant to correct invocation.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The tool is a multi-parameter search with homonym risk, and the description covers precondition, parameter strategy, return fields, truncation recovery, and follow-up routing. An output schema exists, so the return-value section is bonus rather than a requirement, and nothing needed to call it correctly is missing.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

With reported schema coverage at 0%, the description carries the full burden and does so: it explains 'queries' batching (1-15 terms, one call, alternative spellings), 'chamber' default, the full level code table, and the 'limit' range and default. It adds strategic meaning, such as using 'level' to resolve homonyms, rather than merely restating types.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description uses a specific verb and resource ('find the territory (scope)') and enumerates the territory types (country, community, province, island, municipality, district, polling place). It also differentiates itself from siblings by stating that every other results tool needs the 'scope_id' it returns.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

It gives explicit ordering ('After elecciones29n_get_status'), the triggering condition ('whenever the user names a place'), and a named purpose for homonym disambiguation. It also routes level-110 polling places to 'elecciones29n_get_polling_stations', so the agent knows when a sibling is the better next call.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.