Skip to main content
Glama

container_stop

Gracefully stop a running container: signal the main process (SIGTERM by default), then force-kill after a timeout if needed, ensuring a clean shutdown.

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: stop_timeout_seconds: Seconds between the stop signal and SIGKILL

Returns: dict: The container's full inspect payload after the stop (exit code under State.ExitCode)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
id_or_nameYes
stop_timeout_secondsNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv2.0.0

TDQS

A4.9/5.0
Behavior5/5

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

Annotations only state readOnlyHint=false and destructiveHint=false, so the description carries the behavioral burden. It discloses the stop-signal-then-SIGKILL sequence, STOPSIGNAL default, timeout semantics, and the self-container restriction. No contradiction with 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?

The description is well-structured and front-loaded with the core behavior, followed by sibling guidance, caveats, parameter documentation, and return payload. Every sentence adds useful information with no redundancy.

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, the description appropriately documents the return value as the full inspect payload with exit code location under State.ExitCode. It also covers the shutdown timeout, force-kill behavior, and relevant operational caveat, giving an agent enough context to call the tool correctly.

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 description coverage is 0%, so the description must compensate. It fully explains stop_timeout_seconds as the delay between stop signal and SIGKILL. The other parameter, id_or_name, is not described in prose, but its name is self-explanatory and the schema marks it required.

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 states a specific action ('Gracefully stop a running container') and the mechanism (configured stop signal, then SIGKILL after a timeout). It also distinguishes itself from sibling tools like container_kill, container_restart, and container_pause, making selection unambiguous.

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 explicitly says to prefer this over container_kill for a clean shutdown, and tells the agent when to use container_restart and container_pause instead. It also adds an important constraint: the server refuses to stop its own container when running containerized.

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