Skip to main content
Glama

buscar_normas

Search Peru's official legal norms in the SPIJ by keyword, sumilla, device type, sector, number, or publication date range, returning paginated results with summaries and links.

Instructions

Busca normas legales en el SPIJ (normas generales, administrativas, etc).

Args: consulta: texto libre en el contenido. El buscador hace AND implicito con TODAS las palabras (ej 'transferencia partidas'). OJO: NO acepta comillas ni OR. Si acepta comodin al final de una raiz, ej 'presupuest*'. Empieza con 1-2 palabras. sumilla: texto a buscar solo en la sumilla (resumen) de la norma. dispositivo: tipo de dispositivo legal, ej 'DECRETO SUPREMO'. Acepta parcial ('decreto sup') y se resuelve solo; si es ambiguo devuelve candidatos. Ver listar_filtros. sector: entidad emisora, ej 'ECONOMIA Y FINANZAS'. Acepta parcial. agrupacion: grupo del acervo, ej 'LEGISLACION SUPRANACIONAL'. numero: numero del dispositivo, ej '200-2026-EF' o '31068' (sin prefijo 'Nº'). OJO: algunas leyes no estan indexadas como registro propio; en ese caso la respuesta trae los documentos que lo mencionan (con una nota que lo explica). fecha_ini / fecha_fin: rango de publicacion, formato AAAA-MM-DD. orden: '1' = fecha (recientes primero, default), '2'/'3'/'4' = relevancia. start: desplazamiento (multiplo de 10). Pagina N -> start = (N-1)*10. paginas: paginas consecutivas a traer en una sola llamada (cada pagina = 10 resultados, max 10 paginas). sumilla_chars: maximo de caracteres de la sumilla por documento (0 = sin limite). Para leer la sumilla completa usa detalle_norma(id).

Devuelve: ok, total, desde, hasta, siguiente_start (si hay mas paginas), normas: lista de {id, url_web, codigoNorma, dispositivoLegal, sector, fechaPublicacion, sumilla} (con 'sumilla_total' si se acoto). Ante 0 resultados devuelve 'nota' y 'sugerencias' ({param, consulta, total} de versiones mas cortas de la consulta o de la sumilla, sin filtros categoricos).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
ordenNo1
startNo
numeroNo
sectorNo
paginasNo
sumillaNo
consultaNo
fecha_finNo
fecha_iniNo
agrupacionNo
dispositivoNo
sumilla_charsNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.6.1

TDQS

A4.9/5.0
Behavior5/5

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

No annotations exist, so the description carries the full burden, and it does: ordering defaults, pagination semantics (start multiples of 10, paginas up to 10), the exact shape of the zero-result response (nota + sugerencias with shortened queries), and the ambiguity/candidate behavior for partial dispositivo values.

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-loaded one-line purpose followed by clearly separated Args and Devuelve sections; nearly every sentence adds an example or a warning. It is dense and long, but the length is justified by 12 undocumented parameters and no output schema.

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?

With no annotations, no output schema, and 0% schema coverage across 12 parameters, the description supplies everything an agent needs: input semantics, return fields, pagination, ordering, and error/empty-result behavior.

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?

Schema description coverage is 0%, yet every one of the 12 parameters is documented with format, examples, and pitfalls ('200-2026-EF', 'sin prefijo Nº', AAAA-MM-DD, sumilla_chars=0 means no limit, start=(N-1)*10). This fully compensates for the empty schema.

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 normas legales en el SPIJ') with the scope of the corpus (normas generales, administrativas). The resource distinction from buscar_jurisprudencia is implicit in the terminology, and it explicitly points to detalle_norma and listar_filtros for adjacent needs.

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?

Gives concrete query-construction rules (AND semantics, no quotes/OR, trailing wildcard, start with 1-2 words) and routes the agent to siblings: listar_filtros for ambiguous dispositivo, detalle_norma for the full sumilla. It also explains fallback behavior when a numeric law is not indexed as its own record.

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