Skip to main content
Glama

Create Excel, Word or PDF file

office_write
DestructiveIdempotent

Use 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

NameRequiredDescriptionDefault
pathYesNew workbook (.xlsx), document (.docx) or PDF (.pdf) path relative to the selected project root (or the workspace root)
sheetsNoWorkbooks: sheets in order, {name (1-31 characters), rows (arrays of cells)}, up to 1 MiB as JSON
markdownNoDocuments and PDFs: the text, # to ###### for headings, up to 1 MiB
overwriteNoSet true to replace an existing file (default false)
sessionIdYesexecutionSessionId returned by execution_session_open
deadlineAtNoOptional UTC admission deadline at most 60 seconds ahead (queue start timeout, NOT process execution lifetime)
operationIdYesA new random UUID v4 for this call; reuse it only to retry this same call
expectedSha256NoSHA-256 of the current file; the write is refused if the file changed (optional)
idempotencyKeyNoOptional retry key, 8-128 chars of [A-Za-z0-9._:-]; defaults to operationId
efficiencyProfileNoOptional, 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.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.6/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Beyond the annotations (destructive, non-read-only, idempotent, closed-world), the description discloses that an existing file is replaced only with overwrite true, that the sessionId must come from execution_session_open and each call needs a new operationId, that calls are metered as executions, and that a ~2s inline result may otherwise require polling operation_status/operation_output rather than resending. It also documents a genuine capability limit: PDFs need a font covering every character and cannot render right-to-left or shaped scripts.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

It is front-loaded with the trigger condition and then proceeds format-by-format, with no filler sentences. It is dense to the point of being a single wall of text about PDF font/shaping limits and async polling, which could be broken up, but every clause carries information an agent needs.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a 10-parameter, nested-object, mutation tool with no output schema, the description covers the input-shape routing, file replacement semantics, session/operation plumbing, metering, and the async result contract. Nothing an agent needs in order to call it correctly and handle the response is left unstated.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so baseline is 3, but the description adds real meaning: it explains the cell value domains (text, number, boolean, null, {formula: "=SUM(A1:A3)"}), the 1-6 heading mapping for markdown, and the semantic intent of overwrite and operationId beyond their schema text. Minor parameters such as deadlineAt, expectedSha256, and idempotencyKey are left entirely to the schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description names a concrete verb and resource set (create .xlsx workbook, .docx document, or .pdf) and scopes it with 'in an approved project, without Office or another program', which lets an agent separate it from office_edit and fs_write. It also states which input shape applies to which output format (sheets for workbooks, markdown for documents/PDFs).

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

'Use this when the user asks to create...' gives an explicit positive trigger, and the overwrite sentence plus the PDF shaping limitations define clear negative conditions. What is missing is a direct pointer to a sibling (e.g., office_edit for modifying an existing file rather than creating one), so the agent must infer that alternative.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.