apply_patch
Validate and apply a strict unified diff relative to cwd. Rejects entire patch on context mismatch, with no fuzzy or partial fallback.
Instructions
Apply a strict standard unified diff relative to cwd. All hunks are validated before mutation; context mismatch rejects the entire patch without fuzzy or partial fallback.
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>"
},
"name": "apply_patch"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| cwd | No | Patch root directory. Defaults to the agent user home directory. | |
| patch | Yes | Standard unified diff to validate and apply. |