Apply Patch
apply_patchApply unified diff patches to multiple files in the workspace, with path validation to avoid unsafe changes. Use for batch modifications across the repository.
Instructions
Apply one unified diff patch inside the workspace. Paths are validated before applying. Prefer edit for tiny replacements and apply_patch for multi-file diffs.
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 |
|---|---|---|---|
| patch | Yes | Unified diff patch to apply. File paths must stay inside the workspace and avoid blocked paths. | |
| workspace_id | No | Workspace id from open_workspace. Omit to use default workspace. |