read_edit
Read a file and optionally edit it in a single call, reducing tool calls for single-file tasks. Omit edit parameters for read-only.
Instructions
Read a file and optionally edit it in one call. For single-file tasks, use this instead of separate read_file + edit calls. Returns file content. Edit params (old_string, new_string) are optional — omit them for read-only.
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": {
"file_path": "<file_path>"
},
"name": "read_edit"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| file_path | Yes | Absolute path to the file | |
| old_string | No | Text to replace (exact match or regex if use_regex=true) | |
| new_string | No | Text to replace with | |
| use_regex | No | Treat old_string as regex (default: false) | |
| replace_all | No | Replace all occurrences (default: false) | |
| offset | No | Line number to start reading from (optional) | |
| limit | No | Number of lines to read (optional) |