Skip to main content
Glama

Buscando dentro de la norma

buscar_en_norma

Search a word or phrase inside a SPIJ legal norm's full text and return each occurrence with its offset so you can jump to specific sections without reading everything.

Instructions

Busca una palabra o frase DENTRO del texto completo de una norma del SPIJ, y devuelve cada ocurrencia con su offset (para leer alrededor con texto_completo(id, offset=X, max_chars=N)). Ideal para saltar a secciones concretas (ej 'RATIFICAN', 'Artículo 8', 'DISPOSICIONES FINALES') sin leer todo el texto. La busqueda ignora acentos y mayusculas.

Args: id: identificador del SPIJ, ej 'H1385488'. texto: palabra o frase a buscar dentro de la norma (1-8 palabras). contexto: caracteres de contexto alrededor de cada ocurrencia (50-500, default 200). max_matches: maximo de ocurrencias a devolver (1-25, default 10).

Devuelve: ok, id, url_web, total_caracteres, matches: lista de {offset, extracto}, hay_mas (si quedan ocurrencias).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYes
textoYes
contextoNo
max_matchesNo

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 well: it discloses that search ignores accents and capitalization, that offsets enable targeted reading, and that hay_mas signals truncation. It does not mention access/permission requirements or result-size limits beyond max_matches, but for a read-only lookup this is solid disclosure.

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?

Well front-loaded: purpose and usage come first, followed by Args and Devuelve blocks. The text is longer than average but nearly every line carries usable information; the Args/Devuelve headers make it scannable.

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, yet the description enumerates the return shape (ok, id, url_web, total_caracteres, matches[].{offset, extracto}, hay_mas), so an agent can chain calls to texto_completo without guessing. Combined with full parameter documentation, nothing essential 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%, and the description fully compensates: it documents all four parameters with meaning, accepted ranges and defaults (contexto 50-500 default 200; max_matches 1-25 default 10), the id format example ('H1385488'), and that texto is 1-8 words.

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+scope: search a word/phrase DENTRO del texto completo de una norma (not across norms), returning each occurrence with its offset. It is clearly distinguishable from siblings such as buscar_normas (search across norms) and buscar_jurisprudencia.

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 an explicit use case and workflow: 'Ideal para saltar a secciones concretas... sin leer todo el texto', and names the companion tool texto_completo(id, offset=X, max_chars=N) for reading around a hit. It lacks an explicit when-not statement (e.g. use buscar_normas when you don't know the id), which keeps it from a 5.

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