tree
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
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | ||
| exclude | No | ||
| dirsOnly | No | ||
| maxDepth | No | ||
| maxFiles | No | ||
| showEncoding | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| tree | Yes | ||
| dirCount | Yes | ||
| fileCount | Yes | ||
| truncated | No |