Skip to main content
Glama

image_prune_builds

DestructiveIdempotent

Delete the Docker daemon's build cache to reclaim disk space. Remove unused or all cache records to free storage and speed up future builds, with optional filters and keep-storage limits.

Instructions

Delete the daemon's build cache to reclaim disk space.

Prunes the build cache — a separate Engine resource from the images image_prune removes, so run both to reclaim everything a build leaves behind. Prefer buildx_prune when the build ran on a non-default buildx builder (that builder keeps its own cache, invisible here) or when you need buildx's disk-ceiling flags; this tool needs no CLI plugin and works over any transport, including a daemon with no local docker binary. Inventory first with system_df (its BuildCache entry) or buildx_du. Destructive and immediate: later builds must re-run the steps whose cache was removed. Needs Docker API v1.31+; passing any of filters, keep_storage, or all needs v1.39+ and raises InvalidVersion on an older daemon — omit all three to prune with the daemon's own defaults.

args: filters - Narrow which cache records to remove, e.g. {"until": "24h"} (a duration or timestamp relative to the daemon's clock); also accepts id, parent, type, description, inuse, shared, private; omit to let the daemon prune unused cache keep_storage - Bytes of cache to keep, e.g. 5368709120 for 5 GiB; omit for no floor. The Engine renamed this reserved-space at API v1.48 and still honors the old name; the newer max-used-space/min-free-space ceilings are reachable only via buildx_prune all - Remove all types of build cache, not just the unused records returns: dict - {"CachesDeleted": [...], "SpaceReclaimed": }

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
allNo
filtersNo
keep_storageNo
Behavior5/5

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

Adds substantial context beyond annotations: the destructive and immediate nature explicitly stated, API version requirements for each parameter, the `InvalidVersion` error case, and the transport flexibility. No contradictions with the annotations.

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 dense but well-structured, front-loading the action, then grouping context, alternatives, side effects, API notes, and parameter detail. While longer than the minimal necessary, every section earns its place; a slight trim in the `filters` enumeration would tighten it further.

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 no output schema, the description covers all the essential context: what the tool does, what resource it affects, when to prefer alternatives, what to run before, what side effects to expect, API version constraints, parameter details, and the return value shape. Complete for an agent to select and invoke correctly.

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?

Schema coverage is 0%, but the description fully compensates: explains `filters` with an example and comprehensive key list, `keep_storage` with byte example and the API v1.48 rename, and `all` with its behavior relative to unused records. This exceeds the bare schema.

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 a specific verb + resource ('Delete the daemon's build cache to reclaim disk space') and immediately distinguishes it from `image_prune` and `buildx_prune`, making the tool's scope unambiguous.

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

Usage Guidelines5/5

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

Provides explicit when-to-use and when-not-to-use guidance, naming `buildx_prune` as the preferred alternative for non-default builders, recommending running both this and `image_prune`, and suggesting `system_df` or `buildx_du` for inventorying before pruning.

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