edit
Replace exact text in files while preserving encoding and line endings, adapting indentation, and offering dry-run and hash verification for safe edits.
Instructions
Replace exact text in a file. Preserves encoding and local line endings, adapts indentation using the file and .editorconfig, and supports dry-run plus hash-guarded edits.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | No | Alias for file_path | |
| dry_run | No | Preview only; default false | |
| file_path | No | File path; relative to workspace/MCP root | |
| new_string | No | Replacement text; must differ from old_string | |
| old_string | No | Exact text to find in the file | |
| new_content | No | Alias for new_string | |
| old_content | No | Alias for old_string | |
| replace_all | No | Replace every match; default false | |
| indent_style | No | tabs or spaces-N; default auto-detect | |
| expected_hash | No | Expected SHA-256; mismatch rejects edit |