Skip to main content
Glama

container_remove

Destructive

Delete a container and its writable layer. Force stops running containers first; optionally 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: 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

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv2.0.0

TDQS

A4.8/5.0
Behavior5/5

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

Beyond the destructiveHint annotation, the description reveals the writable layer is deleted, images and named volumes are preserved, anonymous volumes are only removed with volumes=True, running containers require force, and self-removal is blocked. It also states the boolean return value, giving a clear behavioral contract.

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 well-structured with a summary paragraph, an Args list, and a Returns section. It is slightly redundant, repeating that named volumes persist in both the opening paragraph and the volumes argument, which costs it a point.

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 destructive container operation, the description covers the main action, side effects, edge cases, parameter behavior, and return value. Nothing essential is missing for an agent to decide when and how to invoke the tool safely.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The schema has 0% description coverage, so the description compensates well by explaining volumes (anonymous only, named persist), force (kills running container, default false), and link. The only gap is id_or_name, which is not explained beyond its self-descriptive name, so not quite a perfect score.

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 starts with a specific verb and resource: "Remove a container, deleting its writable layer." It also disambiguates from image_remove by stating the image is untouched, and clarifies that named volumes are never removed, so an agent knows exactly which object the tool acts on.

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?

It gives explicit conditions: running containers are refused unless force=True, force kills first, and containerized servers refuse to remove their own container. It also names image_remove as the alternative for deleting images, providing direct when-to-use guidance.

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