Skip to main content
Glama

Start / Stop / Restart / Pause / Unpause a Docker Container

docker_container_action
Destructive

Change a Docker container's run state—start, stop, pause, unpause, or restart—with explicit confirmation.

Instructions

Changes a container's run state (start | stop | pause | unpause | restart). restart uses the API's native restart mutation (API 4.37+). Requires confirm: true. Pass the container id from docker_container_list; names often work but the API's post-action read-back is unreliable with names. stop/pause/restart disrupt a running container; start/unpause are restorative but still gated for consistency. To delete a container use docker_container_remove; to change what starts at boot use docker_autostart_set.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "id": "<id>",
      "action": "<action>"
    },
    "name": "docker_container_action"
  }
}

Input Schema

NameRequiredDescriptionDefault
idYesContainer id from docker_container_list (preferred over a name).
actionYesRun-state change to apply; `unpause` resumes a paused container.
confirmNoSet `true` only after the user approves this specific change; otherwise the tool refuses or prompts them.
response_formatNo`detailed` returns full JSON instead of readable text.concise

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed4 schema fields changedv0.1.3
    • addedInput schema / properties / action / description
      Added value: +"Run-state change to apply; `unpause` resumes a paused container."
    • addedInput schema / properties / confirm / description
      Added value: +"Set `true` only after the user approves this specific change; otherwise the tool refuses or prompts them."
    • addedInput schema / properties / id / description
      Added value: +"Container id from docker_container_list (preferred over a name)."
    • addedInput schema / properties / response_format / description
      Added value: +"`detailed` returns full JSON instead of readable text."
  2. First observedv0.1.1

TDQS

A4.8/5.0
Behavior5/5

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

Beyond the destructiveHint/readOnlyHint annotations, the description discloses that restart uses the API's native mutation requiring API 4.37+, that confirm gating applies uniformly even to restorative actions, and that post-action read-back is unreliable when names are used instead of ids. That last point is a genuine operational caveat an agent could not infer from annotations or schema.

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 critical constraints (action set, confirm requirement, id sourcing) are front-loaded and the closing sentence routes to alternative tools. Slightly redundant with the title's action list, and the 'gated for consistency' clause is explanatory padding rather than guidance.

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 4-parameter mutation tool with no output schema, the description covers preconditions, safe-parameter sourcing, disruptive-vs-restorative semantics, and sibling routing. The response_format behavior is documented in the schema, so no return-value prose is needed.

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?

Schema coverage is 100%, so the baseline is 3; the description still adds value by explaining why id is preferred over name (unreliable read-back) and by characterizing the restart action's API mechanism. It does not extend the action enum or response_format beyond what the schema already states.

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 a specific verb ('Changes a container's run state') and enumerates the exact action set (start | stop | pause | unpause | restart), which matches the schema enum. This is clearly distinguishable from siblings like docker_container_remove and docker_container_update without opening any schema.

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 names two alternatives with the exact condition that selects them: docker_container_remove for deletion and docker_autostart_set for boot behavior. It also states the precondition (confirm: true) and where the id should come from (docker_container_list).

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