Skip to main content
Glama

service_scale

Scale a Docker Swarm service by setting its desired replica count, increasing or decreasing tasks as needed. Returns acceptance of the update.

Instructions

Set the desired replica count for a Replicated-mode swarm service.

Only applies to services in Replicated mode; a Global service runs one task per eligible node and has no replica count to set. The swarm scheduler places or removes tasks asynchronously to converge on the new count - this call returns once the update is accepted, not once every task is running. Check progress with service_ps or service_inspect. For any other spec change (image, env, resources) use service_update instead.

Args: replicas: The desired number of running task replicas

Returns: bool: True once the scale request is accepted

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
replicasYes
id_or_nameYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv2.0.0

TDQS

A4.6/5.0
Behavior4/5

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

Annotations indicate readOnlyHint=false and destructiveHint=false, so the description correctly implies a mutating operation without being destructive. It adds crucial behavioral context: the call is asynchronous (returns before tasks are running) and only sets replica count. This goes beyond annotations by explaining the non-blocking nature, though it doesn't mention authentication requirements or error conditions.

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: a one-line summary, then a detailed paragraph on scope and behavior, followed by a concise Args and Returns section. Every sentence adds value, with the most critical constraint (mode) front-loaded.

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 simple tool with only 2 parameters and an output schema (bool), the description is largely complete. It explains the return value and when to use alternatives. The main missing piece is the 'id_or_name' parameter semantics, but given the simplicity might be considered obvious. A strong description overall.

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

Parameters4/5

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

Schema coverage is 0%, and the description compensates by explaining the 'replicas' parameter as the desired number of running task replicas. However, the equally important 'id_or_name' parameter is not described, which is a gap given the low schema coverage. The description adds value for 'replicas' but misses 'id_or_name'.

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 verb 'Set' with the resource 'desired replica count for a Replicated-mode swarm service', which is specific and distinct from siblings like service_update. It immediately conveys the primary function without ambiguity.

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 provides explicit when-to-use guidance: it only applies to Replicated services, not Global; it distinguishes from service_update for other spec changes; and it directs to service_ps/service_inspect for progress checking. This is exemplary for routing the agent to the correct tool and follow-up actions.

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