Skip to main content
Glama

service_wait

Read-only

Block until a Docker swarm service's tasks reach the desired count or its rolling update finishes; returns met and timed_out flags without raising on timeout.

Instructions

Block until a swarm service's tasks converge, or a rolling update finishes.

One contract for both modes: never raises on timeout — the result always carries met and timed_out. "running" polls task state via the same task-counting logic as service-tasks://{id_or_name} (not the unconfirmed daemon ServiceStatus field) until running tasks reach the desired count (Replicated mode) or every returned task is running (Global mode, which has no fixed target). "update-converged" polls UpdateStatus.State until it reaches a terminal value (completed or rollback_completed); if the service has never been updated (no UpdateStatus at all), returns promptly with met=false — there's nothing to converge to, same as container_wait's no-healthcheck case.

args: id_or_name - The service id or name until - Condition to wait for: "running" (default) or "update-converged" replicas - "running" mode only: override the desired replica count (e.g. right after a same-turn service_scale call, before polling reflects the new target) timeout_seconds - Max seconds to wait before returning with timed_out=true (default 600) poll_interval - Seconds between re-checks (default 2, > 0); capped by the time left so a large value can't push the total wait past the timeout returns: dict - {"service", "until", "met", "timed_out", "running_tasks", "desired_tasks", "failed_tasks", "update_state", "waited_seconds"}

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
untilNorunning
replicasNo
id_or_nameYes
poll_intervalNo
timeout_secondsNo
Behavior5/5

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

Beyond the readOnlyHint annotation, the description discloses crucial behaviors: it never raises on timeout, always returns `met` and `timed_out`, specifies that 'running' uses task-counting logic rather than ServiceStatus, and describes the no-UpdateStatus edge case for 'update-converged'. The poll_interval capping behavior is also explained.

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: a one-sentence purpose, a paragraph on the shared contract and modes, then a clean arg list. Every sentence adds meaningful information; the length is justified by the two-mode complexity without being verbose.

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 5 parameters, no output schema, and two distinct modes, the description covers all necessary aspects: timeout behavior, polling logic, edge cases, parameter formats, and return values. It is self-contained enough for an agent to invoke the tool correctly.

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 zero schema coverage, the description provides detailed semantics for every parameter: `id_or_name` as service id/name, `until` enum with defaults, `replicas` as a mode-specific override, `timeout_seconds` with default 600, and `poll_interval` with default 2 and >0 constraint. It also documents the return dict keys.

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 'Block until a swarm service's tasks converge, or a rolling update finishes', which is a specific verb+resource directive. It clearly distinguishes from sibling tools like container_wait and node_wait by focusing on swarm service task convergence and rolling updates, and further specifies two modes.

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 when each mode ('running' vs 'update-converged') is appropriate, and the `replicas` parameter gives the concrete use case of right after a `service_scale` call. It also references `container_wait` as an analogy, but does not explicitly state when not to use this tool or name direct alternatives.

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

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