edit_file
Replace exact line sequences in text files within allowed directories. Preview changes with dry run and get a git-style diff of modifications.
Instructions
Make selective edits to a text file based on exact line matches (or whitespace normalized). Each edit replaces an existing sequence of lines (old_text) with new lines (new_text). Returns a git-style diff of the changes. Use dry_run to preview. Only works within allowed directories:
/app
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": {
"path": "<path>",
"edits": "<edits>"
},
"name": "edit_file"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | Path to the file to edit | |
| edits | Yes | List of edit operations | |
| dry_run | No | Preview changes without applying |