buildx_prune
Free disk space by removing cached layers from Docker BuildKit builders. Supports filters and reserved space options.
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.
args:
all - Include internal/frontend images
filter - Filter values (e.g. {"until": "24h", "type": "exec.cachemount"})
keep_storage - DEPRECATED; older buildx flag. Use reserved_space instead.
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 | ||
| filter | No | ||
| builder | No | ||
| keep_storage | No | ||
| max_used_space | No | ||
| min_free_space | No | ||
| reserved_space | No | ||
| timeout_seconds | No |