Skip to main content
Glama

service_rollback

Roll back a Docker service to its previous spec to undo a bad update. Re-applies the last known-good configuration automatically.

Instructions

Roll a swarm service back to its previous spec (the docker service rollback equivalent).

Re-applies the service's PreviousSpec - the spec from before the most recent service_update / service_scale. Raises ToolInputError if the service has no PreviousSpec (it has never been updated, or was already rolled back). The high-level SDK exposes no rollback, so this reads the current version and previous spec via the low-level APIClient and submits them with the low-level update_service API call.

Returns: dict: The daemon response (a dict with a "Warnings" key)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
id_or_nameYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv2.0.0

TDQS

A4.1/5.0
Behavior5/5

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

Annotations only provide readOnlyHint=false and destructiveHint=false, meaning the description carries the burden of explaining behavior. It does so well: it discloses that the tool mutates the service by re-applying PreviousSpec, raises ToolInputError when no PreviousSpec exists, uses the low-level API, and returns a dict with a 'Warnings' key.

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 core purpose and keeps related details in a logical order: behavior, error condition, implementation, return value. The low-level API implementation note is slightly verbose but still informative and does not obscure the essential guidance.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a one-parameter rollback tool with no output schema, the description covers operation, error behavior, and return shape. The only notable gap is the undocumented id_or_name parameter, but the overall context is sufficient for an agent to select and invoke the tool correctly.

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

Parameters2/5

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

Schema coverage is 0% and the only parameter, id_or_name, has no schema description. The description never explicitly states that id_or_name identifies the target swarm service by ID or name, leaving the agent to infer this from the parameter name and tool name. The description should compensate for the empty schema but does not.

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 ('Roll') and resource ('a swarm service back to its previous spec'), and explicitly identifies it as the docker `service rollback` equivalent. It also references service_update/service_scale as the source of PreviousSpec, which distinguishes it from those sibling tools.

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 makes clear this is used after a prior service_update/service_scale and re-applies the PreviousSpec, giving strong contextual guidance. It does not explicitly say 'use this instead of service_update when you want to undo a change,' but the intended usage is clear from the rollback semantics and error condition.

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