Edit file
edit_fileReplaces old_string with new_string in a file. old_string must match exactly (including whitespace) and be unique unless replace_all is true. Pass base (the version read_file gave) to have the edit refused with file_changed if someone changed the file after your read; then read it again and redo the edit.
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>",
"old_string": "<old_string>",
"new_string": "<new_string>"
},
"name": "edit_file"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| base | No | The file's version from read_file, or null for a new file that must not exist yet. Optional | |
| path | Yes | ||
| projectId | Yes | Project id from list_projects | |
| new_string | Yes | ||
| old_string | Yes | ||
| replace_all | No |