write_range
Write values and formulas into xlsx/csv files, fill formulas down columns, or append rows while preserving existing formatting, charts, sheets, and automatic backups.
Instructions
Write values and formulas into an xlsx (or csv), or fill a formula down a column. Only cell values change; existing formatting, other formulas, charts and sheets are preserved. A backup is made automatically (undo with backups). Appending rows to a CSV streams, so it is fast even for huge files.
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>"
},
"name": "write_range"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | File path, relative to the root folder (or absolute inside it). | |
| cells | No | Individual cells, e.g. {'B2': 42, 'C2': '=B2*1.15'}. | |
| sheet | No | Sheet name (or 0-based index). Default: first sheet. | |
| append | No | Append `values` as new rows after the last used row (ignores start_cell row). | |
| create | No | Create the file/sheet if missing. | |
| values | No | 2D list of rows. Strings starting with '=' become formulas, e.g. '=SUM(B2:B9)'. | |
| dry_run | No | Preview the change without saving. | |
| fill_range | No | Where fill_formula goes, e.g. 'D2:D100', or 'D2:D' / 'D2' = down to the last used row. | |
| start_cell | No | Top-left cell for `values`. | A1 |
| parse_dates | No | Turn ISO strings like '2024-05-01' into real Excel dates. | |
| fill_formula | No | Formula for the FIRST cell of fill_range, e.g. '=B2*C2'; copied down/right with relative references adjusted (like dragging the fill handle). |