Skip to main content
Glama

stop_agent

Stop an agent to close its tab while keeping the session resumable. Optionally clean up its worktree and branch, refused if uncommitted or unmerged work exists unless forced.

Instructions

Stop an agent.

An agent started by start_agent has its tab closed; it can be resumed later with send_message. cleanup also removes its worktree and branch and forgets it. That is refused when the worktree has uncommitted files or commits not merged into the repository's current HEAD, unless force=True, which discards that work. An adopted session is only forgotten: its tab, directory, branch and transcript are left alone.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "name": "<name>"
    },
    "name": "stop_agent"
  }
}

Input Schema

NameRequiredDescriptionDefault
nameYes
forceNo
cleanupNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.3/5.0
Behavior5/5

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

With no annotations at all, the description carries the full burden and does so: it discloses that cleanup is destructive (worktree and branch deleted, agent forgotten) and that force=True discards unmerged work. It also documents the refusal guardrail and the adopted-session exception, which is exactly the risk information an agent needs before invoking a destructive operation.

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?

Front-loads the core action, then layers effects, refusal conditions, and the adopted-session caveat in short sentences. No filler; each sentence adds a distinct behavioral fact.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a 3-parameter mutation with no annotations and no output schema, the description covers destructive effects, guardrails, and edge cases well. Minor gaps remain around the return value or error behavior when the named agent does not exist.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 0%, so the description must compensate, and it explains both optional flags in detail: what cleanup removes and what force overrides. The required `name` parameter is only implicitly identified as the agent identifier, which is the one semantic left to inference.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

Opening line is a specific verb+resource ("Stop an agent") and the following sentences enumerate concrete effects: tab closed, resumable via send_message, cleanup removing worktree and branch. It effectively distinguishes the cleanup and force variants of this one tool, though it does not contrast with any sibling beyond naming send_message as the resume path.

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?

Clearly states the conditions under which cleanup is refused (uncommitted files or unmerged commits) and the force override, plus the special case for adopted sessions. It lacks an explicit "use this instead of X when Y" routing statement, but the conditional guidance for each flag is strong.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.