Skip to main content
Glama

buildx_prune

DestructiveIdempotent

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

TableJSON Schema
NameRequiredDescriptionDefault
allNo
filterNo
builderNo
keep_storageNo
max_used_spaceNo
min_free_spaceNo
reserved_spaceNo
timeout_secondsNo
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations indicate destructiveHint=true and idempotentHint=true. The description adds beyond this by stating 'Destructive: this tool always passes --force because no interactive prompt is available under MCP,' which explains the behavior. It also mentions the default timeout and return format, providing useful behavioral context.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is front-loaded with the purpose, followed by a warning and then a structured parameter list. It is concise and every sentence adds value. The parameter list could be slightly more compact, but overall it is well-organized.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool has 8 parameters, including a nested object, the description covers the core functionality, deprecation warnings, and return format. It could provide more detail on the filter keys or edge cases, but it is sufficiently complete for an agent to use safely.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The schema description coverage is 0%, so the description fully compensates by listing each parameter with a brief explanation (e.g., 'all - Include internal/frontend images,' 'filter - Filter values'). This adds semantic meaning that the schema alone lacks.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose: 'Remove BuildKit cache entries.' This separates it from sibling prune tools like prune_containers and prune_images, and the pairing recommendation with buildx_du further clarifies its specific function.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description advises pairing with buildx_du to inventory before pruning, and explains that --force is always used due to lack of interactive prompts. This provides good usage context, though it does not explicitly list conditions when not to use or alternative tools beyond buildx_du.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/GavinLucas/docker-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server