Skip to main content
Glama

swarm_leave

Destructive

Leave the current Docker swarm and reschedule service tasks to remaining nodes. Use force to allow a manager to leave without breaking raft quorum.

Instructions

Leave the current swarm.

The daemon's service tasks are rescheduled to the remaining nodes. A manager refuses to leave without force=True, since leaving can break raft quorum. The departed node lingers as "down" in node_list until a manager runs node_remove.

args: force - Force leave even if the node is a manager returns: bool - True after leaving the swarm

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
forceNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior5/5

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

Beyond the destructiveHint annotation, the description discloses that service tasks are rescheduled, managers refuse without force, and the node remains listed as 'down' until node_remove is run. These details give an agent an accurate picture of the operation's consequences and lifecycle.

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 front-loaded with the core purpose in the first sentence, followed by concise behavioral details and an args/returns summary. Every sentence contributes essential information with no redundancy.

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?

With one parameter and an output schema, the description covers the operation's effect, parameter semantics, return type, and a follow-up action (node_remove). It is complete for an agent to invoke and reason about the tool.

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?

The schema has zero description coverage, but the description fully explains the 'force' parameter as 'Force leave even if the node is a manager' and clarifies that manager nodes refuse without it. This meaningfully compensates for the schema's lack of parameter documentation.

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 states 'Leave the current swarm' with a specific verb and resource, clearly distinguishing it from siblings like swarm_join and swarm_init. It further clarifies scope by explaining service task rescheduling and the lingering down state, which differentiates it from node_remove.

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 explains when force=True is required (for managers to avoid breaking raft quorum) and mentions the follow-up node_remove, providing strong usage context. It does not explicitly name alternative tools, but the guidance is clear enough for an agent to decide when to use this tool.

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