Skip to main content
Glama

get_section_excerpt

Read-only

Preview a documentation section by returning a short, newline-trimmed excerpt so you can check content before reading the full section and save tokens.

Instructions

v1.41+ — return a short content preview (default 500 bytes) for one section. Trimmed to last newline before the cap so it ends on a paragraph boundary. Use to peek at content before paying for a full get_section read. _meta.tokens_saved reports the byte-savings vs full content.

Input Schema

NameRequiredDescriptionDefault
repoYesRepository identifier (owner/repo or just repo name)
max_bytesNoSoft cap on excerpt size in UTF-8 bytes. Default 500.
section_idYesTarget section ID. v1.147+ — also accepts a `doc.md#anchor` reference to a heading written with an explicit `{#id}`; an ambiguous reference sets `anchor_ambiguous`, `anchor_scope`, `anchor_match_count`, `anchor_candidates` (at most 20), `anchor_candidates_truncated` and `warning`.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv1.147.0
    • changedInput schema / properties / section_id / description
      Previous value: -"Target section ID"New value: +"Target section ID. v1.147+ — also accepts a `doc.md#anchor` reference to a heading written with an explicit `{#id}`; an ambiguous reference sets `anchor_ambiguous`, `anchor_scope`, `anchor_match_count`, `anchor_candidates` (at most 20), `anchor_candidates_truncated` and `warning`."
  2. Addedv1.118.0
  3. Removedv1.99.0
  4. First observedv1.66.3

TDQS

A4.2/5.0
Behavior4/5

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

With readOnlyHint=true already declaring a safe read, the description adds genuine behavior: the excerpt is trimmed to the last newline before the byte cap so it ends on a paragraph boundary, and _meta.tokens_saved reports byte-savings. It doesn't say what happens when a section is smaller than the cap, but the added context is substantial.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Three tight sentences with no filler; the version gate and the core purpose are front-loaded, and the trimming rule and savings metric follow immediately.

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 carries the return-value burden — it names the excerpt content and the _meta.tokens_saved field, which is enough for an agent to use the result. Minor gaps (e.g. behavior for very short sections) remain.

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 coverage is 100%, so repo, max_bytes, and section_id are already documented, including the anchor reference format. The description only restates the 500-byte default and adds the newline-trimming semantics, which is marginal beyond the schema — baseline 3.

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 a short content preview for one section — with the default size (500 bytes) and trimming rule. It is clearly distinguishable from get_section (full read) and the plural get_section_excerpts sibling.

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?

Explicitly tells the agent to use it to peek at content before paying for a full get_section read, naming the alternative and the cost tradeoff. It lacks guidance on when to prefer get_section_excerpts (bulk) instead, so it stops short of full routing coverage.

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