Skip to main content
Glama

Git Worktree

git_worktree

Manage Git worktrees to develop multiple branches in parallel.

Instructions

Manage multiple working trees: list worktrees, add new worktrees for parallel work, remove worktrees, or move worktrees to new locations.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathNoPath to the Git repository. Defaults to session working directory set via git_set_working_dir..
modeNoThe worktree operation to perform.list
worktreePathNoPath for the new worktree (for add/move operations).
branchNoBranch to checkout in the new worktree (for add operation).
commitishNoCommit/branch to base the worktree on (for add operation).
forceNoForce operation (for remove operation with uncommitted changes).
newPathNoNew path for the worktree (for move operation).
detachNoCreate worktree with detached HEAD (for add operation).
verboseNoProvide detailed output for worktree operations.
dryRunNoPreview the operation without executing it (for prune operation).

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
successYesIndicates if the operation was successful.
modeYesOperation mode that was performed.
worktreesNoList of worktrees (for list mode).
addedNoAdded worktree path (for add mode).
removedNoRemoved worktree path (for remove mode).
movedNoMove operation info (for move mode).
prunedNoPruned worktree paths (for prune mode).
Behavior3/5

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

The annotation readOnlyHint: false indicates this is not a read-only tool, and the description confirms this by mentioning 'remove' and 'move' operations. It adds context about 'parallel work' as a use case. However, it fails to mention the 'prune' operation, does not elaborate on the destructive potential of remove operations (e.g., uncommitted changes), and does not clarify filesystem side effects beyond the schema.

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?

The description is efficiently structured as a single sentence with a colon-delimited list of operations. It is front-loaded with the core concept ('Manage multiple working trees'). It loses one point for omitting 'prune' from the operation list, which creates a minor gap between the description and actual capabilities.

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 10 parameters, multiple modes, and an output schema, the description provides adequate high-level orientation but leaves gaps. The omission of the 'prune' mode is notable, and there is no mention of default behaviors (e.g., mode defaults to 'list'). Since an output schema exists, the description correctly does not attempt to document return values.

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?

With 100% schema description coverage, the structured data already documents all 10 parameters comprehensively. The description adds minimal semantic value beyond the schema, though it implicitly groups parameters by operation type (add/move/remove). Baseline score of 3 is appropriate since the schema carries the full burden.

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 clearly identifies the resource (working trees) and enumerates specific operations (list, add, remove, move). It distinguishes from siblings like git_checkout or git_branch by focusing on worktree management and mentioning 'parallel work.' However, 'Manage' is slightly generic as a verb, and it omits the 'prune' operation present in the schema enum.

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 phrase 'for parallel work' implies a use case (concurrent development on multiple branches), but there are no explicit when-to-use guidelines, prerequisites, or comparisons to alternatives like git_clone or git_stash. The agent must infer appropriate scenarios from the implied context.

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/cyanheads/git-mcp-server'

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