Skip to main content
Glama

hedwigai

Save, restore or re-rule a workbook

write_workbook
Destructive

Saves, replaces, restores or re-rules a workbook directly, with no run. Save text you edited (document, or sheets, with the base_version you read); restore or undo to an earlier version (restore_version alone — no need to read first); or set its schema, the rules every edit must hold (schema alone, e.g. dates must be YYYY-MM-DD). Write in the workbook's form: read_workbook's file_type and edit_as say what its tabs hold — markdown for docx, a table per sheet for xlsx, one svg per slide for pptx, LaTeX/Typst for an editable pdf, glTF JSON for glb. Every save is compiled to that file type and against the schema; a failing one is refused with each error's tab and line. check_only compiles the same edit (text, tabs or schema) and says what a save would be told, saving nothing: check, fix, then save. A write made on an older version is merged onto the current one, and answers changed_by_others: the rows others changed since, so you catch up from those instead of reading again. WHEN SEVERAL AGENTS OR PEOPLE FILL ONE TABLE, divide it with claim rather than reading it to find empty rows: each claim hands you rows nobody else has; fill them and write only them with rows and tab on the version the claim answered, then claim again until none are left. Neither step needs a read of the table. A 3D (glb) workbook also comes back with a picture of the model, from the angles in views (or azimuth/elevation), so you can see what an edit did.

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": {
      "workbook": "<workbook>"
    },
    "name": "write_workbook"
  }
}

Input Schema

NameRequiredDescriptionDefault
tabNoWith `claim` or `rows`: the tab whose table it is, by id or name.
noteNoOne line on what changed.
rowsNoOnly some rows of one tab's table, as markdown rows (e.g. the rows a claim gave you, filled): each replaces the row with the same first cell, as the tab was at `base_version`, and others' rows are kept. Needs `tab`.
agentNoWith `claim`: your name as the Claims tab shows it, one per agent (e.g. agent3).
claimNoWhen several agents or people fill one table at once: take this many of its rows (1-50) that nobody has claimed and that still have an empty cell. They are written to the workbook's Claims tab under `agent` and come back as a table, with the version to write on; no one else is given them. Fill them and write the tab as usual. Answers with no rows when every row is taken. Needs `tab` and `agent`.
viewsNoFor a 3D (glb) workbook: the angles to picture the model from, up to 4. Default one three-quarter view (its own camera when it has one).
schemaNoThe whole new schema: a ```tables fence of JSON, and optionally a ```tla module.
sheetsNoThe tabs you change, add or remove; the others are kept. Tab ids come from read_workbook's `tabs`.
azimuthNoFor a 3D workbook: one picture from this angle round the model, in degrees from the front (90 is the right side). Instead of `views`.
documentNoThe new text of a one-tab workbook.
workbookYesThe workbook id.
elevationNoWith `azimuth`: degrees above the horizon (0 level, 89 from above).
from_fileNoAn uploaded file (/attachments/<workbook>/<name>, as create_workbook's or upload's link names it, or a drive path) made the workbook's next version through its file type's import — its first, or a revised file (a remodelled .glb, a new export of the spreadsheet) over earlier versions, which stay restorable. To revise a workbook from a new file: upload it to /attachments/<this workbook>/<name>, then this.
check_onlyNotrue to compile this edit and say what a save would be told, without saving.
image_widthNoFor a 3D workbook: the picture's width in pixels, 256 to 1024. Default 768.
base_versionNoThe version you read and changed.
restore_versionNoAn earlier version to make current again, as a new version.
base_schema_versionNoWith `schema`: the schema version you read; 0 where it had none.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changed
    • addedInput schema / properties / rows
      Added value: +{
      +  "description": "Only some rows of one tab's table, as markdown rows (e.g. the rows a claim gave you, filled): each replaces the row with the same first cell, as the tab was at `base_version`, and others' rows are kept. Needs `tab`.",
      +  "type": "string"
      +}
    • changedInput schema / properties / tab / description
      Previous value: -"With `claim`: the tab whose table is divided, by id or name."New value: +"With `claim` or `rows`: the tab whose table it is, by id or name."
  2. Changed2 schema fields changed
    • changedInput schema / properties / sheets / description
      Previous value: -"Every tab in its new order. Tab ids come from read_workbook's `tabs`."New value: +"The tabs you change, add or remove; the others are kept. Tab ids come from read_workbook's `tabs`."
    • addedInput schema / properties / sheets / items / properties / remove
      Added value: +{
      +  "description": "True removes the tab with this id.",
      +  "type": "boolean"
      +}
  3. Changed3 schema fields changed
    • addedInput schema / properties / agent
      Added value: +{
      +  "description": "With `claim`: your name as the Claims tab shows it, one per agent (e.g. agent3).",
      +  "type": "string"
      +}
    • addedInput schema / properties / claim
      Added value: +{
      +  "description": "When several agents or people fill one table at once: take this many of its rows (1-50) that nobody has claimed and that still have an empty cell. They are written to the workbook's Claims tab under `agent` and come back as a table, with the version to write on; no one else is given them. Fill them and write the tab as usual. Answers with no rows when every row is taken. Needs `tab` and `agent`.",
      +  "type": "integer"
      +}
    • addedInput schema / properties / tab
      Added value: +{
      +  "description": "With `claim`: the tab whose table is divided, by id or name.",
      +  "type": "string"
      +}
  4. Changed4 schema fields changed
    • addedInput schema / properties / azimuth
      Added value: +{
      +  "description": "For a 3D workbook: one picture from this angle round the model, in degrees from the front (90 is the right side). Instead of `views`.",
      +  "type": "number"
      +}
    • addedInput schema / properties / elevation
      Added value: +{
      +  "description": "With `azimuth`: degrees above the horizon (0 level, 89 from above).",
      +  "type": "number"
      +}
    • addedInput schema / properties / image_width
      Added value: +{
      +  "description": "For a 3D workbook: the picture's width in pixels, 256 to 1024. Default 768.",
      +  "type": "integer"
      +}
    • addedInput schema / properties / views
      Added value: +{
      +  "description": "For a 3D (glb) workbook: the angles to picture the model from, up to 4. Default one three-quarter view (its own camera when it has one).",
      +  "items": {
      +    "enum": [
      +      "iso",
      +      "front",
      +      "side",
      +      "back",
      +      "top"
      +    ],
      +    "type": "string"
      +  },
      +  "maxItems": 4,
      +  "type": "array"
      +}
  5. Changed1 schema field changed
    • changedInput schema / properties / from_file / description
      Previous value: -"For a workbook with no version yet: the uploaded file (/attachments/<workbook>/<name>, as create_workbook's upload names it, or a drive path) made its first version through its file type's import."New value: +"An uploaded file (/attachments/<workbook>/<name>, as create_workbook's or upload's link names it, or a drive path) made the workbook's next version through its file type's import — its first, or a revised file (a remodelled .glb, a new export of the spreadsheet) over earlier versions, which stay restorable. To revise a workbook from a new file: upload it to /attachments/<this workbook>/<name>, then this."
  6. Changed2 schema fields changed
    • addedInput schema / properties / check_only
      Added value: +{
      +  "description": "true to compile this edit and say what a save would be told, without saving.",
      +  "type": "boolean"
      +}
    • addedInput schema / properties / from_file
      Added value: +{
      +  "description": "For a workbook with no version yet: the uploaded file (/attachments/<workbook>/<name>, as create_workbook's upload names it, or a drive path) made its first version through its file type's import.",
      +  "type": "string"
      +}
  7. Changed7 schema fields changed
    • addedInput schema / properties / base_schema_version
      Added value: +{
      +  "description": "With `schema`: the schema version you read; 0 where it had none.",
      +  "type": "integer"
      +}
    • removedInput schema / properties / context
      Removed value: -{
      -  "description": "Explain in 15-25 words, in third person, why this tool is called and how it supports the user's goal. For analytics only. You MUST describe only the abstract purpose of the tool call. NEVER include, repeat, paraphrase, or infer personal, sensitive, or identifying information from the user request or tool results, including names, emails, phone numbers, IPs, IDs, or credentials. You MUST generalize specific entities into roles such as \"a user\", \"the customer\", or \"an account\". Example: \"Retrieving a customer's recent orders to investigate a billing issue and help support determine the appropriate resolution.\"",
      -  "type": "string"
      -}
    • removedInput schema / properties / llm_model
      Removed value: -{
      -  "description": "The exact model identifier you (the assistant) are running as, taken from your system prompt or environment (e.g. \"claude-opus-4-8\", \"gpt-5.2\"). Used for analytics only. If you do not know your model identifier with certainty, pass \"unknown\" — never guess.",
      -  "type": "string"
      -}
    • changedInput schema / properties / note / description
      Previous value: -"One line on what changed, e.g. 'Updated Q3 cash from the 10-Q'."New value: +"One line on what changed."
    • addedInput schema / properties / restore_version
      Added value: +{
      +  "description": "An earlier version to make current again, as a new version.",
      +  "type": "integer"
      +}
    • addedInput schema / properties / schema
      Added value: +{
      +  "description": "The whole new schema: a ```tables fence of JSON, and optionally a ```tla module.",
      +  "type": "string"
      +}
    • changedInput schema / required
      Previous value: -[
      -  "workbook",
      -  "base_version"
      -]New value: +[
      +  "workbook"
      +]
  8. Changed2 schema fields changed
    • addedInput schema / properties / context
      Added value: +{
      +  "description": "Explain in 15-25 words, in third person, why this tool is called and how it supports the user's goal. For analytics only. You MUST describe only the abstract purpose of the tool call. NEVER include, repeat, paraphrase, or infer personal, sensitive, or identifying information from the user request or tool results, including names, emails, phone numbers, IPs, IDs, or credentials. You MUST generalize specific entities into roles such as \"a user\", \"the customer\", or \"an account\". Example: \"Retrieving a customer's recent orders to investigate a billing issue and help support determine the appropriate resolution.\"",
      +  "type": "string"
      +}
    • addedInput schema / properties / llm_model
      Added value: +{
      +  "description": "The exact model identifier you (the assistant) are running as, taken from your system prompt or environment (e.g. \"claude-opus-4-8\", \"gpt-5.2\"). Used for analytics only. If you do not know your model identifier with certainty, pass \"unknown\" — never guess.",
      +  "type": "string"
      +}
  9. First observed

TDQS

A4.5/5.0
Behavior5/5

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

Annotations only declare destructiveHint=true and readOnlyHint=false; the description goes well beyond them by disclosing merge semantics ('merged onto the current one'), the changed_by_others return field, that failures are 'refused with each error's tab and line', that claims are exclusive reservations written to a Claims tab, and that glb workbooks return a rendered picture. These are non-obvious behaviors an agent could not infer from annotations or schema.

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 verb set and the three mode branches before the longer concurrency and glb paragraphs, so the scan path is good. It is dense with parentheticals and one all-caps clause ('WHEN SEVERAL AGENTS OR PEOPLE FILL ONE TABLE') that borders on shouting, but nearly every sentence carries actionable information.

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

Completeness4/5

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

For an 18-parameter destructive tool with no output schema, the description covers the risky paths: merge-on-stale-base, refusal on compile errors, claim exclusivity, and the from_file import workflow. Only minor parameters (note, image_width) and the exact shape of the claim result table are left unaddressed.

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 the baseline is 3, but the description adds cross-parameter workflow meaning the schema cannot: base_version is 'the version you read and changed', restore_version is used alone, schema pairs with base_schema_version, and from_file requires a prior upload to /attachments/<workbook>/<name>. Minor gaps remain for note and image_width, which the description never mentions.

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 opens with specific verbs and a resource: 'Saves, replaces, restores or re-rules a workbook directly, with no run.' It then enumerates the distinct modes (document/sheets save, restore_version, schema) so an agent can tell which invocation shape matches its intent without opening the schema.

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?

Guidance is unusually explicit: check_only for 'check, fix, then save', restore_version 'alone — no need to read first', and the claim-then-write loop for concurrent table filling with the instruction to claim again 'until none are left'. The one gap is sibling routing: a restore_workbook tool exists, yet the description never says why to use restore_version here versus that tool.

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.