buildx_prune
Remove BuildKit cache entries to free disk space. Use filters or space limits to target specific cache, and check buildx_du first to see what will be deleted.
Instructions
Remove BuildKit cache entries.
Destructive: this tool always passes --force because no interactive prompt is
available under MCP. Pair with buildx_du first to inventory what would be removed.
Does not raise on a non-zero CLI exit (a missing buildx plugin or a timeout still raises) - inspect
returncode/stderr in the result.
Args: all: Include internal/frontend images filters: Filter by attributes (e.g. {"until": "24h", "type": "exec.cachemount"}) reserved_space: Amount of disk to always keep (e.g. "10GB") max_used_space: Maximum disk space the cache may use (e.g. "20GB") min_free_space: Target amount of free disk after pruning (e.g. "5GB") builder: Override the active builder timeout_seconds: Subprocess timeout (default 600s)
Returns: dict: {"returncode": int, "stdout": str, "stderr": str, "truncated": bool}
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| all | No | ||
| builder | No | ||
| filters | No | ||
| max_used_space | No | ||
| min_free_space | No | ||
| reserved_space | No | ||
| timeout_seconds | No |