Skip to main content
Glama

swarm_leave

Destructive

Remove a node from the active Docker swarm, moving its service tasks to remaining nodes. To let a manager leave without breaking quorum, set the force option.

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 key behavioral traits: service tasks are rescheduled, leaving can break raft quorum, managers are refused without force, and the departed node remains 'down' until a manager removes it. This is rich, non-obvious context that helps the agent anticipate consequences.

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 compact and efficiently structured: a one-sentence purpose, a two-sentence behavioral explanation, and a clear args/returns block. Every sentence adds value without redundancy or padding.

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 simple one-parameter destructive tool with annotations, the description covers all essential aspects: what it does, when force is needed, what side effects occur, what the parameter means, and what the return value is. No critical information 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?

The schema only defines a boolean 'force' with a default. The description explains the parameter's meaning ('Force leave even if node is a manager') and also specifies the return type and value ('True after leaving'). This fully compensates for the lack of schema description coverage.

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 the exact action 'Leave the current swarm' with a specific verb and resource, clearly distinguishing it from sibling swarm tools like swarm_init, swarm_join, and swarm_update. It also adds behavioral context that reinforces its unique role.

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 usage context: managers must set force=True to leave, and the node will linger as 'down' until node_remove is run. While no explicit alternatives are mentioned, the unique nature of the action makes this unnecessary. The force guidance is a practical rule for when and how to use the 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