edit
Replace exact text in files while preserving encoding and line endings, adapting indentation, and optionally previewing dry-run or enforcing hash-guarded 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.
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "edit"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | No | Alias for file_path | |
| dry_run | No | Preview only; default false | |
| encoding | No | Charset override, e.g. EUC-KR or Shift_JIS; overrides .editorconfig, BOM takes priority | |
| 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 |