xlsx_write
Create or update .xlsx workbooks from a structured sheet and cell spec; formatting is optional and the spec is validated before writing.
Instructions
Use this when you need to create or update a spreadsheet from a structured spec ({sheets: [{name, cells: [{address, value | formula, style?, hyperlink?, comment?}], columns?, freeze?, merges?, conditionalFormats?, dataValidations?}]}) — formatting is optional; server-validated before writing. A value sent beside a formula is stored as that formula's cached result (the reply says how many: _meta.cached_formula_cells).
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "xlsx_write"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| spec | No | Workbook spec. Shape: {sheets: [{name: string, cells: [{address, value | formula}]}]}. Each cell has an A1-style `address` (regex ^[A-Za-z]+\d+$) and EXACTLY ONE of `value` (string|number|boolean|null) or `formula` (string WITHOUT leading "=" — e.g. "SUM(A1:A10)" not "=SUM(A1:A10)"). Example: {"sheets":[{"name":"Sheet1","cells":[{"address":"A1","value":"id"},{"address":"A2","value":1},{"address":"B2","formula":"A2*2"}]}]} | |
| out_path | No | Destination .xlsx path. Required when the caller wants the file saved to disk. | |
| spec_path | No | Absolute path to a .json file carrying the spec (alternative to inline spec for large workbooks). Pass the path string AS-IS — do NOT base64-encode; the client reads it. | |
| base_file_b64 | No | NARROW EXCEPTION — xlsx_write ONLY accepts a base64-encoded base workbook here for edit-in-place. Every OTHER tool in this connector takes a file PATH (`file_path`), not bytes. When omitted, a fresh workbook is created. |