Skip to main content
Glama

Read one section of a document

docguard_read_section
Read-onlyIdempotent

Read a specific section or lines from a Markdown doc by section ID, heading anchor, heading text, or line number. Returns bounded text with offset for truncation.

Instructions

Return one section's text, resolved by docguard:section id, then heading anchor, then exact heading text — or, with line, just the lines around one reference from docguard_docs_for_path (the cheapest read for a table row). Bounded: 8192 bytes by default, 32768 at most; a truncated result carries nextOffset. An ambiguous match fails with the candidates.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idNodocguard:section id
docYesProject-relative Markdown path
lineNoRead the lines around this line number instead of a whole section
anchorNoHeading anchor, e.g. spec-lifecycle-registry
offsetNoByte offset from a previous truncated read
contextNoWith line: lines before and after (default 3)
headingNoExact heading text
maxBytesNo
projectDirNoProject to inspect: a directory inside the directories this server serves (absolute, or relative to the served directory). Defaults to the served directory.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.43.0

TDQS

A4.3/5.0
Behavior4/5

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

Annotations already declare the safe read-only, idempotent profile, so that half is covered. The description adds genuinely useful behavior beyond the annotations: byte bounds (8192 default / 32768 max), truncation signaling via nextOffset, and the explicit failure mode for ambiguous matches returning candidates.

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?

Three densely-worded sentences, front-loaded with the primary behavior and the resolution order. Every clause carries information (precedence, mode switch, bounds, failure), though the packing is tight enough that a first-time reader may need a second pass.

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?

For a 9-param read tool with no output schema, the description covers return shape (section text), bounding/pagination (nextOffset), and error behavior (candidates). The main gap is that it doesn't explain how `offset` and `context` interact in practice, but the essentials for correct invocation are present.

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 already 89%, so the baseline is 3, but the description adds real meaning by defining the precedence order among id, anchor, and heading, and by clarifying that `line` switches to a windowed read around a reference. That resolution logic is not derivable from the schema alone.

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 ('Return one section's text') and enumerates the exact resolution precedence (id → anchor → heading). It names the sibling docguard_docs_for_path, so an agent can distinguish it from the other read-oriented tools.

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 context for when to use the `line` mode ('the cheapest read for a table row') and names the sibling whose output feeds it. It resolves ambiguity between id/anchor/heading, though it stops short of explicit when-not-to-use guidance versus the full-document alternatives.

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