Skip to main content
Glama

container_remove

Destructive

Remove a Docker container and delete its writable layer. Optionally force kill running containers and remove anonymous volumes.

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?

Beyond annotations (destructiveHint=true), the description details what is destroyed (writable layer, not image, not named volumes unless volumes=True) and notes server containerization refusal. Adds significant context.

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?

Well-structured: brief summary followed by parameter details. Could be slightly more concise but still effective and front-loaded with the core action.

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?

Covers return value (bool indicating removal completion). With output schema present, description adequately explains tool behavior and constraints for a removal operation.

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 explains each parameter: id_or_name, volumes (anonymous vs named), link, force (default False). Provides defaults and clarifies edge cases.

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 'Remove a container, deleting its writable layer,' specifying the action and resource. It distinguishes from sibling tool `image_remove` and clarifies behavior regarding volumes.

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 guidelines: removing containers vs images. Explains conditions for force removal and behavior with volumes (only anonymous). Clearly states when a running container is refused.

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/GavinLucas/docker-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server