list_directory
List directory contents in simple, detailed, tree, or JSON formats. Sort by name or size, and exclude files using glob patterns.
Instructions
List directory contents with flexible output formats. Replaces the previous list_directory, list_directory_with_sizes, and directory_tree tools. Supports simple listings, detailed views with sizes/timestamps, hierarchical tree display, and structured JSON output. Automatically filters globally configured ignored folders. Only works within allowed directories.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | Absolute path to the directory to list | |
| format | No | Output format: 'simple' (basic listing), 'detailed' (with sizes and metadata), 'tree' (hierarchical text tree), 'json' (structured data) | simple |
| sortBy | No | Sort by name (alphabetical) or size (largest first) | name |
| excludePatterns | No | Glob patterns to exclude (e.g., ['*.log', 'temp*']). Applied in addition to globally configured ignored folders. |