edit_file
Replace an exact substring in a local text file while preserving CRLF/LF endings and UTF-8 BOM. Preview changes with dryRun or update every match with replaceAll.
Instructions
Perform an exact substring replacement in a local text file while preserving CRLF/LF line endings and UTF-8 BOM. Supports dryRun and replaceAll.
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": {
"filePath": "<filePath>",
"target": "<target>",
"replacement": "<replacement>"
},
"name": "edit_file"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| dryRun | No | ||
| target | Yes | Exact text block to replace | |
| filePath | Yes | Absolute file path | |
| replaceAll | No | ||
| replacement | Yes | Replacement text |