Skip to main content
Glama

tree

Read-only

Display a compact indented tree view of a directory structure. Optionally detect and show file encodings for auditing purposes.

Instructions

Compact indented tree view of directory structure. Uses 85% fewer tokens than directory_tree — PREFER THIS for directory visualization. Set showEncoding=true to detect and display file encodings (e.g., for auditing legacy codebases). Parameters: path (required), maxDepth (0=unlimited), maxFiles (default 1000), dirsOnly (bool), exclude (array of patterns), showEncoding (bool, shows detected encoding per file).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYes
excludeNo
dirsOnlyNo
maxDepthNo
maxFilesNo
showEncodingNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
treeYes
dirCountYes
fileCountYes
truncatedNo
Behavior4/5

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

Annotations already declare readOnlyHint=true, so no destructive risk. Description adds valuable context: token efficiency compared to directory_tree, ability to detect encodings, and default limit of 1000 files. This goes beyond what annotations provide, though rate limits or auth are not mentioned (not needed given readOnly).

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?

Two compact sentences plus parameter list. Front-loaded with purpose and preference. The parameter list is clear but slightly verbose; could be more integrated. Overall efficient with no wasted words.

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?

Given that an output schema exists (so return values are covered), this description provides sufficient behavioral and usage context. It covers the main purpose, key parameters, and a special feature (showEncoding). No major gaps for a read-only listing tool.

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 has 0% description coverage, so burden falls on description. The description lists all 6 parameters with types and defaults (e.g., maxDepth 0=unlimited, maxFiles default 1000, showEncoding for encoding detection). This adds meaning beyond the bare schema, but lacks examples or constraints for patterns like exclude.

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?

Clear verb+resource: 'Compact indented tree view of directory structure'. Distinguishes from sibling 'directory_tree' by explicitly stating it uses 85% fewer tokens, making the purpose specific and differentiated.

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 says 'PREFER THIS for directory visualization', indicating primary use case. Also suggests a specific scenario (auditing legacy codebases with showEncoding=true). However, it does not explicitly state when not to use it or mention alternative tools beyond directory_tree, so not a full 5.

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/dimitar-grigorov/mcp-file-tools'

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