apply_patch
Apply unified diffs to modify multiple files, ensuring each hunk applies cleanly with exact context matching.
Instructions
Apply a multi-file unified diff. Hunks must apply cleanly with exact context.
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": {
"diff": "<diff>"
},
"name": "apply_patch"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| diff | Yes | Unified diff. Multiple files supported. Each file header must be `--- a/<path>` then `+++ b/<path>`. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ok | Yes | ||
| error | Yes | ||
| _hints | Yes | ||
| requiresHarnessSession | Yes |