Skip to main content
Glama

container_stop

Gracefully stops a running Docker container by sending its configured stop signal, then force-kills after a configurable timeout.

Instructions

Gracefully stop a running container (its configured stop signal, then SIGKILL after a timeout).

Prefer this over container_kill for a clean shutdown: the main process receives the container's stop signal (STOPSIGNAL, default SIGTERM) and has stop_timeout_seconds to exit before the daemon force-kills it. Use container_restart to stop and start again in one call, or container_pause to freeze processes without stopping. When the server runs containerized it refuses to stop its own container.

args: id_or_name - The container id or name stop_timeout_seconds - Seconds between the stop signal and SIGKILL (default 10) returns: dict - The container's attrs after the stop (exit code under State.ExitCode)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
id_or_nameYes
stop_timeout_secondsNo
Behavior5/5

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

The description explains the stop process: the configured stop signal, then SIGKILL after a timeout. It also discloses the constraint about the server container, going beyond annotations (which only have readOnlyHint and destructiveHint). No contradiction.

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 concise and well-structured: first sentence gives the core purpose, second provides usage guidance, third warns about the server container, then a list of arguments and return value. No wasted words.

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?

The description is complete for a tool with 2 parameters, clear behavior, and a return value described. It covers everything needed for correct invocation without relying on missing information.

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?

With 0% schema description coverage, the description fully compensates by explaining both parameters: id_or_name (the container id or name) and stop_timeout_seconds (seconds between stop signal and SIGKILL, default 10). This adds necessary meaning.

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 clearly states the tool's purpose: 'Gracefully stop a running container' with specific details about the stop signal and timeout. It distinguishes from siblings like container_kill, container_restart, and container_pause by explaining when to prefer each.

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?

The description provides explicit guidance: 'Prefer this over container_kill for a clean shutdown', recommends container_restart to stop and start again, and container_pause to freeze. It also warns that the server refuses to stop its own container when containerized, covering when not to use.

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

Install Server

Other Tools

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/GavinLucas/docker-mcp'

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