Skip to main content
Glama

buscar_jurisprudencia

Search Peruvian jurisprudence in SPIJ by query, organism, date, case number, or subject. Retrieve Constitutional Court, court, precedent, and ruling records.

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

TableJSON 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.9/5.0
Behavior5/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 so: it discloses that tomo is ignored by the index, that organismo filters locally by scanning up to 5 SPIJ pages, and it documents practical failure modes ('sugerencias' on zero results, 'organismos_disponibles' when no match under the requested organismo). This is unusually thorough behavioral context beyond a bare verb+resource statement.

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 purpose followed by well-separated Args and Devuelve blocks make it easy to scan. It is long, but the length is justified by the 11 undocumented parameters and absent output schema; only minor redundancy between the tomo/organismo notes.

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 description supplies the return contract itself (ok, total, organismo, escaneadas, filtrados, normas, siguiente_start, plus conditional sugerencias / organismos_disponibles). Combined with per-parameter guidance, an agent has everything needed to invoke and interpret the call.

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% and there are 11 parameters, so the description must compensate fully. It documents essentially every parameter with format hints and quirks: consulta syntax rules (implicit AND, no quotes/OR, wildcard *, start with 1-2 words), expediente formats like '03209-2024-PA/TC', AAAA-MM-DD dates, orden codes, and sumilla_chars=0 meaning unlimited.

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 (Busca) and resource (jurisprudencia en el SPIJ), and scopes it with concrete content types (TC, cortes, precedentes, sentencias). An agent can distinguish it from the sibling buscar_normas without opening either schema.

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?

Explicitly routes usage: warns that 'tomo' is not applied by the index and that organismo is the correct filter path, and points to listar_filtros(categoria='materias') for enumerating values. It also names detalle_norma / texto_completo as the follow-up tools for retrieving full text, giving clear when-to-use and next-step guidance.

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