Skip to main content
Glama

service_wait

Read-only

Wait for a Docker Swarm service to reach target replicas or complete a rolling update. Returns status even on timeout, indicating whether the condition was met.

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: 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 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

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv2.0.1

TDQS

A4.8/5.0
Behavior5/5

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

Beyond the readOnlyHint/destructiveHint annotations, the description discloses key behavior: it never raises on timeout and always returns met/timed_out, it polls task state using specific task-counting logic rather than the daemon's ServiceStatus field, and it defines per-mode terminal conditions. It even handles the never-updated service case, which is exactly the kind of behavioral nuance an agent needs.

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 long but information-dense, with the core contract front-loaded and every subsequent sentence earning its place. The Args and Returns sections are structured for easy scanning and add essential detail that is absent from the schema.

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?

For a polling tool with no output schema and multiple modes, the description is complete: it documents input parameters, return fields, timeout behavior, mode-specific logic, and edge cases. An agent has enough information to invoke the tool correctly and interpret its result in both waiting modes.

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 description coverage is 0%, but the Args section fully compensates: it explains until's two enum values, the replicas override use-case, timeout semantics, and poll_interval's default and time-left cap. Only id_or_name is not explicitly described, but its meaning is clear from the name and required position.

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 a specific verb and resource: 'Block until a swarm service's tasks converge, or a rolling update finishes.' It clearly distinguishes the two wait modes ('running' vs 'update-converged') and references the analogous container_wait behavior, making the tool's role unmistakable among a large sibling list.

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 gives strong mode-level guidance: when to use 'running' vs 'update-converged', when the replicas override is needed (right after service_scale), and how poll_interval behaves. It also explains the no-UpdateStatus edge case. It does not explicitly name a sibling tool to prefer instead, but the mode selection guidance is clear and actionable.

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