Skip to main content
Glama

stack_remove

Destructive

Remove one or more Docker stacks from the swarm, tearing down services, networks, and secrets. Returns immediately by default instead of waiting for teardown.

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 — 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
Behavior5/5

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

Even though annotations already mark destructiveHint=true, the description adds significant behavioral detail: it explains the scope of destruction (services, networks, secrets), the default `detach=True` behavior (returns immediately vs waiting), and the non-raising error behavior with instruction to inspect `returncode`/`stderr`. This goes well beyond the annotations.

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: it leads with the primary action, then provides critical caveats (destructive, detach default, non-raising behavior), and ends with concise parameter definitions and return type. Every sentence earns its place without unnecessary verbosity.

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?

For a destructive tool with three parameters and no output schema, the description is remarkably complete. It covers purpose, effects, defaults, error handling, all parameters, and the exact return dictionary. No important behavioral aspect is left undocumented.

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%, so the description must compensate. It does so thoroughly: `names` has a clear explanation plus requirement note, `detach` describes the semantics of both True and False, and `timeout_seconds` explains its purpose and default. The return format is also specified, which the schema lacks.

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 it removes stacks via a specific verb ('Remove') and resource ('stacks'), and details what is torn down ('services, networks, and secrets'). It distinguishes from nearby siblings by explicitly calling it 'the reverse of stack_deploy' and 'the swarm analogue of compose_down'.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides clear context by naming `stack_deploy` and `compose_down` as related alternatives, which tells the agent when to use this tool. It does not explicitly state when not to use it or list exclusion scenarios, but the alternative references give strong guidance.

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