edit_file
Replace an exact string that appears exactly once in a file with a new string, ensuring precise single-occurrence replacement.
Instructions
Replace an exact string in a file. The old_string must appear exactly once.
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>",
"old_string": "<old_string>",
"new_string": "<new_string>"
},
"name": "edit_file"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | File path | |
| old_string | Yes | Exact text to find and replace | |
| new_string | Yes | Text to replace it with | |
| workspace_root | No | Workspace root directory (optional) |