server_file_edit
Replace an exact, unique string in a text file to update content safely; set confirm=true to apply, with optional backup and replace-all support.
Instructions
Change part of a text file: replace old_string with new_string. Needs confirm=true.
old_string must match the file exactly and must be unique, unless replace_all=true. Works on files Claude can read. Lines with hidden secrets cannot be matched.
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": "server_file_edit"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| host | No | ||
| path | Yes | ||
| backup | No | ||
| as_root | No | ||
| confirm | No | ||
| new_string | Yes | ||
| old_string | Yes | ||
| replace_all | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |