Skip to main content
Glama

container_remove

Destructive

Remove a Docker container and its writable layer, with options to delete anonymous volumes, remove links, or force-kill running containers. Named volumes and images remain untouched.

Instructions

Remove a container, deleting its writable layer.

The image is untouched (image_remove deletes images); named volumes are never removed — volumes=True only covers anonymous ones. A running container is refused unless force=True, which kills it first. When the server runs containerized it refuses to remove its own container.

args: id_or_name - The container id or name volumes - Also remove anonymous volumes (the CLI's --volumes); named volumes persist link - Remove the specified link force - Kill a running container before removing it (default False: running is an error) returns: bool - True after removal completes

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
linkNo
forceNo
volumesNo
id_or_nameYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior5/5

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

While annotations already declare destructiveHint=true, the description adds substantial behavioral detail beyond that: it deletes the writable layer, leaves the image untouched, never removes named volumes, refuses running containers unless force=true (killing first), and refuses to remove its own container when server is containerized. This is rich, non-redundant disclosure.

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-structured and concise. It opens with a clear one-sentence purpose, then adds nuanced behavioral details in a short paragraph, followed by a compact list of parameters. Every sentence adds unique value; there is no fluff or 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?

The description covers the core behavior (writable layer deletion), side effects on images and volumes, running container handling, self-removal restriction, and return type. Given the tool's complexity and the lack of schema descriptions, this is fully 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 description coverage is 0%, so the description carries the full burden. It explains all four parameters: id_or_name, volumes (anonymous only), link, and force (kills running container first). Each parameter gets a clear, meaningful explanation that goes beyond the schema's simple type and default.

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 clearly states the tool's purpose: 'Remove a container, deleting its writable layer.' It uses a specific verb and resource, and explicitly differentiates from sibling tools by noting 'The image is untouched (`image_remove` deletes images)' and that named volumes are never removed. This distinguishes it from image_remove, volume_remove, and container_prune.

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 provides clear usage context: it explains when force is needed (running container), what the volumes flag covers (anonymous only), and explicitly points to image_remove for image deletion. It doesn't explicitly mention volume_remove or container_prune as alternatives for removing volumes or bulk cleanup, but the constraints are clear enough to infer.

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