Skip to main content
Glama

stack_remove

Destructive

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

TableJSON Schema
NameRequiredDescriptionDefault
namesYes
detachNo
timeout_secondsNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv2.0.0

TDQS

A5/5.0
Behavior5/5

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

Annotations already mark destructiveHint=truechers. The description goes well beyond that by specifying exactly what is torn down, that it does not raise on non-zero CLI exits, that missing binaries/timeouts still raise, and that detach defaults to True. This gives an agent accurate expectations for side effects and error behavior.

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?

Information is front-loaded: the main purpose appears first, destructive consequences second, and behavioral caveats follow immediately. The Args and Returns sections are compact, and every sentence provides operational value without repetition.

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 the tool's destructiveness, no output schema, and 0% schema parameter coverage, the description is highly complete. It covers what happens, when the call returns, non-raising behavior, expected return shape, and defaults for every parameter. An agent has enough information to decide, invoke, and interpret the result correctly.

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 has 0% description coverage, so the description fully compensates with an Args section explaining all three parameters: names (required, one or more), detach (immediate return vs wait), and timeout_seconds (subprocess default 300s). It adds behavioral meaning the raw schema types and defaults lack.

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?

Clearly states the action ('Remove one or more stacks') and the resource ('from the swarm'), then defines the scope of destructive teardown ('services, networks, and secrets'). It differentiates from siblings by naming stack_deploy as its reverse and compose_down as its swarm analogue.

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?

Explicitly identifies this as the inverse of stack_deploy and the swarm counterpart to compose_down, giving an agent direct routing across sibling tools. It also describes its destructive nature and default detach behavior, so an agent knows when this tool is appropriate versus the alternative deployment tool.

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