Skip to main content
Glama

tree

Read-only

Visualize a directory structure as a compact indented tree, respecting .gitignore and optionally showing file encodings for legacy codebases.

Instructions

Compact indented tree view of directory structure. PREFER THIS for directory visualization. Skips .gitignore'd files and .git (respectGitignore=false to include). 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
respectGitignoreNo

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. The description adds behavioral details (skips .gitignore/.git, includes when respectGitignore=false, showEncoding feature) without contradicting annotations.

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 with no redundancy: purpose, preference, behavior, and parameter list. Front-loaded with essential info and each sentence earns its place.

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?

Covers all 7 parameters with defaults and semantics, gives usage context, and an output schema exists. Adequate for a tree tool with no missing operational details.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 0%, so the description must compensate. It lists path (required), maxDepth (0=unlimited), maxFiles (default 1000), dirsOnly, exclude (array of patterns), and showEncoding. respectGitignore is also explained in the behavior sentence. All parameters have semantic context.

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 'Compact indented tree view of directory structure' with a specific verb+resource. The directive 'PREFER THIS for directory visualization' clearly distinguishes it from siblings like list_directory and search_files.

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' and gives a concrete use case via showEncoding. Does not name alternative tools but the preference is strong and context is clear.

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