Create Excel, Word or PDF file
office_writeUse this when the user asks to create an Excel workbook (.xlsx) , a Word document (.docx) or a PDF (.pdf) in an approved project, without Office or another program. A workbook takes sheets of rows; each cell is text, a number, true/false, null (empty) or {formula: "=SUM(A1:A3)"}. A document or PDF takes markdown: lines starting with # to ###### become headings 1-6, other lines paragraphs, empty lines empty paragraphs; a PDF is laid out on A4 pages in a font installed on the computer that has every character, and cannot take right-to-left or other scripts that need shaping (Arabic, Hebrew, Indic, Thai). An existing file is replaced only with overwrite true. Changes files on the computer. Needs the sessionId from execution_session_open and a new operationId; each call is metered as one execution. A short result is returned inline within about two seconds; otherwise keep the returned IDs for operation_status and operation_output and do not resend the call.
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": {
"sessionId": "<sessionId>",
"operationId": "<operationId>",
"path": "<path>"
},
"name": "office_write"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | New workbook (.xlsx), document (.docx) or PDF (.pdf) path relative to the selected project root (or the workspace root) | |
| sheets | No | Workbooks: sheets in order, {name (1-31 characters), rows (arrays of cells)}, up to 1 MiB as JSON | |
| markdown | No | Documents and PDFs: the text, # to ###### for headings, up to 1 MiB | |
| overwrite | No | Set true to replace an existing file (default false) | |
| sessionId | Yes | executionSessionId returned by execution_session_open | |
| deadlineAt | No | Optional UTC admission deadline at most 60 seconds ahead (queue start timeout, NOT process execution lifetime) | |
| operationId | Yes | A new random UUID v4 for this call; reuse it only to retry this same call | |
| expectedSha256 | No | SHA-256 of the current file; the write is refused if the file changed (optional) | |
| idempotencyKey | No | Optional retry key, 8-128 chars of [A-Za-z0-9._:-]; defaults to operationId | |
| efficiencyProfile | No | Optional, unverified label of the client's model, recorded as display metadata in the device owner's local activity statistics. Omit when unknown. Never send credentials or conversation content. |