Skip to main content
Glama

container_wait

Read-only

Block execution until a Docker container reaches a specified condition: stopped (not-running, next-exit, removed) or healthy. Returns condition met status and exit information without raising errors on timeout.

Instructions

Block until a container reaches a condition: stopped ("not-running"/"next-exit"/"removed") or "healthy".

One contract for every mode: never raises on timeout — the result always carries met (condition reached) and timed_out. The stop conditions use the daemon's blocking wait and fill status_code/ error (the container's exit info); "healthy" polls the container's HEALTHCHECK every poll_intervals and fills health/status.

Health semantics: with no HEALTHCHECK defined, once the container is running the tool returns promptly with health: null and met: false (false = "not confirmed healthy", not "unhealthy" — check health to tell them apart). A container that exits before becoming healthy returns its terminal status and met: false.

args: id_or_name - The container id or name until - Condition to wait for: "not-running" (default), "next-exit", "removed", or "healthy" timeout_seconds - Max seconds to wait before returning with timed_out=true (default 600) poll_interval - "healthy" mode only: seconds between re-inspections (default 2, > 0); capped by the time left so a large value can't push the total wait past the timeout returns: dict - {"container", "until", "met", "timed_out", "status_code", "error", "health", "status", "waited_seconds"}; stop modes fill status_code/error, "healthy" fills health ("starting"/"healthy"/"unhealthy", or null with no healthcheck) and status.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
untilNonot-running
id_or_nameYes
poll_intervalNo
timeout_secondsNo
Behavior5/5

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

The description goes far beyond annotations by detailing timeout behavior (never raises on timeout), health polling mechanics, edge cases (no HEALTHCHECK), and return field semantics. No contradiction with annotations (readOnlyHint=true, destructiveHint=false).

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 description is detailed but efficient, using a structured format with sections for args and returns. Each sentence adds value, though it could be slightly more terse without losing clarity.

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 no output schema, the description fully documents return fields, edge cases, and parameter behaviors. It is complete for a wait tool, covering health, timeout, and stop modes comprehensively.

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?

Schema coverage is 0%, but the description covers all four parameters with defaults, enum values, and additional context (e.g., poll_interval capping, timeout_seconds default). This fully compensates for the lack of schema descriptions.

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 it blocks until a container reaches a condition, listing specific conditions (stopped, healthy) with precise definitions. It distinguishes itself from sibling tools like container_start or container_stop by its unique waiting functionality.

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

Usage Guidelines4/5

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

The description explains each mode's behavior and when to use them, e.g., 'stop conditions use daemon's blocking wait' vs. 'healthy polls'. It does not explicitly state when not to use or compare to alternatives, but the context is clear enough.

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