Skip to main content
Glama

pi_cleanup

Remove a finished worker's worktree and branch, then forget the worker. Refuses if unmerged work exists unless force is true.

Instructions

Remove a finished worker's worktree and branch and forget the worker. Refuses if it has unmerged work unless force is true.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYesWorker id from pi_spawn
forceNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.1.0

TDQS

A3.9/5.0
Behavior4/5

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

With no annotations, the description carries the full burden and does disclose the critical behavior: it is destructive (removes worktree and branch, forgets the worker) and it has a safety guard that refuses on unmerged work unless force is true. It omits irreversibility details, required permissions, and whether the worker must be stopped first.

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 short sentences, zero waste, with the effect front-loaded and the precondition immediately after. Every clause earns its place.

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 two-parameter cleanup tool with no annotations and no output schema, the description covers what it does and its main failure mode. It stops short of describing the return value or defining precisely what "forget the worker" entails, leaving minor gaps.

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 50%: id is documented in the schema ("Worker id from pi_spawn") but force is not. The description compensates by explaining force's semantics (override the unmerged-work refusal), which is the key meaning an agent needs.

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?

The description gives specific verbs (remove, forget) and concrete resources (worktree, branch, worker), making the effect clear. It does not explicitly differentiate from siblings like pi_kill or pi_merge, so the agent must infer the boundary, but the core purpose is unambiguous.

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 by "a finished worker's worktree," signalling this runs after completion, and the unmerged-work refusal states a precondition. However, no alternative tool is named (e.g. whether to pi_merge first), so the agent must infer the workflow ordering.

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