file_patch
Replace a unique text block in a project file with new content, failing safely if the match is missing or ambiguous.
Instructions
Replace exactly one matching text block in a UTF-8 project file. Fails when the match is missing or ambiguous.
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": {
"projectId": "<projectId>",
"path": "<path>",
"oldText": "<oldText>",
"newText": "<newText>"
},
"name": "file_patch"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | ||
| newText | Yes | ||
| oldText | Yes | ||
| projectId | Yes |