Skip to main content
Glama

Buscando normas

buscar_normas

Search Peru's official legal norms by keywords, summary, device type, issuing sector, number, or publication date to locate relevant legislation.

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.5/5.0
Behavior4/5

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

With no annotations, the description carries the full burden and does disclose real behavior: implicit AND over all words, no quotes or OR allowed, trailing wildcard support, partial-value resolution for 'dispositivo' returning candidates when ambiguous, the indexing gap where some laws surface only as referencing documents, and the nota/sugerencias fallback on zero results. It omits any auth/permission or rate-limit context, which for a public search corpus is a minor gap.

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 one-line purpose, then a dense Args block and a Devuelve block; nearly every line earns its place given the 0% schema coverage. It is long, but the length is driven by real per-parameter quirks rather than padding, so only marginally verbose.

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?

No output schema exists, and the description fully covers the return shape (ok, total, desde, hasta, siguiente_start, the norms record fields, sumilla_total truncation) plus the zero-result nota/sugerencias structure. An agent has everything needed to call it and interpret the response correctly.

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%, so the description must compensate and it does: every one of the 12 parameters is documented with format and semantics (free-text syntax rules, number without 'Nº' prefix, AAAA-MM-DD dates, orden codes 1-4, start as a multiple of 10 with the (N-1)*10 formula, paginas cap of 10). This is meaning the schema alone could never convey.

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 with its corpus: 'Busca normas legales en el SPIJ (normas generales, administrativas, etc)'. That immediately separates it from buscar_jurisprudencia and from within-document tools like buscar_en_norma, and it explicitly points to two siblings (listar_filtros, detalle_norma) 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 Guidelines4/5

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

Gives concrete operating guidance: start with 1-2 words, use detalle_norma(id) for the full sumilla, and consult listar_filtros when 'dispositivo' is ambiguous. It does not explicitly state when to prefer this over buscar_jurisprudencia or buscar_en_norma, so routing between the closest siblings is left to inference.

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