apply_patch
Apply unified diff patches to repository files atomically, returning success status and changed file list.
Instructions
Atomically apply a unified diff patch to repository files.
Args: patch: The unified diff content (e.g., standard 'diff --git' or '--- / +++' format). file_path: Optional relative target path if targeting a single file.
Returns: JSON string with success status, list of changed files, and status message.
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 | ||
| file_path | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |