edit_block
Edit a file in place: replaces old_string with new_string, which must occur exactly expected_replacements times (default 1); include nearby lines to make it unique. Spreadsheets: range (e.g. Sheet1!A1:C3) and a 2D content array. DOCX: exact XML (for text across formatting use edit_docx). On a mismatch nothing changes and the closest match is shown. On Windows an edit may not keep the file's own permission entries or alternate data streams (such as the mark of a downloaded file).
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": "edit_block"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| range | No | ||
| content | No | ||
| deviceId | No | Computer name or id | |
| file_path | Yes | ||
| new_string | No | ||
| old_string | No | ||
| workSessionId | No | From create_work_session | |
| expected_replacements | No |