Skip to main content
Glama

Buscando jurisprudencia

buscar_jurisprudencia

Search Peru's SPIJ jurisprudence by free-text query, organism, date range, or case number to retrieve relevant rulings, precedents, and sentences.

Instructions

Busca jurisprudencia en el SPIJ (TC, cortes, precedentes, sentencias).

Args: consulta: texto libre (AND implicito, sin comillas ni OR; comodin * ok). Empieza con 1-2 palabras. tomo: tomo de jurisprudencia, ej 'TRIBUNAL CONSTITUCIONAL'. OJO: se envia al SPIJ pero el indice NO lo aplica (verificado: los totales son identicos con y sin tomo) - filtra con la consulta y/o fechas. materia: especialidad dentro del tomo, ej 'JURISPRUDENCIA ADMINISTRATIVA' del tomo del TC. Ver listar_filtros(categoria='materias'). organismo: filtra LOCALMENTE por organismo emisor, ej 'TC', 'CORTE SUPREMA', 'OSIPTEL', 'CGD' (coincide contra codigo/sector/dispositivo, sin acentos). El servidor escanea hasta 5 paginas del SPIJ y devuelve solo los coincidentes (con 'filtrados' y 'escaneadas'). Es la via correcta: el indice no filtra por tomo. numero: numero de expediente o codigo, ej '03209-2024-PA/TC' (expediente completo del TC funciona). fecha_ini / fecha_fin: rango de publicacion AAAA-MM-DD. orden: '1' = fecha (default), '2'/'3'/'4' = relevancia. start / paginas: igual que buscar_normas (por cada pagina devuelta el servidor puede escanear varias internamente). sumilla_chars: maximo de caracteres de la sumilla por documento (0 = sin limite).

Devuelve: ok, total (del indice), organismo, escaneadas (paginas escaneadas), filtrados (coincidencias encontradas), normas, siguiente_start (si quedan paginas por escanear). Si la consulta base arroja 0 resultados incluye 'sugerencias'; si el indice arroja resultados pero ninguno del organismo pedido, incluye 'organismos_disponibles' (los organismos presentes en lo escaneado). El texto se obtiene con detalle_norma(id) o texto_completo(id).

Input Schema

NameRequiredDescriptionDefault
tomoNo
ordenNo1
startNo
numeroNo
materiaNo
paginasNo
consultaNo
fecha_finNo
fecha_iniNo
organismoNo
sumilla_charsNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.6.1

TDQS

A4.7/5.0
Behavior5/5

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

With no annotations this description carries the full burden, and it delivers: it discloses that the SPIJ index ignores 'tomo' (verified), that 'organismo' filters locally by scanning up to 5 pages, that internal page scanning happens per returned page, and the fallback fields ('sugerencias', 'organismos_disponibles'). That is unusually rich behavioral disclosure about partial results and limitations.

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 purpose then organizes the rest into clear Args/Devuelve blocks, and nearly every line conveys actionable information (param syntax, verified limitation, return fields). It is long, but the length is justified by 11 undocumented parameters, keeping it dense rather than padded.

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 output schema, the Devuelve block explains the return shape (ok, total, organismo, escaneadas, filtrados, siguiente_start, and conditional sugerencias/organismos_disponibles) and points to detalle_norma/texto_completo for full text. Combined with per-parameter guidance, an agent has everything needed to invoke and interpret this tool.

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% across 11 parameters, so the description must compensate – and it near-fully does. Every parameter is documented: consulta query syntax (implicit AND, no OR/quotes, '*' wildcard, start with 1-2 words), tomo, materia, organismo matching behavior, numero format, date range format, orden codes, start/paginas, and sumilla_chars limit semantics.

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+resource ('Busca jurisprudencia en el SPIJ') and the parenthetical '(TC, cortes, precedentes, sentencias)' scopes exactly what kinds of documents are returned. This cleanly separates it from the norms-oriented siblings such as buscar_normas and buscar_en_norma.

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 strong operational guidance: warns that 'tomo' is sent but NOT applied at index level, and explicitly calls 'organismo' 'la via correcta' for filtering, plus routes to listar_filtros for materias values. It lacks an explicit statement of when to prefer this tool over buscar_normas/buscar_en_norma, so it is clear context rather than full when/when-not framing.

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