stack_remove
Remove Docker stacks from a swarm by tearing down their services, networks, and secrets. Use when decommissioning or cleaning up deployed stacks.
Instructions
Remove one or more stacks from the swarm (tears down their services, networks, and secrets).
Destructive: this stops and deletes every service in the named stack(s) - the reverse of
stack_deploy and the swarm analogue of compose_down. Defaults to detach=True so the call
returns once removal is requested rather than waiting for teardown.
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: names: One or more stack names to remove. At least one is required. detach: Return immediately (True) vs wait for the stack(s) to be fully removed (False) timeout_seconds: Subprocess timeout (default 300s)
Returns: dict: {"returncode": int, "stdout": str, "stderr": str, "truncated": bool}
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| names | Yes | ||
| detach | No | ||
| timeout_seconds | No |