Skip to main content
Glama

tree_scope

Scan a directory and return a compact JSON listing of files and folders with sizes, depths, and order indices for validating mindmap injection.

Instructions

Scan a directory and return compact telemetry (no file content).

Returns a JSON array where each entry is: {title, type, size, oi, parent, depth}

  • type: "dir", "file", or "root"

  • size: human-readable for files (e.g. "2.3KB"), item count for dirs

  • oi: 1-based order_index (matches what tree_to_mindmap would produce)

  • parent: order_index of the parent node

  • depth: nesting level (0 = root's direct children)

Use this BEFORE inject_directory_to_mindmap to get a reference count of expected nodes (1 root + N dirs + M files). After injection, compare the summary's total_nodes with this count to validate — no need to call get_mindmap afterwards.

Does NOT read file content — just names, sizes, and structure. Hidden files and VCS dirs are skipped automatically.

Args: root_path: absolute path to the directory to scan root_title: title for the root entry (empty = use directory name) max_depth: maximum nesting depth to scan (default 10)

Returns: JSON string — array of compact scope entries.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
max_depthNo
root_pathYes
root_titleNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior4/5

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

With no annotations provided, the description bears the full burden of disclosing behavior. It discloses that the tool does not read file content, skips hidden files and VCS dirs, and returns a JSON array with specific fields. There is no mention of side effects or destructive actions, which is appropriate for a read-only scan. The output structure is thoroughly explained.

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 description is well-structured: a summary sentence, then output format details, usage guidance, and parameter descriptions. It is front-loaded with the main purpose. While somewhat lengthy, each sentence adds value and is clearly organized. Minor redundancy could be trimmed, but overall it's efficient.

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 that an output schema exists, the description still provides detailed explanation of the return value, including field names, types, and semantics. It covers scanning behavior (skipping hidden files, depth limit) and usage context. No critical information is missing for an agent to select and invoke this tool correctly.

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?

Since schema description coverage is 0%, the description must compensate. It explains root_path as an absolute path, root_title as the title for the root entry (with default behavior: empty uses directory name), and max_depth as maximum nesting depth with default 10. This adds meaning beyond the schema types and defaults.

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?

The description clearly states that the tool scans a directory and returns compact telemetry without reading file content. It distinguishes itself from sibling tools like inject_directory_to_mindmap by specifying its use case as a precursor for node count validation.

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?

The description explicitly recommends using this tool before inject_directory_to_mindmap to obtain a reference count of expected nodes and after injection to validate totals. It also notes that hidden files and VCS directories are skipped. However, it does not provide explicit 'when not to use' guidance, but the context is clear enough.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Sebastien-VZN/axomind-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server