Skip to main content
Glama

cleanup_agent_run

Cancel a running agent and delete its temporary worktree using the worker ID to free resources and prevent leftover files.

Instructions

Cancel a running agent and delete its temporary worktree.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
worker_idYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior3/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It states the two main actions (cancel and delete), clearly indicating the destructive nature of deleting the worktree. However, it omits details such as what happens if the agent is not running, whether the deletion is permanent, or any side effects beyond the worktree, leaving some gaps in transparency.

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 a single sentence of nine words, highly concise and front-loaded. Every word contributes meaning, clearly stating the two core actions without any redundancy or filler.

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?

Given the tool has one mandatory parameter and an output schema, the description adequately covers the core purpose. However, it lacks context around edge cases (e.g., agent already finished, worktree missing) and does not clarify what happens to the agent run record after cancellation. This leaves some gaps for a destructive operation, but the description is not fatally incomplete for a simple cleanup tool.

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

Parameters2/5

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

The single parameter 'worker_id' has no description in the schema (0% coverage), and the tool description never mentions this parameter or explains how it relates to the cancellation. The parameter name is somewhat self-explanatory, but the description fails to compensate for the lack of schema documentation, offering no additional context like format, source, or constraints.

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 uses the specific verbs 'Cancel' and 'delete' with a clear resource ('running agent' and 'temporary worktree'). It clearly distinguishes from sibling tools like list_agent_runs or delegate_to_agent, leaving no ambiguity about the tool's function.

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?

The description implies the usage context: when you want to cancel a running agent and clean up its temporary worktree. However, it does not explicitly mention when to avoid using it or suggest alternatives from the sibling tools, so it stops at implied usage rather than clear guidance.

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/psychofanPLAYS/gemini4codex-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server