apply_patch
Apply a context-checked patch to a file in a writable repository, replacing old text with new text. Create a new file when old text is empty and create is enabled.
Instructions
Apply a bounded, context-checked patch to a file in a writable repository. If old_text is empty and create=true, creates the file.
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": {
"repo": "<repo>",
"path": "<path>",
"old_text": "<old_text>",
"new_text": "<new_text>"
},
"name": "apply_patch"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | ||
| repo | Yes | ||
| create | No | ||
| context | No | ||
| new_text | Yes | ||
| old_text | Yes |