Skip to main content
Glama

close_agent

Stop tracking an agent, optionally archive its jcode session and remove its git worktree; set force=true to remove a worktree with uncommitted changes.

Instructions

Stop tracking an agent. Optionally archive the jcode session (hides it in Desktop) and remove its git worktree. Removing a worktree with uncommitted changes needs force=true.

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": {
      "id": "<id>"
    },
    "name": "close_agent"
  }
}

Input Schema

NameRequiredDescriptionDefault
idYesjcode session id returned by spawn_agent
forceNo
archiveNo
remove_worktreeNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.5/5.0
Behavior3/5

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

With no annotations, the description carries the full behavioral burden. It usefully discloses that archive hides the session in Desktop, remove_worktree removes its git worktree, and force=true is needed for uncommitted changes, but it omits reversibility, whether a running agent is terminated, permission requirements, and what "stop tracking" preserves.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Three concise sentences front-load the core action before describing optional side effects. The wording is dense but every sentence contributes useful information.

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

Completeness3/5

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

The tool has no annotations, no output schema, and low schema description coverage, so the description must supply more context. It covers the optional flags' side effects but leaves important gaps around cancellation versus closing semantics, reversibility, and return behavior.

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 only 25%, with just id documented in the schema. The description compensates well for archive, remove_worktree, and force by explaining their effects and the uncommitted-changes condition for force=true.

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?

States a specific verb and resource: "Stop tracking an agent." It also names concrete side effects, but it does not explicitly distinguish itself from sibling tools such as cancel_agent.

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

Usage Guidelines3/5

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

Explains the optional archive and worktree-removal behavior and notes the force condition for uncommitted changes. However, it gives no explicit guidance on when to use close_agent versus cancel_agent or other termination-related siblings.

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