xlsx_write
Write or update a local .xlsx file from a structured spec specifying sheets and cells with values or formulas. Server-side validation ensures safe output.
Instructions
create or update a LOCAL .xlsx file from a structured spec.
Spec shape: {sheets: [{name, cells: [{address, value | formula}]}]}. Each cell has an A1 address ("A1", "B2") and EITHER value (string|number|boolean|null) OR formula (string, no leading "="). Minimal example:
{"sheets":[{"name":"Sheet1","cells":[{"address":"A1","value":"id"},{"address":"A2","value":1},{"address":"B2","formula":"A2*2"}]}]}
ALWAYS pass out_path to save to disk. Without out_path the workbook bytes return in _meta.file_b64.
USE WHEN: the user wants to write or edit a spreadsheet at a LOCAL file path. Server-validated before writing — safer than generating xlsx bytes directly.
DO NOT USE WHEN: working in a sandbox without local filesystem write access. Or editing an uploaded file in place (there is no local path to write to).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| base_file_b64 | No | ||
| spec | Yes |