Skip to main content
Glama

agy_close_agent

Idempotent

Terminate a running Antigravity subagent and its process tree, then optionally remove its isolated Git worktree and temporary branch to free resources after work is merged or discarded.

Instructions

Cancel/close an Antigravity subagent (mirrors native Codex close_agent). Terminates any running process tree and optionally removes its isolated Git worktree.

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": {
      "agent_id": "<agent_id>"
    },
    "name": "agy_close_agent"
  }
}

Input Schema

NameRequiredDescriptionDefault
agent_idYesAgent ID to close.
delete_branchNoAlso delete temporary agy-sub/<id> branch (set true only after merging or discarding).
cleanup_worktreeNoRemove temporary worktree directory if isolation='worktree' was used.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.8/5.0
Behavior4/5

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

Annotations declare readOnlyHint=false and idempotentHint=true; the description adds real value beyond them by disclosing that the whole process tree is killed and that a Git worktree/branch may be removed. It also flags the destructive precondition for delete_branch (only after merging or discarding), which is exactly the kind of risk context an agent needs.

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?

Two tight sentences: identity/purpose first, destructive effects second. No filler and nothing buried.

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 no-output-schema mutation tool, the description covers what is destroyed and what optional cleanup occurs, which is the main risk an agent must understand. Minor gaps remain around failure behavior (e.g., closing an already-closed or unknown agent_id) and what is returned.

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

Parameters3/5

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

Schema coverage is 100%, so all three parameters are already documented with defaults and caveats. The description restates the worktree-removal option in prose but adds no syntax or format detail the schema lacks, so the baseline 3 applies.

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?

"Cancel/close an Antigravity subagent" names a precise verb and resource, and the follow-on sentence clarifies the concrete effect (process tree termination, optional worktree removal). It is easily distinguished from spawn/wait/send_input siblings by semantics, though it never names them explicitly.

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?

Usage is implied rather than stated: you close a subagent to abort or clean it up. There is no explicit when-not guidance (e.g., what to do if the agent is still running vs. already finished beyond the idempotent hint) and no routing to alternatives like agy_status before closing.

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