tree
Visualize a directory as an indented tree, skipping .gitignore'd files and .git by default. Optionally show file encodings for legacy code audits or include hidden files.
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).
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": {
"path": "<path>"
},
"name": "tree"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | ||
| exclude | No | ||
| dirsOnly | No | ||
| maxDepth | No | ||
| maxFiles | No | ||
| showEncoding | No | ||
| respectGitignore | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| tree | Yes | ||
| dirCount | Yes | ||
| fileCount | Yes | ||
| truncated | No |