git-mcp-server: Restore worktree paths
git_restore_worktreeRestore specific tracked worktree paths from the current index after validating a snapshot guard, ensuring safe and idempotent restoration.
Instructions
Operation: Restore declared tracked worktree paths from the current index after validating the supplied snapshot guard. Returns: request_id, repository_id, restored paths, and a new worktree_snapshot_id. Defaults: all inputs are required and the current index is the only content source. Excludes: index mutation, untracked paths or deletion, directories, globs, and unrequested paths.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"repository": "<repository>",
"request_id": "<request_id>",
"expected_branch": "<expected_branch>",
"expected_head": "<expected_head>",
"worktree_snapshot_id": "<worktree_snapshot_id>",
"paths": "<paths>"
},
"name": "git_restore_worktree"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| paths | Yes | Explicit tracked worktree paths to restore from the current index after the snapshot guard is validated. | |
| repository | Yes | Absolute path to the exact target Git worktree for this mutation. | |
| request_id | Yes | Client-generated UUID that makes this mutation durable and idempotent for exact replay. | |
| expected_head | Yes | Exact current local HEAD object ID expected before mutation; mismatch rejects without Git mutation. | |
| expected_branch | Yes | Exact current local branch name expected before mutation; mismatch rejects without Git mutation. | |
| worktree_snapshot_id | Yes | Exact complete worktree snapshot guard previously returned by git_status. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| data | No | ||
| error | No | ||
| status | Yes | ||
| warnings | Yes | ||
| operation | Yes | ||
| request_id | No | ||
| repository_id | No | ||
| observed_after | No | ||
| observed_before | No |