Skip to main content
Glama

service_rollback

Roll back a Docker swarm service to its previous specification after a faulty update or scale operation.

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 ValueError 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.

args: id_or_name - The service id or name returns: dict - The daemon response (a dict with a "Warnings" key)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
id_or_nameYes
Behavior5/5

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

Beyond the annotations (readOnlyHint=false, destructiveHint=false), the description discloses the internal mechanism (reading current version and previous spec via low-level APIClient, submitting via update_service), explains why the low-level API is needed, and explicitly mentions the error condition. This gives the agent a clear picture of side effects and failure modes, exceeding what annotations alone provide.

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 and front-loaded: opening with the core purpose, then explaining the mechanism and edge cases, and finally detailing args/returns. Every sentence adds value; there is no filler or redundancy. Despite being a bit longer than average, it remains efficient and readable.

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 the tool has only one parameter and no output schema, the description covers all necessary context: the underlying Docker command, the precondition (PreviousSpec), the low-level fallback implementation, parameter semantics, and return format. It is fully self-contained and leaves no gaps for an agent to invoke the tool incorrectly.

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 the description fully compensates by documenting the only parameter 'id_or_name' as 'The service id or name'. It also documents the return value as a dict with a 'Warnings' key, which is essential for the agent to interpret results. This is exemplary parameter documentation.

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 action ('Roll a swarm service back to its previous spec') and explicitly references the Docker equivalent. It distinguishes from siblings by focusing on PreviousSpec and mentions service_update/service_scale as the operations that set it, making the tool's unique role unambiguous.

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 notes when this tool is applicable (rolling back a service to its previous spec) and even details a key precondition: the service must have a PreviousSpec, otherwise a ValueError is raised. It implies the alternative is service_update/service_scale for forward changes, effectively guiding the agent on when not to use it.

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