Skip to main content
Glama

service_wait

Read-only

Block until a Docker Swarm service reaches the desired task count or completes a rolling update, with timeout and status reporting.

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?

The description fully discloses behavior: it polls task state (not ServiceStatus), handles both replicated and global modes, and uses timeout vs met flag. Annotations show readOnlyHint=true and destructiveHint=false, and description aligns by stating it only blocks and polls without modifying. 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.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Description is thorough but slightly verbose. Front-loaded with main purpose, then explains modes and parameters in a structured list. Every sentence adds value, but could be slightly tighter. Still well-organized.

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 complex wait semantics, the description is complete. Covers both modes, edge cases (no UpdateStatus), return values, parameter defaults, and polling behavior. No missing aspects for correct invocation.

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%, so description carries full burden. It explains all 5 parameters: id_or_name, until (with enum values), replicas (override usage), timeout_seconds (default 600), poll_interval (capped by time left). Also describes return dict fields. No additional meaning needed beyond description.

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 blocks until a swarm service's tasks converge or a rolling update finishes. It distinguishes from sibling tools like container_wait by specifying swarm service context, and provides specific modes: 'running' and 'update-converged'. The verb 'wait' combined with 'service' resource is explicit.

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 explains two distinct usage scenarios: 'running' mode for task convergence and 'update-converged' mode for rolling updates. It explicitly tells when to use replicas parameter (after service_scale) and when update-converged returns promptly (service never updated). This provides clear guidance on when to use this tool vs 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/GavinLucas/docker-mcp'

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