Skip to main content
Glama

remove_worktree

Clean up orphaned git worktrees safely: commit leftover changes first and preserve unmerged branches to avoid data loss.

Instructions

Remove an orphaned checkout listed by list_worktrees (leftovers are committed first; the branch stays if unmerged).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
terminal_idYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.3

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 behavioral burden and does disclose non-obvious side effects: leftovers are committed first, and the branch is retained if unmerged. That is real information an agent could not derive otherwise. It stops short of stating whether the removal is irreversible, what permissions are required, or how failures are surfaced.

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?

One sentence, front-loaded with the action and target, with the qualifiers confined to a parenthetical. No filler, no repetition of the tool name.

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?

An output schema exists, so return values need not be described. Given the tool's low complexity, the description adequately covers purpose, preconditions, and side effects; the remaining gap is the undocumented terminal_id parameter and unstated irreversibility.

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 'terminal_id' has 0% schema description coverage, so nothing in the structured fields explains it, and the description never clarifies that the worktree is addressed by a terminal id or how to obtain that id beyond the vague 'listed by list_worktrees'. The description does not compensate for the coverage gap.

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?

States a specific verb ('Remove') and resource ('orphaned checkout'), and pins the resource to how it is discovered ('listed by list_worktrees'), which distinguishes it from every non-worktree sibling. An agent can tell exactly what this operates on without opening 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 Guidelines3/5

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

Referring to 'an orphaned checkout listed by list_worktrees' implies the intended workflow (inspect via list_worktrees, then remove the orphan), but there is no explicit when-to-use/when-not statement or mention of prerequisites such as when a worktree is safe versus unsafe to remove. Usage is inferable rather than stated.

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