Skip to main content
Glama

volume_prune

DestructiveIdempotent

Remove Docker volumes not referenced by any container. Use filters to narrow selection; by default only anonymous volumes are pruned, preserving volumes used by stopped containers.

Instructions

Remove volumes not referenced by any container, running or stopped.

A volume used by even one stopped container is not "unused" and survives the prune — remove the container first (or use container_prune, then this) to reclaim its volumes. Valid filter keys: label (key or key=value), all ("true" as a string — without it only anonymous volumes are eligible, matching docker volume prune's default). Use volume_list first to see what currently exists.

args: filters - Narrow which unused volumes to remove; omit to remove all anonymous ones returns: dict - {"VolumesDeleted": [...], "SpaceReclaimed": }

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
filtersNo
Behavior5/5

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

Goes well beyond the annotations by detailing the stopped-container edge case, the default anonymous-volume behavior, and valid filter keys (`label`, `all`). Even though annotations already mark destructive/idempotent, the description adds critical nuance about what gets removed and the effect of filters.

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?

Front-loaded with a single-sentence purpose, followed by a focused, high-value paragraph on edge cases and filters. The args/returns section is clear. Every sentence earns its place with no redundancy.

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?

Despite lacking an output schema, the description specifies the return format (`{"VolumesDeleted": [...], "SpaceReclaimed": <bytes>}`). It covers prerequisites, filter semantics, default behavior, and the exact scope of removal, making it complete for safe and correct use.

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?

With 0% schema description coverage, the description fully compensates. It explains the `filters` parameter's purpose, valid keys, and the default when omitted ('all anonymous ones'). 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?

Open with the specific verb and resource: 'Remove volumes not referenced by any container, running or stopped.' This clearly distinguishes it from sibling tools like `volume_remove` (targeted removal) and `container_prune` (container cleanup).

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?

Explicitly explains the condition for pruning: volumes used by stopped containers survive, and advises removing containers first or using `container_prune` first. It also recommends using `volume_list` first, giving the agent a clear workflow and an alternative tool.

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