Skip to main content
Glama

context_remove

Destructive

Remove a Docker CLI context by name, deleting only connection metadata while leaving the daemon untouched. Use force to remove the current context.

Instructions

Remove a Docker CLI context.

Deletes only the CLI's connection metadata - the daemon it pointed at is untouched. The current context needs force=True (or context_use another first). Does not raise on a non-zero CLI exit (a missing docker binary or a timeout still raises) - inspect returncode/stderr in the result.

Args: name: Context name to remove force: Force removal even if the context is the current one

Returns: dict: {"returncode": int, "stdout": str, "stderr": str, "truncated": bool}

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYes
forceNo

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?

Annotations only say readOnlyHint=false and destructiveHint=true, but the description adds the key behaviors: the daemon is untouched, current-context removal is guarded, non-zero CLI exits do not raise, and missing docker/timeout still raise. This is rich beyond the annotations and accurately matches them.

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 front-loaded with the one-line purpose, followed by the most important side-effect/edge-case disclosures, then a tidy Args/Returns block. Every sentence carries information an agent needs.

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?

With no output schema, it supplies the exact return dict shape; with a destructive annotation, it clarifies the real-world scope and error behavior; with a bare schema, it explains both parameters. Nothing needed to call the tool correctly is missing.

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 coverage is 0% and no descriptions exist in the schema, but the description fully compensates by explaining name as the context to remove and force as the override for the current-context restriction. Even the default behavior of force is inferable from the context.

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 the exact operation ('Remove a Docker CLI context') and immediately clarifies the scope: it deletes only CLI connection metadata, not the daemon. This makes it clearly distinguishable from sibling context_* tools like context_use, context_create, and context_list.

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?

Gives concrete usage context for the tricky case: a current context requires force=True or switching with context_use first. It does not explicitly enumerate when to prefer this over each sibling, but the purpose and the one relevant alternative are clear.

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