Skip to main content
Glama

buildx_prune

DestructiveIdempotent

Prune BuildKit cache to reclaim disk space. Use filters and space limits to target specific entries and keep Docker builder storage under control.

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 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

TableJSON Schema
NameRequiredDescriptionDefault
allNo
builderNo
filtersNo
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 already indicate destructiveHint=true, readOnlyHint=false, and idempotentHint=true. The description adds valuable context beyond annotations by disclosing that the tool 'always passes --force because no interactive prompt is available under MCP,' which explains the unconditional destructive behavior and helps the agent set expectations.

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

Conciseness5/5

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

The description is well-organized into a clear purpose statement, a brief safety warning, an args list, and a returns line. Every section earns its place, providing necessary information without redundant fluff. The structure makes it easy for an agent to scan and extract key facts.

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

Completeness5/5

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

Given the tool's complexity (7 parameters, no output schema), the description covers everything needed: the operation, destructive behavior, parameter semantics, complementary tool usage, and return format. The returns line specifies the exact dict structure, fully compensating for the missing output schema.

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

Parameters5/5

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

The input schema has no descriptions for any parameter (0% coverage), but the description compensates fully by explaining all 7 parameters with concrete examples, such as filters '{"until": "24h", "type": "exec.cachemount"}' and disk space formats like '10GB'. This adds substantial meaning beyond the schema's bare type/default information.

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 opens with 'Remove BuildKit cache entries,' a specific verb+resource combination that precisely describes the tool's function. This clearly distinguishes it from sibling tools like buildx_remove (which removes builders) and container_prune/image_prune by naming 'BuildKit cache' as the target.

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 explicitly advises to 'Pair with buildx_du first to inventory what would be removed,' providing an actionable usage guideline and naming a companion tool. However, it does not explicitly state when not to use this tool or describe alternative scenarios beyond the pairing advice.

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/L337-org/docker-mcp'

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