Skip to main content
Glama

Obteniendo detalle de la norma

detalle_norma

Fetch metadata and plain text of a Peruvian legal norm by its SPIJ ID, with offset paging to read long documents in chunks or from the end.

Instructions

Devuelve los METADATOS y el TEXTO de una norma del SPIJ por su id.

Args: id: identificador del SPIJ, ej 'H1453062' (lo devuelve buscar_normas). offset: desde que caracter del texto empezar (0 = inicio). max_chars: maximo de caracteres de texto a devolver en esta llamada (0 = usa el limite por defecto). Si el texto es mas largo, 'siguiente_offset' indica por donde continuar. desde_final: si es True, devuelve los ULTIMOS max_chars caracteres (en sentencias judiciales la decision 'RESUELVE' esta al final).

Devuelve: ok, id, url_web (para abrir la norma en el sitio SPIJ), codigoNorma, dispositivoLegal, sector, fechaPublicacion, ruta, titulo, sumilla, texto (texto plano, sin HTML), total_caracteres, texto_truncado, siguiente_offset (si hay mas texto).

Nota: si el texto es muy largo para tu contexto, lee por rangos con offset (ej offset=20000) o la cola con desde_final=True.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYes
offsetNo
max_charsNo
desde_finalNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.6.1

TDQS

A4.2/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 it discloses meaningful behavior: text is returned as plain text without HTML, truncation is signalled via texto_truncado/siguiente_offset, and a url_web is provided for opening in SPIJ. It does not cover auth requirements, rate limits, or error behavior, which are the remaining gaps.

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?

Organized into Args / Devuelve / Nota sections and front-loaded with the core purpose. The paging mechanism is restated across max_chars, siguiente_offset, and the closing Nota, which is mild redundancy but aids readability rather than harming it.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/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 returned fields (ok, id, url_web, codigoNorma, texto, total_caracteres, siguiente_offset, etc.) and explains the pagination contract, so an agent can consume the result correctly. Missing only ancillary details like permissions or failure modes.

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 four parameters is explained with meaning beyond its type — id with format example and provenance, offset (0 = start), max_chars (0 = default) with the truncation contract, and desde_final with the rationale for the 'RESUELVE' tail case.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb and resource ('Devuelve los METADATOS y el TEXTO de una norma del SPIJ por su id'), so the agent knows exactly what it returns. It does not, however, distinguish itself from overlapping siblings such as texto_completo or estructura_norma, which likely also surface norm content.

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 clear operating context: the id comes from buscar_normas, long texts should be read by ranges with offset, and the tail can be fetched with desde_final for judicial decisions where 'RESUELVE' sits at the end. It stops short of explaining when to choose this over the overlapping siblings (texto_completo, estructura_norma).

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