Skip to main content
Glama

estructura_norma

Retrieve the heading index and offsets of a legal norm to read specific articles or sections from Peru's SPIJ system.

Instructions

Devuelve el INDICE de encabezados de una norma del SPIJ, con el offset de cada uno para leer secciones concretas con texto_completo(id, offset=X, max_chars=N).

Args: id: identificador del SPIJ, ej 'H1453062' (lo dan buscar_*).

Devuelve: ok, id, url_web, fuente, total_caracteres, total_encabezados, encabezados: lista de {tipo: 'seccion'|'articulo', titulo, offset} (hasta 150; con 'siguiente_encabezado' si hay mas). Los offsets apuntan al mismo texto canonico que sirve texto_completo. Si la norma no tiene encabezados (sentencias del TC son prosa), 'encabezados' viene vacia: usa buscar_en_norma o lectura por rangos.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.6.1

TDQS

A4.3/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 the 150-heading cap, the 'siguiente_encabezado' pagination key, that offsets index the same canonical text as texto_completo, and the empty-result case for prose (TC sentencias). It omits auth/rate-limit or cost context, keeping it below a 5.

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, then Args and Devuelve sections. The return listing is somewhat verbose but earns its place given there is no output schema. Little waste overall.

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, so the description correctly documents the return shape (ok, id, url_web, fuente, totals, encabezados list) and the truncated/empty cases. Combined with the sibling routing hint, an agent has everything needed to call and interpret it.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 0% and the single required param is undocumented in the schema, but the description compensates: 'id' is defined as the SPIJ identifier with an example ('H1453062') and it notes the id comes from buscar_* tools. That is enough to call the tool correctly.

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 and resource: returns the index of headings of a SPIJ norm, including each heading's offset. It is clearly distinguishable from siblings like texto_completo (full text) and buscar_en_norma (search), so an agent can route correctly.

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?

Explains the intended workflow — use the returned offsets to read specific sections via texto_completo(id, offset=X, max_chars=N) — and names fallbacks (buscar_en_norma or range reading) for prose norms with no headings. It does not explicitly contrast with detalle_norma or say when not to use it, so it stops short of a 5.

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