Skip to main content
Glama

wait_for_service

Block until a deployed service converges or fails, then return its outcome and failure diagnosis so you can confirm the real deploy result without polling.

Instructions

Use when: a deploy is in flight and you need its real outcome.

    Blocks until the service converges (healthy) or fails, then returns
    ``{outcome: converged|failed|timeout|superseded, ...}`` — always, never
    raising on a timeout. After ``stop_service``, ``converged`` means the
    service is actually stopped.

    On ``outcome: failed`` the response also carries ``diagnosis`` — the
    FULL ``diagnose_service`` bundle (``remediation.code`` + ``detail``,
    crash forensics, health probe, binding readiness and a bounded log
    tail), folded in so a failure needs no second call. Branch on
    ``diagnosis.remediation.code``. It is ``null`` on every non-failed
    outcome, and ``null`` on a failure your token is not owner-or-admin for
    (the bundle carries app log lines) — in that case call
    ``diagnose_service`` yourself with a token that owns the app.
    

Input Schema

NameRequiredDescriptionDefault
nameYesService name or job id of an existing service (app, model or database); both resolve to the same row.
timeoutNoSeconds to block before returning ``outcome: timeout``. Default 60; floored at 1 here and capped at 300 by the daemon.
versionNoDeploy generation to converge on — the ``last_deploy.version`` from a ``deploy``/``deploy_git``/``deploy_app``/``deploy_template`` 201. Omit and the generation recorded on the row when the call starts is used, so a redeploy that landed between your 201 and this call is reported as ``converged`` as if it were yours.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.6/5.0
Behavior5/5

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

With no annotations, the description fully carries the behavioral burden. It discloses blocking behavior, timeout handling without raising, the possible outcome values, the presence and shape of diagnosis on failure, and the important authorization case where diagnosis is null.

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 front-loaded with the use case and outcome shape, and each paragraph serves a clear purpose. It is somewhat dense with parenthetical detail, but the complexity of the tool justifies most of the length.

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 that there is no output schema and no annotations, the description supplies the essential return contract and failure semantics. It covers the key runtime behavior an agent needs to invoke and branch on the result correctly.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The schema description coverage is 100%, so the parameters are already fully documented in the schema, including timeout defaults/caps and version semantics. The description does not add meaningful parameter guidance beyond that, so the baseline of 3 is appropriate.

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 verb and resource: it blocks until a service converges or fails, then returns a structured outcome. It clearly distinguishes the tool from related siblings like diagnose_service by explaining that failure diagnosis is folded into this call and only falls back to diagnose_service when authorization prevents it.

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?

It gives an explicit triggering condition: use when a deploy is in flight and you need its real outcome. It also clarifies semantics after stop_service and tells the agent exactly when to call diagnose_service instead, including the authorization condition that requires it.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.