Skip to main content
Glama

¿Cómo va España?

Datos de un municipio, provincia o comunidad

consultar_territorio
Read-onlyIdempotent

Da los datos de un lugar de España: un municipio (los 8.100 que hay), una provincia o una comunidad autónoma. Sin indicador, devuelve su ficha: población, paro, renta, desigualdad, alquiler, criminalidad y el resto de datos que se publican de ese lugar, con el de España al lado; en los municipios, también el paro por sexo, edad y sector, los contratos del mes y la renta de sus distritos y secciones censales. Con indicador, devuelve ese dato en ese lugar con su evolución; si no se publica a ese nivel, da el de su provincia o comunidad y lo avisa. Úsalo para «¿cuánto paro hay en Málaga?», «datos de Getafe» o «alquiler en Baleares desde 2015».

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": {
      "lugar": "<lugar>"
    },
    "name": "consultar_territorio"
  }
}

Input Schema

NameRequiredDescriptionDefault
tipoNoPara elegir cuando el nombre vale para varios (Málaga es municipio y provincia; Madrid, municipio y comunidad). Sin él se elige el más pequeño que tenga el dato.
desdeNoCon `indicador`: primer periodo de la serie (2015, 2015-T1, 2015-01).
hastaNoCon `indicador`: último periodo de la serie.
lugarYesNombre del municipio, la provincia o la comunidad autónoma («Getafe», «Málaga», «Castilla y León»), o el código INE de cinco cifras de un municipio.
seccionNoEn la ficha de una comunidad o provincia, solo los datos de una sección (empleo, vivienda, demografia...).
indicadorNoIdentificador del indicador (por ejemplo «tasa-paro»), tal como lo devuelve `buscar_indicadores`. También vale su nombre. Opcional: sin él se devuelve la ficha del lugar.
max_puntosNoCon `indicador`: cuántos puntos de la serie como mucho (40 por defecto).

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed7 schema fields changed
    • removedInput schema / $schema
      Removed value: -"https://json-schema.org/draft/2020-12/schema"
    • removedInput schema / properties / desde / anyOf
      Removed value: -[
      -  {
      -    "maxLength": 12,
      -    "type": "string"
      -  },
      -  {
      -    "maximum": 9007199254740991,
      -    "minimum": -9007199254740991,
      -    "type": "integer"
      -  }
      -]
    • addedInput schema / properties / desde / maxLength
      Added value: +12
    • addedInput schema / properties / desde / type
      Added value: +"string"
    • removedInput schema / properties / hasta / anyOf
      Removed value: -[
      -  {
      -    "maxLength": 12,
      -    "type": "string"
      -  },
      -  {
      -    "maximum": 9007199254740991,
      -    "minimum": -9007199254740991,
      -    "type": "integer"
      -  }
      -]
    • addedInput schema / properties / hasta / maxLength
      Added value: +12
    • addedInput schema / properties / hasta / type
      Added value: +"string"
  2. First observed

TDQS

A4.1/5.0
Behavior4/5

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

Annotations already cover the safety profile (readOnly, idempotent, non-destructive, closed-world), so the description's job is to add behaviour, which it does: it lists what the ficha contains, notes the Spain benchmark alongside, details municipal extras (paro por sexo/edad/sector, contratos, distritos y secciones censales) and discloses that an unavailable indicator silently degrades to the province/comunidad with a warning. That fallback-with-warning is exactly the kind of non-obvious behaviour an agent needs; only response size or truncation limits are left unstated.

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?

Front-loads the core purpose, then the no-indicador behaviour, then the with-indicador behaviour, then example queries — a logical order with no filler sentences. It is dense and long-ish, but each clause carries information (contents of the ficha, fallback rule, use cases) rather than restating the title.

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

Completeness4/5

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

For a seven-parameter, no-output-schema tool this covers the essentials: both operating modes, what the ficha returns, the sub-municipal granularity, and the degradation rule. What is missing is modest — no mention of how large the ficha response is or how the series is bounded by default beyond the schema's 40-point note.

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

Parameters3/5

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

Schema coverage is 100%, so the schema already documents all seven parameters including the enum and the period formats. The description adds the meaningful mode switch tied to `indicador` (ficha vs. evolución) and the «desde 2015» period example, but does not add semantics for `seccion`, `max_puntos` or the INE-code form of `lugar` beyond what the schema states. Baseline 3 is appropriate.

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?

States a specific verb and resource ('Da los datos de un lugar de España') and immediately enumerates the three supported entity types with their scale (8.100 municipios, provincias, comunidades). It also splits the tool into its two distinct behaviours (ficha vs. serie por indicador), which lets an agent distinguish it from consultar_indicador or comparar_territorios without opening the schema.

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

Usage Guidelines4/5

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

Gives concrete trigger queries («¿cuánto paro hay en Málaga?», «datos de Getafe», «alquiler en Baleares desde 2015») that map directly to the two modes, and explains the fallback rule when a dato is not published at the requested level. It does not name sibling tools or state when to prefer comparar_territorios or consultar_indicador instead, so the routing guidance is implicit rather than explicit.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources