analyze_disk_usage
Identify disk space bottlenecks by scanning directories, excluding symlinks and virtual filesystems, to reveal largest files and folders.
Instructions
Analyze disk usage for a directory to discover space bottlenecks and large files.
Safely walks the filesystem without following symlinks and automatically skips virtual pseudo-filesystems (/proc, /sys, /dev, /run).
Args: target_path: Starting path to inspect (defaults to '/var'). max_depth: Depth of directory nesting to inspect (1 to 5, default 2). min_size_mb: Minimum size threshold in megabytes to include (default 50 MB). top_n: Maximum number of largest items to return (1 to 50, default 15).
Returns: JSON string with partition usage, largest directories, and largest files.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| top_n | No | ||
| max_depth | No | ||
| min_size_mb | No | ||
| target_path | No | /var |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |