fs_edit_file
Apply text replacements in a file by specifying old and new text strings. Preserves original BOM and line endings.
Instructions
Apply one or more old→new text replacements to an existing file.
Preserves the file's original BOM and line-ending style (CRLF/LF). Each edit must supply "old_text" (unique substring) and "new_text".
Returns: {"path", "bytes_written", "bom_preserved", "eol_style"}.
Raises on: empty old_text, text not found, duplicate matches, overlapping edits, replacement produces identical content.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | ||
| edits | Yes |