Skip to main content
Glama

docker_recreate_container

Destructive

Recreate a Docker container by stopping and removing the existing one, then starting a replacement; optionally preserve its configuration and restore the original if creation fails.

Instructions

Stop and remove a container, then run a new container. With preserve_configuration, rebuild from the inspected configuration and restore the original if replacement creation fails.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "docker_recreate_container"
  }
}

Input Schema

NameRequiredDescriptionDefault
nameNoContainer name
imageNo
portsNoContainer-to-host port bindings
detachNoRun container in the background
labelsNoContainer labels
commandNoCommand to run in container
networkNoNetwork to attach the container to
volumesNoVolume mappings
entrypointNoEntrypoint to run in container
auto_removeNoAutomatically remove the container
environmentNoEnvironment variables dictionary
container_idNo
preserve_configurationNoRebuild from the inspected container configuration (environment, mounts/volume identity, networks, ports, labels, healthcheck, restart policy) and restore the original if replacement creation fails. Use only container_id/name and optionally image in this mode.

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.8/5.0
Behavior4/5

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

Annotations already declare destructiveHint=true and idempotentHint=false, and the description adds meaningful behavior: the original container is removed, a new one is run, and with preserve_configuration the original configuration is used and restored if replacement creation fails. It does not discuss volume/data-loss implications, but the rollback behavior is a valuable addition beyond annotations.

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?

Two sentences, front-loaded with the primary action and followed by the important preserve_configuration behavior. There is no unnecessary wording.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a destructive 13-parameter tool with an output schema and strong annotations, the description covers the core operation and rollback behavior. It could be more complete by stating which parameters identify the target container and when recreation is inappropriate, but it is largely sufficient.

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

Parameters3/5

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

Schema description coverage is high at 85%, so the schema already documents most parameters. The description reinforces the preserve_configuration constraint, but that constraint is also present in the schema, so it adds limited new parameter meaning.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states a specific compound action: stop and remove a container, then run a new one. This clearly distinguishes recreation from sibling operations like create, run, start, stop, and remove, though it does not explicitly name alternatives.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Usage is implied for replacing an existing container, and the preserve_configuration mode is scoped to container_id/name plus optional image. However, the description does not explicitly say when to choose this over docker_remove_container plus docker_run_container, nor does it state exclusions or prerequisites.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.