Skip to main content
Glama

Buscando sentencias

buscar_sentencias

Search full-text Peruvian Constitutional Court resolutions from both current and historical (2001-2018) inventories in one unified, deduplicated query.

Instructions

Busca en el TEXTO COMPLETO de TODAS las resoluciones del Tribunal Constitucional, COMBINANDO los dos inventarios del TC en una sola vista: (a) la sistematizacion actual (indice Elasticsearch del portal, hasta 2026) y (b) el inventario historico de resoluciones (2001-2018). El server QUITA TILDES del texto (el indice NO matchea acentos) y fusiona las filas con dedup de documento.

Args: search: texto a buscar en el contenido del fallo (multi-palabra si funciona en el motor historico; el comodin '' tambien: 'funcionarios'). Con total 0 prueba otra palabra clave o pasa a busqueda_avanzada. page: pagina 1-based (cap de 1000 paginas en ambos inventarios). modo: (inventario historico) 'todas' (contenga TODAS las palabras; default), 'algunas' (contenga ALGUNAS) o 'frase' (la frase completa).

Devuelve: {'ok', 'total' (suma de ambos inventarios), 'pagina', 'tamano_pagina' (variable: hasta 20 filas por bloque), 'paginas' (maximo entre inventarios), 'siguiente_pagina', 'filas': [{index GLOBAL, numero_expediente, numero_sentencia?, demandante, demandado, fecha_publicacion, fecha_sentencia?, fecha_ingreso?, sentido?, tipo?, distrito?, sala?, tesaurio?, slug?, url_pdf, extractos/texto}], 'ms', 'nota'?}: las filas del bloque primero vienen de la sistematizacion actual y luego del inventario historico; los documentos repetidos en ambos se omiten (dedup, declarado en 'nota'). El TEXTUAL para fichas completas: detalle_sentencia (si la fila trae 'slug').

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
modoNo
pageNo
searchYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.4.0

TDQS

A4.7/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 behavioral burden and delivers: accent/tilde stripping so unmatched accents are explained, cross-inventory dedup of repeated documents surfaced in 'nota', block ordering (current index first, then historical), a 1000-page cap, and variable page size of up to 20 rows. These are non-obvious traits an agent could not infer from schema or annotations.

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?

It is long and dense, but front-loaded with purpose and then cleanly partitioned into Args and Devuelve sections, so every part earns its place. Slight verbosity in the return-value paragraph keeps it from a 5.

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?

For a tool merging two heterogeneous sources with an output schema present, the definition covers query syntax, pagination limits, dedup semantics, row ordering, and how to chain into detalle_sentencia. Nothing an agent needs to call it correctly is missing.

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: 'search' explains multi-word behavior and the '*' wildcard, 'page' explains 1-based indexing and the 1000-page cap, and 'modo' supplies the effective enum ('todas'|'algunas'|'frase') that the schema's untyped anyOf string omits. This fully compensates for the coverage gap.

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?

The description names a specific verb (Busca) and a precisely scoped resource: full text of ALL Tribunal Constitucional resolutions, explicitly clarifying that it merges the current systematization index and the historical inventory. It routes the agent away from the sibling busqueda_avanzada, so it is distinguishable without opening any schema.

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?

It gives concrete fallback conditions: 'Con total 0 prueba otra palabra clave o pasa a busqueda_avanzada' and points to detalle_sentencia for full records when a 'slug' is present. Alternatives are named with conditions, though the other siblings (resultados_sistematizacion, resultados_tesauro, listar_*) are not contrasted.

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