replace_in_file
Find and replace a text string in a file. Supports modifying files outside the project root when explicitly approved.
Instructions
Replace text string in a 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": {
"filePath": "<filePath>",
"oldText": "<oldText>",
"newText": "<newText>"
},
"name": "replace_in_file"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| newText | Yes | New text | |
| oldText | Yes | Text to replace | |
| filePath | Yes | File path | |
| allow_external_access | No | Set to true to allow modifying files outside the project root. User must explicitly approve this action. |