Skip to main content
Glama

list_worktrees

List active and orphaned git worktrees from concurrent terminal sessions, showing branch, repo, path, and status so you can merge or clean up.

Instructions

Every live terminal that runs in its own git worktree: what there is to merge.

Each entry has terminal_id, status, repo, path and branch. Merge a finished one with git -C <repo> merge <branch>; deleting the terminal commits any leftovers on the branch, removes the checkout and keeps the branch when it has commits the repo's HEAD lacks. orphaned lists checkouts whose terminal died with an earlier server; they are never removed on their own — merge what you want, then remove_worktree.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.3

TDQS

A4.1/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 mostly does: it discloses that orphaned checkouts are never removed on their own, and that deleting a terminal commits leftovers on the branch, removes the checkout, and keeps the branch when it has commits the repo's HEAD lacks. Those are non-obvious side effects an agent would otherwise get wrong. It never explicitly states this call is read-only/non-mutating, which is the remaining gap.

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

Conciseness4/5

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

Front-loaded with the scope statement, then the entry fields, then the merge/removal lifecycle. Each sentence carries information; the only mild inefficiency is that the fragment style makes the first line read as a header rather than a sentence.

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

Completeness5/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 re-explained, yet the description still summarizes the entry keys. Combined with the merge instructions and the orphaned-entry caveat pointing at remove_worktree, an agent has everything needed to list, interpret, and act on the result correctly.

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?

The tool takes zero parameters, so the baseline is 4. The description adds nothing parameter-related (there is nothing to add), and instead spends its budget on the entry shape and lifecycle, which is the right trade.

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 opens by scoping the resource precisely: 'Every live terminal that runs in its own git worktree,' which is a specific verb (list) plus resource (worktrees) with a defined subset. It also names the sibling remove_worktree in the context of orphaned checkouts, so the agent can separate this from that tool. The phrasing is slightly indirect ('what there is to merge' rather than 'lists worktrees'), which keeps it just short of a 5.

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

Usage Guidelines4/5

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

It gives concrete next-step guidance: merge a finished entry with `git -C <repo> merge <branch>`, and for orphaned entries 'merge what you want, then `remove_worktree`.' That is an explicit alternative tool plus the condition that selects it. It does not state when this tool should be used instead of list_sessions or get_terminal_status, but the operational routing is strong.

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