Skip to main content
Glama

detalle_norma

Fetch metadata and plain text of a Peruvian legal norm by its SPIJ ID, with pagination for long texts. Use offsets to read specific ranges or final sections of judicial decisions.

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 behavioral burden and does well: it discloses the return shape (texto sans HTML, total_caracteres, texto_truncado, siguiente_offset) and the truncation/continuation behavior. It stops short of stating permissions or rate limits, but for a read tool that is minor.

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?

Structured as Args/Devuelve/Nota with the core action front-loaded. Each section earns its place, though the closing 'Nota' partly repeats the offset/desde_final guidance already given in Args, adding mild redundancy.

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 and no annotations, yet the description documents parameters, return fields, and pagination. It is self-sufficient for correct invocation; only the lack of differentiation from the texto_completo sibling leaves a small gap.

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 fully: id format example 'H1453062' plus its source, offset as character index with 0=start, max_chars with 0=default limit and truncation behavior, and desde_final semantics with a rationale for judicial sentences.

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') and clarifies where the id comes from (buscar_normas). It is clear what the tool does, though it does not explicitly differentiate itself from the similar sibling texto_completo.

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: how to page long texts via offset/desde_final, that desde_final targets the trailing 'RESUELVE' of judicial sentences, and a closing note to read in ranges when the text exceeds context. No explicit when-not-to-use versus siblings, but the pagination context is clear.

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