Skip to main content
Glama

image_remove

Destructive

Delete a local Docker image by name or ID. Use force to remove images referenced by stopped containers or multiple tags, and noprune to keep untagged parent layers.

Instructions

Remove a local image by name or id.

Fails without force if the image is tagged by multiple names (untag first with image_tag) or if stopped containers reference it. Running containers always block removal regardless of force. noprune keeps untagged parent layers that would otherwise be removed as a side-effect; leave False unless you need to preserve the parent layers for another purpose.

Args: id_or_name: Image name (with optional tag/digest) or id to remove force: Remove even if referenced by stopped containers or multiple tags noprune: Do not delete untagged intermediate parent layers

Returns: bool: True after removal completes

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
forceNo
nopruneNo
id_or_nameYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv2.0.0

TDQS

A4.7/5.0
Behavior5/5

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

Annotations only state destructiveHint=true and readOnlyHint=false. The description goes far beyond that: explains failure modes (multiple tags, stopped containers), the force override, that running containers always block, and the noprune side-effect of preserving parent layers. No contradictions with annotations.

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 an Args/Returns breakdown and action-oriented opener. It is detail-rich but every sentence adds necessary behavioral info; no filler. Slightly long but appropriately so for a destructive operation with nuanced edge cases.

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 all essential context for correct invocation: conditions for failure, force semantics, noprune effects, and return type (bool True). The output schema is simple, and the description aligns with it. An agent has everything needed to know when and how to call, and what side-effects to expect.

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 has 0% coverage, so the description carries full burden. It explains id_or_name (name with optional tag/digest or id), force (override specific references), and noprune (preserve parent layers). Each parameter is given meaning beyond the schema's bare type/default, completely compensating for missing schema descriptions.

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 opens with 'Remove a local image by name or id.' — a specific verb, resource, and input method. It clearly distinguishes removal from sibling operations like image_prune (bulk untagged removal) and image_tag (tagging) by mentioning that untagging is a prerequisite in some cases.

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 explicit guidance on when the tool fails without force and instructs to use image_tag first when multiple tags exist. It also notes that running containers always block removal. While it doesn't explicitly contrast with image_prune for bulk cleanup, the conditions given are actionable and enough to decide when to invoke this tool.

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