Skip to main content
Glama

stack_deploy

Deploy or update a Docker stack to a swarm from Compose files, with options to prune removed services, pass registry credentials, and wait for convergence or return immediately.

Instructions

Deploy (or update) a stack to the swarm from one or more Compose files.

Requires the target daemon to be a swarm manager. Re-running with the same name updates the stack in place. Defaults to detach=True (returns once specs are submitted, not on convergence); set detach=False to wait for the rollout (give it a generous timeout_seconds). The swarm analogue of compose_up; watch the rollout with stack_services / stack_ps. Does not raise on a non-zero CLI exit — inspect returncode/stderr in the result.

args: name - Name of the stack to create or update compose_files - One or more Compose file paths (repeated -c; later override earlier). At least one required. with_registry_auth - Send registry credentials to swarm agents (needed for private images) prune - Remove services no longer defined in the Compose file resolve_image - Image-digest resolution; omit for the CLI default ("always") detach - Return immediately after submitting specs (True) vs wait for convergence (False) cwd - Working directory for resolving relative Compose paths (defaults to the server's cwd; copied to the target host if no local docker CLI) timeout_seconds - Subprocess timeout (default 1800s) returns: dict - {"returncode": int, "stdout": str, "stderr": str, "truncated": bool}

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
cwdNo
nameYes
pruneNo
detachNo
compose_filesYes
resolve_imageNo
timeout_secondsNo
with_registry_authNo
Behavior4/5

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

Annotations indicate `readOnlyHint` and `destructiveHint` are false, meaning action is expected. The description adds key behaviors: defaults to `detach=True`, re-running with same `name` updates in place, does not raise on non-zero exit, and the actual return value structure. It does not mention side effects like whether it modifies existing services, but the update behavior is covered. This goes beyond annotations, earning a high score.

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 with a clear overview paragraph and a bulleted args list. Every sentence adds valuable information—prerequisites, behavior, usage warnings, and param semantics. It is concise for the complexity involved (8 params) without being verbose.

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 8 parameters, no output schema, and no annotations beyond read/destructive hints, the description covers all necessary aspects: purpose, usage, parameter details, return format, and error handling. It also mentions swarm manager requirement and detach behavior, which are critical. The tool is complex, and the description is complete enough for an agent to use it correctly.

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 description coverage is 0%, so the description must compensate for all 8 parameters. It does: explains `name` (create or update), `compose_files` (repeated `-c`, later override earlier, at least one required), `detach` (immediate vs wait), `cwd` (for resolving relative paths), and others. It also clarifies defaults and nuances that are not in schema, like the `timeout` recommendation. Slightly less detail on `prune` and `with_registry_auth` but still adds value.

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 tool's purpose: 'Deploy (or update) a stack to the swarm from one or more Compose files.' It uses specific verbs (deploy/update) and identifies the resource (stack, swarm, Compose files). It distinguishes from sibling `compose_up` by explicitly calling it 'The swarm analogue of `compose_up`' and mentions alternative monitoring tools like `stack_services` and `stack_ps`.

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 usage guidance: requires the daemon to be a swarm manager, explains the detach behavior with a clear recommendation ('set `detach=False` to wait for the rollout (give it a generous `timeout_seconds`)'), and contrasts with `compose_up` and monitoring tools. It also warns that the tool does not raise on non-zero exit, telling users to inspect `returncode`/`stderr`.

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