sage_edit_file
Exact string replacement in a file. Returns a compact change preview instead of the whole file, and snapshots the pre-edit content for undo. old must match exactly and be unique unless replace_all=true.
Instructions
Exact string replacement in a file. Returns a compact change preview instead of the whole file, and snapshots the pre-edit content for undo. old must match exactly and be unique unless replace_all=true.
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": "<old>",
"new": "<new>"
},
"name": "sage_edit_file"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| new | Yes | Replacement (empty deletes) | |
| old | Yes | Exact string to replace | |
| path | Yes | File to edit | |
| replace_all | No |