Skip to main content
Glama

container_prune

DestructiveIdempotent

Remove stopped Docker containers to reclaim disk space without affecting running ones. Optionally filter by age or label to narrow which stopped containers get pruned.

Instructions

Remove all stopped containers to reclaim disk space.

Only removes containers that are not running - running containers are never affected. Use container_list(all=True) to preview what would be removed before calling this. Valid filter keys: until (RFC3339 timestamp or duration like "24h" - removes containers stopped before that point), label (key or key=value). For a broader cleanup of containers plus unused images, networks, and volumes see the prune_managed prompt.

Args: filters: Narrow which stopped containers to remove; omit to remove all stopped

Returns: dict: {"ContainersDeleted": [...], "SpaceReclaimed": }

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
filtersNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv2.0.0

TDQS

A4.6/5.0
Behavior4/5

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

Annotations already flag the operation as destructive and idempotent, and readOnly is false. The description adds the critical safety boundary that running containers are never affected, the supported filter keys and their formats, and the return shape. It does not discuss failure modes or permissions, but with the annotations the description adds meaningful behavioral context beyond the metadata.

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?

Each sentence earns its place: the primary purpose, the safety guarantee, the preview and alternative routes, the filter semantics, and the return payload. The one-sentence purpose is front-loaded and the rest of the description is compactly organized.

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?

For a single-parameter tool with no output schema, the description is complete: it documents the return shape, filter keys and formats, how to preview, the safety guarantee, and the alternative route. The agent can correctly invoke the tool without additional information.

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 description coverage is 0%, so the description carries the full parameter-meaning burden. It succeeds: `filters` is explained as narrowing which stopped containers are removed, the default behavior (omit to remove all) is stated, and the valid keys (`until`, `label`) are described with format and examples. This is far beyond the bare empty object in the input 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?

States a specific verb and resource: 'Remove all stopped containers to reclaim disk space.' The 'all stopped' scope clearly distinguishes it from singular container removal and from the broader `prune_managed` cleanup route, so an agent can identify the tool's purpose without opening the schema.

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 strong usage guidance: use `container_list(all=True)` to preview before calling, and choose `prune_managed` for broader cleanup of containers, images, networks, and volumes. It stops short of explicitly saying when a per-container alternative like `container_remove` would be appropriate, but the all-stopped-container scope and preview instruction cover the primary decision.

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

Deploy Server

Other Tools