Skip to main content
Glama

doc_tree

Generate a nested, per-document heading tree for repositories with many documentation files, with adjustable depth to inspect structure without reading full content.

Instructions

Nested table of contents grouped by document. Returns heading trees per doc file with depth control. Better than doc_table_of_contents for repos with many documentation files.

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": {
      "repo": "<repo>"
    },
    "name": "doc_tree"
  }
}

Input Schema

NameRequiredDescriptionDefault
repoYesRepository name (as shown in list_repos)
max_depthNoMaximum depth to expand

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.10.2

TDQS

A4/5.0
Behavior4/5

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

Rectifies the absence of annotations by revealing the return topology (per-document heading trees) and the depth-bounding behavior, which tells the agent output size scales with max_depth. It does not state explicitly that the operation is read-only or whether truncation occurs at max_depth, but the described behavior is consistent with a safe read tool and contradicts nothing.

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 sentences, each doing distinct work: what it returns, how the result is scoped, and why it beats the alternative. Front-loaded and free of filler or repetition of the schema.

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 two-parameter read-only listing tool with no output schema, the description covers the essential contract: what is returned, its per-document grouping, and the depth limit. Since there is no output schema, a little more on the return shape (e.g., heading labels plus levels) would have been valuable, but nothing needed to invoke it correctly is missing.

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 both parameters are already documented in the schema; the description adds only the phrase 'with depth control' as semantic framing for max_depth. It does not explain what happens to deeper headings when max_depth is exceeded or clarify the repo identifier beyond the schema's own pointer to list_repos. Baseline 3 is appropriate.

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 opens with a concrete noun-level statement of what is returned ('Nested table of contents grouped by document') and specifies the shape ('heading trees per doc file'), then names the sibling it competes with, doc_table_of_contents. It is a listing/read tool and readable as such, though it never uses an explicit verb like 'lists' or 'returns' in the opening clause.

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 gives a clear comparative rule: prefer this over doc_table_of_contents when a repo has many documentation files. That is a genuine selection heuristic rather than implied usage. It stops short of stating when not to use it (e.g., single-doc lookups or deeper reading, which siblings like read_doc_section cover).

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