Skip to main content
Glama

docker_container_control

DestructiveIdempotent

Start, stop, or restart a single Docker Compose service and see the previous and current state, including whether the action changed anything. Timed-out stops show as killed with their exit code.

Instructions

Moves one service between states — start, stop, restart — and reports where it stood before and where it stands now, with changed saying whether the call did anything at all. A stop that ran out of time comes back killed with its exit code, never as a clean stop. The whole stack at once is docker_compose_control.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
actionYesstart: bring the container up. stop: shut it down, giving it timeout seconds. restart: stop then start, keeping the same container.
profileNoWhich Docker host, by profile name. Default: the profile marked as default.
projectNoWhich compose project. Default: the project of the working directory. A name matching nothing is an error, not a fall back to every container on the host.
serviceYesService name as written in the compose file.
timeoutNoSeconds the container gets to shut down before Docker kills it, for stop and restart. Default: 10.
compose_pathNoWhere the compose file is: the file itself, or the directory holding it. Needed only when no container of the host carries the project label — a project that was never brought up there. A directory holding several compose files is refused with their names rather than guessed through.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
actionNo
healthNo
killedNo
legendNoWhat the words in this answer mean. A key names the field before the value — "state=running", "containers[].health=unhealthy" — and only the values this answer used are listed.
reasonNo
changedNo
projectNo
serviceNo
timeoutNo
exit_codeNo
state_afterNo
state_beforeNo
restart_countNo

Schema Changelog

Changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. First observedv2.0.1

TDQS

A4.5/5.0
Behavior4/5

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

Annotations already flag idempotent and destructive. The description adds meaningful behavior beyond that: it returns the previous and current states, uses 'changed' to signal whether the call did anything, and explains that a timed-out stop surfaces as killed with its exit code, not a clean stop.

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?

Three dense sentences with no filler; the core operation and scope appear first, and the key edge-case behavior follows. Every sentence adds information.

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?

Given a 100%-covered schema, an output schema, and annotations for idempotency/destructiveness, the description covers the important runtime semantics (state reporting, changed flag, timeout kill behavior) and the sibling alternative. Nothing essential is missing.

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 100%, so the baseline applies. The description does not expand on individual parameters; the schema already documents action values, timeout default, profile/project defaults, and compose_path behavior.

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 names the exact operation ('Moves one service between states'), lists the three actions, and clarifies scope ('one service') while pointing to docker_compose_control for the whole stack. This distinguishes it from siblings immediately.

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 explicitly states the single-service scope and names the alternative for whole-stack operations: 'The whole stack at once is docker_compose_control.' This is direct routing guidance with the closest sibling, so an agent can decide correctly.

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

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/hypnosis/docker-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server