Skip to main content
Glama

stack_deploy

Deploy or update a Docker Swarm stack from Compose files. Supports pruning removed services, registry authentication, and optional wait for convergence.

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 (a missing docker binary or a timeout still raises) - 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

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv2.2.5
    • addedInput schema / properties / resolve_image / enum
      Added value: +[
      +  "always",
      +  "changed",
      +  "never"
      +]
  2. Changed3 schema fields changedv2.0.0
    • addedInput schema / properties / name
      Added value: +{
      +  "type": "string"
      +}
    • removedInput schema / properties / stack_name
      Removed value: -{
      -  "type": "string"
      -}
    • changedInput schema / required
      Previous value: -[
      -  "stack_name",
      -  "compose_files"
      -]New value: +[
      +  "name",
      +  "compose_files"
      +]
  3. First observedv1.9.0

TDQS

A5/5.0
Behavior5/5

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

Beyond annotations (readOnlyHint=false, destructiveHint=false), the description discloses important runtime behavior: detach defaults to True, update-in-place semantics, non-zero CLI exits do not raise, missing docker binary or timeout still raise, and the result format. This adds meaningful behavioral context that annotations alone do not convey.

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 detailed but well structured: a clear one-sentence purpose, then prerequisites, behavioral nuances, parameter explanations, and return format. Every sentence adds necessary information; nothing is redundant or filler.

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?

Despite having no output schema, the description explicitly documents the return dict shape. It covers prerequisites, idempotent update behavior, detach timeout guidance, error handling edges, all parameters, and relevant sibling tools for follow-up. Nothing an agent needs to invoke this correctly is missing.

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 description coverage is 0%, but the description compensates fully by explaining every parameter in Args: name, compose_files (including later-overrides-earlier), with_registry_auth, prune, resolve_image, detach, cwd, and timeout_seconds. It adds value beyond the raw schema by clarifying defaults, semantics, and interactions.

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 uses a specific verb and resource: 'Deploy (or update) a stack to the swarm from one or more Compose files.' It also clearly positions this tool as the swarm analogue of compose_up, distinguishing it from the compose family and other stack tools 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?

It explicitly states prerequisites ('Requires the target daemon to be a swarm manager'), idempotent re-run behavior, detach vs. wait semantics, and points to sibling tools for observing rollout progress (stack_services / stack_ps). It also explains exception behavior, giving clear guidance on when this tool is appropriate and how to use it correctly.

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