Skip to main content
Glama
Knuckles-Team

Repository Manager

Remove

rm_worktree_remove
DestructiveIdempotent

Remove a git worktree once its session lane is clear, optionally deleting the branch to clean up completed or abandoned concurrent development work.

Instructions

Remove (rm_worktree). Manage git worktrees for concurrent multi-session development (CONCEPT:RM-WORKTREE).

Each session works a repo in its own worktree on its own branch under <WORKTREE_ROOT>/<repo>/<branch> (shared .git, no re-clone), leaving the canonical checkout on its default branch so a working-tree reset never disturbs in-flight session work.

Input Schema

NameRequiredDescriptionDefault
baseNoBase branch to fork from / sync against.main
intoNoTarget branch for 'merge', or the reset target for 'reset_branch'.main
pathNoWorkspace root override.
repoNoRepo basename (e.g. 'epistemic-graph') or absolute path. Omit for 'list'/'prune' across all repos.
adoptNoFor 'add': move the canonical checkout's uncommitted WIP onto the new branch via a private ref (never the shared refs/stash stack).
forceNoFor 'remove': override git's own dirty-tree refusal once lane occupancy has already cleared (never bypasses occupancy itself, D-CDX-15).
reposNoFor 'bulk_add': comma-separated repo basenames (default: every workspace repo).
branchNoWorktree branch name (each session uses a distinct branch).
strategyNoFor 'sync': 'rebase' or 'merge'.rebase
stale_daysNoFor 'audit': an unmerged worktree quiet for longer than this many days is classified 'stale' (review) rather than 'active'.
prune_mergedNoFor 'audit': DESTRUCTIVE. After classifying, remove every 'merged' worktree (and delete its branch) plus prune 'dangling' admin pointers. Never touches 'active'/'stale' work or orphaned directories.
delete_branchNoFor 'remove': also delete the branch.

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv3.5.1

TDQS

C2.4/5.0
Behavior2/5

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

Annotations already declare destructiveHint=true, idempotentHint=true, openWorldHint=false, so the safety profile is covered. The description adds only a generic worktree layout explanation and discloses nothing removal-specific: that the branch survives unless delete_branch is set, that a dirty tree is refused unless force is passed, or that removal interacts with lane occupancy. For a destructive operation this is thin added value.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness2/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The front-loaded sentence is just a name restatement, and the bulk of the text is a multi-line conceptual digression about worktree architecture that does not help an agent call this specific tool. Substantial word count with little tool-specific payoff.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

An output schema exists and the schema documents all 12 parameters, so those burdens are lifted, but the description never completes the picture for a destructive removal: no success/failure conditions, no note that the canonical checkout is untouched, and no differentiation from the prune/audit siblings that can also delete merged worktrees. Given a 12-parameter destructive tool, the generic concept text leaves meaningful gaps.

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 description coverage is 100%, so baseline is 3. The parameter descriptions themselves carry the real semantics (force's occupancy caveat, delete_branch, repo/branch targeting), and the tool description contributes no additional parameter meaning. Baseline is correct here.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose3/5

Does the description clearly state what the tool does and how it differs from similar tools?

The lead 'Remove (rm_worktree)' restates the tool name and verb rather than describing the specific action, then pivots into a generic description of the worktree system as a whole. It never says what is actually removed (a worktree directory, optionally its branch) nor how it differs from rm_worktree_prune or rm_worktree_audit. The verb is present but the resource and scope are left to the tool name.

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

Usage Guidelines2/5

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

There is no guidance on when to call remove versus rm_worktree_prune, rm_worktree_audit (with prune_merged), or rm_worktree_list, despite those siblings covering closely overlapping work. No prerequisites (e.g. that the lane must be idle) or exclusions are stated. The description reads like a shared concept blurb rather than routing guidance.

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

Deploy Server

Other Tools