Edit file
edit_fileReplace exact text fragments in a file without rewriting it. Apply one or more edits atomically; ambiguous matches are refused, and dry-run preview plus SHA-256 checks enable safe concurrent editing.
Instructions
Replace exact text fragments in a file instead of rewriting the whole file. One edit: oldString/newString. Several edits in one atomic change: edits=[{oldString,newString,replaceAll?}] — applied in order, all or nothing. Refuses an edit whose oldString is not found or found more than once (unless replaceAll), so it can never patch the wrong place. Supports expectedSha256 (safe concurrent editing) and dryRun preview; the previous version is kept in ZeroIDE history for undo. Write is atomic.
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>"
},
"name": "edit_file"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| note | No | Short human-readable explanation (1 line, in the user's language) of what you are about to do and why. Shown to the user on the approval card. Always provide when calling mutating tools. | |
| path | Yes | ||
| agent | No | Short consistent identifier or display name of this agent (e.g. 'Claude · Лендинг', 'Тесты', 'Мой агент'). Used to separate tasks and route tray messages when multiple agents work in parallel. | |
| edits | No | Several replacements applied in order as one atomic change. Use instead of oldString/newString. | |
| backup | No | ||
| dryRun | No | ||
| newString | No | ||
| oldString | No | ||
| requestId | No | ||
| replaceAll | No | Single-edit mode: replace every occurrence of oldString instead of requiring exactly one. | |
| expectedSha256 | No |