Skip to main content
Glama

¿Cómo va España?

Buscar leyes

buscar_leyes
Read-onlyIdempotent

Busca entre las leyes estatales de la legislación consolidada del BOE (leyes, leyes orgánicas, reales decretos-leyes y reales decretos legislativos) por palabras del título, materia, tipo, año, Gobierno que la aprobó o estado (vigente o derogada). Sin argumentos, da cuántas normas con rango de ley aprobó cada Gobierno y cada año, y las últimas aprobadas. Úsalo para «leyes de vivienda», «decretos-leyes de 2025» o «¿cuántas leyes aprobó cada Gobierno?».

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "buscar_leyes"
  }
}

Input Schema

NameRequiredDescriptionDefault
anoNoAño de la norma.
tipoNoEl rango de la norma.
desdeNoDesde qué fecha (2020, 2020-06 o 2020-06-15), en vez de `ano`.
hastaNoHasta qué fecha.
estadoNoSolo las que están en ese estado.
limiteNoCuántos resultados como mucho (15 por defecto).
materiaNoUna materia del BOE: «Arrendamientos urbanos», «Impuestos», «Seguridad Social».
consultaNoPalabras del título o de la materia: «vivienda», «protección de datos», «amnistía»; o el número: «12/2023».
gobiernoNoEl Gobierno que la aprobó: un presidente («Rajoy», «Sánchez») o un Gobierno concreto («sanchez-2», «aznar-1»).

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 declare readOnly, idempotent, non-destructive and closed-world, so safety is covered. The description adds real behavioral context beyond them: all parameters are optional and calling it with none returns aggregate counts per Gobierno and per year plus the most recently approved laws — a non-obvious default that an agent could not infer from the schema.

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?

Three sentences, front-loaded with the resource and scope, then the zero-argument behavior, then illustrative queries. Efficient overall, though the first sentence's full enumeration of filter dimensions largely duplicates what the schema already lists.

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 nine-parameter, all-optional search tool with no output schema, the description covers scope, filterable fields and the no-argument aggregate case well. It stops short of describing the shape of results for filtered queries (fields returned, ordering, effect of 'limite'), which would matter without an output schema.

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 description coverage is 100%, so every one of the nine parameters is already documented with examples and enums. The description restates the same filter dimensions and reuses the same example values, adding essentially no meaning beyond the schema; baseline 3 applies.

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 ('Busca entre las leyes estatales de la legislación consolidada del BOE') and enumerates the legal ranges covered as well as the filterable dimensions (título, materia, tipo, año, Gobierno, estado). An agent can immediately tell this is the law-search tool rather than the single-law lookup or any of the political-data siblings.

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?

Provides concrete example queries ('leyes de vivienda', 'decretos-leyes de 2025', '¿cuántas leyes aprobó cada Gobierno?') that map directly onto intended use, plus the no-argument aggregate mode. It does not, however, name the alternative for retrieving a single law's full text (e.g. consultar_ley), so the boundary with that sibling is left implicit.

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