apply_patch
Apply unified diff patches to modify workspace files, supporting validation, reversal, and Git integration for development workflows.
Instructions
Apply a unified diff patch in the workspace
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": {
"patch": "<patch>",
"commitMessage": "<commitMessage>"
},
"name": "apply_patch"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| patch | Yes | Unified diff (git-style) | |
| dryRun | No | Validate without applying changes | |
| reverse | No | Apply the patch in reverse | |
| fuzz | No | Allow fuzz matching | |
| commitMessage | Yes | Commit message for git |