Skip to main content
Glama

agent_close

DestructiveIdempotent

Terminates an agent's tmux window and marks it closed by name or ID, releasing worker leases. Use row-only mode to retire stale rows without stopping panes.

Instructions

Kill an agent's tmux window and mark it closed, addressed by name (or agent_id). A process-stopping close releases the worker's leases; row_only=true leaves its leases in place because it does not stop the pane. Capture handoffs (todo comments, pads) BEFORE closing; terminal output is not retained. Closing yourself requires confirm_self=true. Refuses a lead target whose pane is live; retires one whose pane is confirmed dead. A worker may never close a lead, live or dead. row_only=true retires a stale row with no kill, stop or typing: for a human or peer lead only, and refused for any row that provably owns a live pane or when tmux could not be probed.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

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

Input Schema

NameRequiredDescriptionDefault
nameNoThe worker's name, e.g. "impl" or "DEVX-123". Prefer passing this rather than agent_id, but pass only one: if both arrive, agent_id wins and this is ignored. A partial name works when it matches exactly one running worker, so "123" finds DEVX-123.
agent_idNoNumeric agent id. Use name instead unless you have the id to hand.
row_onlyNoMark the row closed with no kill, stop or typing, for a row whose pane is gone, reissued or unverifiable. Human or peer lead only. Defaults to false.
project_idNoDifferent project override. Use ONLY when the user explicitly asks for another project by name; otherwise stay in the current scope, even when results are empty.
confirm_selfNo

Output Schema

NameRequiredDescriptionDefault
nameYes
noteNo
closedYes
parkedNo
agent_idYes
row_onlyNo
hive_noticeNo
park_releasedNo
released_leasesNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv1.14.0
    • addedOutput schema / properties / released_leases
      Added value: +{
      +  "items": {
      +    "type": "string"
      +  },
      +  "type": "array"
      +}
  2. Changed2 schema fields changedv1.6.0
    • addedInput schema / properties / row_only
      Added value: +{
      +  "description": "Mark the row closed with no kill, stop or typing, for a row whose pane is gone, reissued or unverifiable. Human or peer lead only. Defaults to false.",
      +  "type": "boolean"
      +}
    • addedOutput schema / properties / row_only
      Added value: +{
      +  "type": "boolean"
      +}
  3. Changed1 schema field changedv1.2.2
    • addedOutput schema / properties / hive_notice
      Added value: +{
      +  "type": "string"
      +}
  4. First observedv1.0.0

TDQS

A4.9/5.0
Behavior5/5

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

Goes well beyond the destructiveHint/idempotent annotations: leases are released on a process-stopping close but retained with row_only, terminal output is not retained, self-close needs confirm_self, and lead targets are refused when live but retired when confirmed dead. These are the exact consequences an agent needs before an irreversible action.

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?

Front-loaded with the action, then progressively narrower conditions; every sentence carries distinct information with no filler. The final row_only sentence is dense and compound, packing four constraints into one line, which costs a little readability.

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, precondition-heavy mutation tool this covers purpose, side effects, prerequisites, refusal cases, and the row_only escape hatch; an output schema exists so return values need not be described. Nothing an agent needs to call it safely 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?

Schema coverage is 80% so a 3 is the floor, but the description adds real meaning: confirm_self has no schema description yet is explained as mandatory for self-close, and row_only's eligibility rules and refusal conditions are spelled out in behavioral terms rather than as a boolean flag.

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?

Opens with a concrete verb+resource pair: kill an agent's tmux window and mark it closed, addressed by name or agent_id. It also carves out the row_only variant explicitly, so an agent can distinguish a process-stopping close from a bookkeeping-only close without inspecting the schema.

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

Usage Guidelines5/5

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

States when to use row_only (stale row, no kill/stop/typing, human or peer lead only) versus a real close, requires confirm_self for self-termination, and gives explicit refusal conditions (live lead pane, worker closing any lead). It even sequences prerequisites: capture handoffs before closing.

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