Precise file editor. Three operations: view (read file or line range), edit (replace old_string with new_string — fails if text appears 0 or more than once, preventing accidental changes), patch (apply unified diff with @@ hunks, fuzzy matching ±20 lines). Modeled after Claude Code Edit tool. Use view first to confirm context before editing.
editoreditpatchdifffilesprecisecodingagentllm
Input Parameters
Parameter
Type
Description
operationrequired
string
view=read file or line range, edit=precise text replacement (unique match required), patch=apply unified diff One of: view, edit, patch.
pathrequired
string
Absolute path to the file. Required for all operations.
old_stringoptional
string
edit: exact text to find. Must appear exactly once in the file. Include surrounding lines for context if needed.
new_stringoptional
string
edit: replacement text.
diffoptional
string
patch: unified diff text (@@ hunks). Standard output of diff -u.
start_lineoptional
integer
view: first line to return (1-based). Default: 1.
end_lineoptional
integer
view: last line to return (1-based). Default: end of file.
encodingoptional
string
File encoding. utf8 (default), ansi (Windows-1252 for legacy files with tildes/enyes), utf8bom, utf16. One of: utf8, ansi, utf8bom, utf16. Default: utf8.