Skip to main content
Glama

get_section_descendants

Read-only

Return all descendant sections under a given section (BFS by parent_id) in document order, with an optional depth limit for precise navigation.

Instructions

v1.43+ — return every descendant of a section (BFS over parent_id) in document order with depth offset. Pairs with get_section_path (ancestors). Optional max_depth caps the walk; max_depth=1 returns immediate children only. Handles only — no content.

Input Schema

NameRequiredDescriptionDefault
repoYesRepository identifier
max_depthNoOptional cap on traversal depth. None = full subtree. 1 = immediate children only.
section_idYesTarget section. Its descendants are returned; target itself is not included. v1.147+ — also accepts a `doc.md#anchor` reference to a heading written with an explicit `{#id}`; an ambiguous one 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. Its descendants are returned; target itself is not included."New value: +"Target section. Its descendants are returned; target itself is not included. v1.147+ — also accepts a `doc.md#anchor` reference to a heading written with an explicit `{#id}`; an ambiguous one sets `anchor_ambiguous`, `anchor_scope`, `anchor_match_count`, `anchor_candidates` (at most 20), `anchor_candidates_truncated` and `warning`."
  2. Addedv1.118.0
  3. Removedv1.100.0
  4. First observedv1.66.3

TDQS

A4/5.0
Behavior4/5

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

Annotations only declare readOnlyHint=true, so the description carries real informational weight: traversal is BFS over parent_id, results are in document order, and each result carries a depth offset — non-obvious behaviors. The 'no content' exclusion also sets expectations. It omits any note about result-size limits for very large subtrees.

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 tightly packed sentences with the core action front-loaded; each clause adds signal. The leading 'v1.43+ —' version tag is minor noise that delays the verb slightly.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

With no output schema, the description must carry the return-value burden; it does describe ordering and depth offset but not the shape of the returned entries or any cap on result volume for deep subtrees. Adequate for a read-only traversal tool, but key return details are left unspecified.

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 100%, so repo, section_id and max_depth are already documented; the description's restatement of max_depth=1 adds no meaning beyond the schema. It also does not mention the v1.147+ doc.md#anchor ambiguity fields detailed in the schema. Baseline 3 applies when the schema does the heavy lifting.

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+resource (return every descendant of a section) plus the mechanism (BFS over parent_id), ordering (document order) and output attribute (depth offset). It explicitly distinguishes itself from the sibling get_section_path, which returns ancestors, so an agent can route without opening either schema.

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?

It names the complementary tool (get_section_path for ancestors) and explains the max_depth switch (1 = immediate children only), giving clear selection context. It stops short of explicit when-not-to-use guidance, though 'Handles only — no content' implicitly steers content retrieval to get_section/get_section_excerpts.

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