listdir
Lists directory contents with options for flat or tree-structured output, skipping hidden and common build directories to help AI agents explore file systems efficiently.
Instructions
Lists directory contents. Default: flat listing (one path per line, token-efficient for AI agents). Use flat=false for visual tree structure with connectors (├── └──). Skips hidden directories and common build/vendor directories. Use max_depth to control traversal depth (default: 3). Use relative_paths=true to show root as '.' instead of full path (saves tokens).
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | Absolute path to the directory to list | |
| max_depth | No | Maximum depth for tree traversal. Default: 3 | |
| relative_paths | No | Show the root as '.' instead of the full absolute path. Saves tokens in output. Default: false | |
| flat | No | Flat listing without tree connectors (one path per line). Default: true |