apply_patch
Replace an exact string in a text file with new text, and fail if the number of occurrences differs from expectedReplacements.
Instructions
Exact string replacement patch for one text file. Fails if replacement count differs from expectedReplacements.
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": {
"path": "<path>",
"oldText": "<oldText>",
"newText": "<newText>"
},
"name": "apply_patch"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | ||
| newText | Yes | ||
| oldText | Yes | ||
| expectedReplacements | No |