Skip to main content
Glama

image_prune

DestructiveIdempotent

Remove unused Docker images to free disk space. Defaults to deleting dangling images, with optional filters to remove other unused images.

Instructions

Remove unused local images to reclaim disk space.

Without filters removes only "dangling" images — untagged layers not referenced by any tag or container. To remove all images not used by any container (including tagged ones) pass filters={"dangling": False}. Valid filter keys: dangling (bool as string "true"/"false"), until (RFC3339 timestamp or duration like "24h"), label (key or key=value). Use system_df first to see how much space is reclaimable.

args: filters - Narrow which images to remove; omit to remove dangling images only returns: dict - {"ImagesDeleted": [...], "SpaceReclaimed": }

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
filtersNo
Behavior4/5

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

Annotations already mark the tool as destructive and non-read-only. The description adds valuable context by explaining what counts as 'unused' (dangling vs. all untagged/unreferenced) and enumerating valid filter keys. It also discloses the return format, covering the lack of an output schema.

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 moderately concise, with an efficient structure: purpose, behavior, filter details, and return format. There is minor redundancy between the second sentence and the args line, but it does not detract significantly.

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?

Covers the essential aspects needed to select and invoke the tool: what it operates on, how filters affect scope, a prerequisite (system_df), and the return value. It does not address edge cases like error handling or specific image removal, but these are less critical for a prune tool.

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 schema only defines a generic 'filters' object with no structure. The description fully compensates by explaining the meaning of the parameter, default behavior, and valid filter keys (dangling, until, label) with value types. This is essential for correct invocation.

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 first sentence clearly states the tool's function: removing unused local images to reclaim disk space. It distinguishes from sibling prune tools (container_prune, volume_prune) and from image_remove by specifying 'unused' and 'dangling' images.

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?

Provides explicit guidance on default behavior (dangling only) vs. removing all unused images via the filters parameter. Also recommends running system_df first. However, it does not explicitly mention alternatives like image_remove for targeted deletion, so it stops at clear context without exclusions.

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