Skip to main content
Glama

Write cells

write_cells
Idempotent

Set values or formulas in specified Excel cells, overwriting existing content at those addresses.

Instructions

Set values or formulas in cells at given addresses, overwriting what is there.

To add new records below existing data without computing addresses use append_rows; to make room between rows use insert_rows.

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": {
      "sheet": "<sheet>",
      "cells": "<cells>"
    },
    "name": "write_cells"
  }
}

Input Schema

NameRequiredDescriptionDefault
pathNoFile path or preloaded name (list_configured_files). Omit if only one file is preloaded.
cellsYesCells to set: [{"cell": "A1", "value": 100}, {"cell": "B1", "formula": "=A1*2"}]. Existing content is overwritten.
sheetYesSheet name (case-sensitive).
backupNoSave a .bak copy first. Default: XLSX_MCP_AUTO_BACKUP (true).
reasonNoWhy; kept in the change log (XLSX_MCP_CHANGE_LOG=true).
recalculateNoRecompute formulas with LibreOffice after saving. False: faster, formula results stay empty.
allow_external_formulasNoAllow WEBSERVICE, HYPERLINK, INDIRECT, RTD, CALL, REGISTER and DDE ('|') in formulas.
create_sheet_if_missingNoCreate the sheet if missing.

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed8 schema fields changedv0.4.0
    • addedInput schema / properties / allow_external_formulas / description
      Added value: +"Allow WEBSERVICE, HYPERLINK, INDIRECT, RTD, CALL, REGISTER and DDE ('|') in formulas."
    • addedInput schema / properties / backup / description
      Added value: +"Save a .bak copy first. Default: XLSX_MCP_AUTO_BACKUP (true)."
    • addedInput schema / properties / cells / description
      Added value: +"Cells to set: [{\"cell\": \"A1\", \"value\": 100}, {\"cell\": \"B1\", \"formula\": \"=A1*2\"}]. Existing content is overwritten."
    • addedInput schema / properties / create_sheet_if_missing / description
      Added value: +"Create the sheet if missing."
    • addedInput schema / properties / path / description
      Added value: +"File path or preloaded name (list_configured_files). Omit if only one file is preloaded."
    • addedInput schema / properties / reason
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "string"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "description": "Why; kept in the change log (XLSX_MCP_CHANGE_LOG=true).",
      +  "title": "Reason"
      +}
    • addedInput schema / properties / recalculate / description
      Added value: +"Recompute formulas with LibreOffice after saving. False: faster, formula results stay empty."
    • addedInput schema / properties / sheet / description
      Added value: +"Sheet name (case-sensitive)."
  2. Changed2 schema fields changedv0.3.0
    • addedInput schema / properties / allow_external_formulas
      Added value: +{
      +  "default": false,
      +  "title": "Allow External Formulas",
      +  "type": "boolean"
      +}
    • addedInput schema / properties / backup
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "boolean"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "title": "Backup"
      +}
  3. First observedv0.1.0

TDQS

A4.4/5.0
Behavior4/5

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

Annotations only declare openWorldHint=false and idempotentHint=true, so the description's key contribution is disclosing that existing cell content is destroyed by the write. It does not discuss the backup, change-log, or recalculation behaviors, but those are documented in the schema rather than needing prose.

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

Conciseness5/5

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

Two sentences, zero filler, with the destructive overwrite behavior front-loaded before the sibling routing. Every clause earns its place.

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 8-parameter mutation tool with an output schema and full schema coverage, the definition covers purpose, destructive effect, and routing to the two adjacent tools. Remaining behavior (backup, change log, LibreOffice recalculation) lives in the schema, so nothing critical is missing, though a brief note on the auto-backup safety net would have completed it.

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

Parameters3/5

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

Schema description coverage is 100%, including the cells array format, backup default, reason/change-log, recalculate, and the external-formula security flag. The description adds no parameter-level meaning beyond the schema, so the baseline 3 applies.

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?

States a precise verb and resource ('Set values or formulas in cells at given addresses') plus the scope constraint of targeting explicit addresses. The overwrite clause further pins down the semantics, so an agent can distinguish it from append_rows/insert_rows without reading either schema.

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

Usage Guidelines5/5

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

Explicitly names two alternatives and the condition that selects each: append_rows for adding records without computing addresses, insert_rows for making room between rows. That leaves the implicit implication (use write_cells when you already know the target addresses) clear and actionable.

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