get_directory_listing
Retrieve a formatted directory listing with file metadata such as name, type, size, and modification time, with optional regex filtering and sorting by time or name.
Instructions
List contents of a directory with file metadata.
Args: directory_path: Path to directory to list regex_filter: Optional regex to filter filenames (applied to basename only) sort_by: Sort by "time" (modification time) or "name" (alphabetical). Default: "time" reverse: Reverse sort order. Default: True (most recent first / Z-A) max_results: Maximum entries to return (default 50, hard limit 100)
Returns: Formatted listing with: name, type (file/dir), size, modified time. Default behavior: 50 most recently modified files/folders. Format: "main.swift [file] 2.5 KB 2025-10-01 14:30"
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| directory_path | Yes | ||
| regex_filter | No | ||
| sort_by | No | time | |
| reverse | No | ||
| max_results | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |