Skip to main content
Glama

Mapeando la estructura de la norma

estructura_norma

Return a SPIJ legal norm's heading index with each offset, so you can read specific sections via texto_completo without scanning the full text.

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.6/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full load, and it does so well: it discloses the return payload (ok, id, url_web, fuente, total_caracteres, encabezados), pagination (hasta 150 with siguiente_encabezado), and the edge case of empty encabezados. It does not explicitly state read-only semantics or auth requirements, which is the only gap.

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 with the core purpose, then clearly sectioned into Args and Devuelve. Slightly verbose, but essentially every sentence (pagination limit, offset canonical alignment, empty-headers fallback) earns its place.

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?

With no output schema and no annotations, the description fully specifies the return fields, the pagination behavior, the offset semantics, and the degenerate case. An agent has everything needed to call it and to act on the result.

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 parameter 'id' has no schema description, but the description compensates by giving the format ('ej H1453062') and provenance ('lo dan buscar_*'), which is meaningfully more than the schema alone provides. Only one param, so little else is needed.

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 ('Devuelve el INDICE de encabezados de una norma del SPIJ') and immediately qualifies scope with the offset mechanism. This clearly distinguishes it from siblings like texto_completo and detalle_norma, which an agent can tell apart without opening schemas.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

It not only says what it returns but routes the agent: use this to get offsets, then call texto_completo(id, offset=X, max_chars=N) to read specific sections. It also names a fallback (buscar_en_norma or reading by ranges) for norms with no headers such as TC sentencias. Explicit when-to-use and alternative paths.

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