Git Worktree
git_worktreeManage Git worktrees by path or branch: add, list, remove, lock, unlock, prune, and repair plain worktrees, or create and clean up Git Flow worktrees addressed by branch name.
Instructions
Worktrees, two ways. Path-addressed (add, remove, lock, unlock, prune, repair) drives plain git worktree and needs nothing but git. Branch-addressed (flow_add, flow_remove, flow_list, flow_path) drives git flow worktree: it addresses worktrees by branch name, computes paths from the gitflow.worktreePath template, and tags provenance so cleanup can tell a git-flow-created worktree (removed) from a hand-made one (detached, work preserved). The flow_* actions require git-flow-next on PATH.
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "git_worktree"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | No | ||
| force | No | ||
| paths | No | ||
| action | No | list | |
| branch | No | ||
| expire | No | ||
| detached | No | ||
| repo_path | No | Absolute path to the local Git repository. If omitted, falls back to the server default set via the GIT_REPO_PATH environment variable or --repo-path CLI argument. | |
| lock_reason | No | ||
| response_format | No | Output format for the response. | markdown |