Skip to main content
Glama

sp_document_contents

Read-only

Automatically detected sections/subsections/appendices with exact source text offsets. Repeated contents/body headings resolve to the later body occurrence. Not a certified official TOC.

Instructions

Automatically detected sections/subsections/appendices with exact source text offsets. Repeated contents/body headings resolve to the later body occurrence. Not a certified official TOC. expanded includes numbered clauses, deep subclauses and lettered subpoints with source offsets. query searches every detected item's full source text; use pagination for long documents.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "snapshot_id": "<snapshot_id>"
    },
    "name": "sp_document_contents"
  }
}

Input Schema

NameRequiredDescriptionDefault
limitNo
queryNo
offsetNo
expandedNo
snapshot_idYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.2.5

TDQS

A3.8/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=true and destructiveHint=false, so safety is covered; the description adds genuinely non-obvious behavior beyond that — the rule that repeated contents/body headings resolve to the later body occurrence, the disclaimer that results are not a certified TOC, and the effect of expanded on clause depth. It does not describe offset/limit defaults or ordering of results, which leaves some behavior unstated.

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?

The text is dense and free of filler, with the core identity stated first and parameter behavior following in short clauses. The opening is a sentence fragment without a verb, which slightly softens the front-loading, but nothing is redundant.

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?

Given a five-parameter read-only retrieval tool with no output schema and zero schema description coverage, the definition supplies enough to call it correctly: what it returns, what offsets mean, what expanded changes, how query behaves, and that pagination is needed for long documents. The only real omission is the meaning and provenance of snapshot_id, which the description compensates for by making the document-scoped nature of the tool explicit.

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

Parameters3/5

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

Schema description coverage is 0%, so the description carries the full burden, and it delivers real meaning for two of five parameters: query (searches every detected item's full source text) and expanded (includes numbered clauses, deep subclauses and lettered subpoints), plus an implicit nod to limit/offset via pagination. The required snapshot_id — the parameter an agent most needs to understand — is never explained, nor are the limit/offset defaults, so compensation is only partial.

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?

The description names the resource concretely (sections/subsections/appendices with exact source text offsets) and adds a scope caveat ('Not a certified official TOC'), so an agent knows it is getting an auto-detected contents map rather than an authoritative outline. It stops short of distinguishing itself by name from sp_document_outline, leaving the boundary between the two contents-style tools to inference.

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

Usage Guidelines3/5

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

Two usage hints are present: 'use pagination for long documents' and the note that query scans every detected item's full source text. There is no explicit routing guidance against sp_document_outline, sp_read_clause or sp_search_document, so when to pick this over those siblings is implied rather than stated.

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