Skip to main content
Glama

set_cells

Writes values or formulas into individual spreadsheet cells while preserving styles and formats. Shows a dry run by default, then saves edits to a new .xlsx file.

Instructions

Write single cells, changing nothing else. DRY RUN BY DEFAULT: shows before/after for every cell and writes nothing; repeat with dry_run=false to save.

changes: list of {"cell": "B7", "value": ...} or {"cell": "B7", "formula": "SUM(B2:B6)"}, with an optional per-change "sheet". Value coercion rules:

  • a string starting with '=' is a FORMULA ("=SUM(A1:A3)")

  • a string starting with a single quote is literal TEXT with the quote removed ("'=not a formula" stores =not a formula; "'007" stores the text 007)

  • JSON numbers are numbers, true/false are booleans, null clears the cell

  • ISO strings 'YYYY-MM-DD' and 'YYYY-MM-DDTHH:MM[:SS]' become real dates (the cell keeps its date format, or gets yyyy-mm-dd); use a leading quote to keep such a string as text

  • any other string is text (never auto-converted to a number) Existing styles, number formats, validations, conditional formats and column widths are kept. Writes into merged-cell interiors and array formulas are refused. Formulas referring to a sheet that does not exist are refused.

The result goes to a NEW file '.edited.xlsx' next to the original unless output= is given; an existing file is never replaced unless overwrite=true (use overwrite=true with output equal to path to edit in place). If the workbook has features openpyxl would drop (see workbook_overview) the edit is refused unless allow_loss=true. All formulas lose their cached results on save (Excel recalculates when opened).

Input Schema

NameRequiredDescriptionDefault
pathYes
sheetYes
outputNo
changesYes
dry_runNo
overwriteNo
allow_lossNo

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.7/5.0
Behavior5/5

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

With no annotations supplied, the description carries the full behavioral burden and does so thoroughly: default dry run, writes go to a new '.edited.xlsx' file, overwrite and allow_loss gating, refusal on merged-cell interiors, array formulas, missing-sheet references and lossy-workbook features, plus the loss of cached formula results on save. These are exactly the side-effect and safety facts an agent needs before invoking a mutation.

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?

Front-loads the two highest-value facts (single-cell scope, dry-run-by-default) before the coercion detail, and the bulleted coercion list is easy to scan. It is dense but nearly every sentence carries a distinct rule; a minor amount of the quoting guidance could be tightened.

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 7-parameter mutation tool with no annotations, the description covers write targets, side effects, refusal conditions, output file behavior and value typing, and an output schema exists so return values need no further explanation. Nothing an agent needs in order to call this correctly is missing.

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

Parameters5/5

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

Schema description coverage is 0% across 7 parameters, so the description must compensate, and it does: it specifies the shape of each change object, the optional per-change "sheet" override, and detailed value-coercion rules for formula strings, quoted literals, numbers, booleans, nulls and ISO dates. It also clarifies output, overwrite, dry_run and allow_loss semantics, leaving only the obvious path/sheet names implicit.

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 concrete verb and resource ("Write single cells") and immediately bounds the scope with "changing nothing else", which implicitly contrasts with bulk-append siblings like append_rows. An agent can tell what this does and what it does not touch 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?

Gives explicit procedural guidance: the tool is a dry run by default and the agent must repeat with dry_run=false to actually save, and it explains when to use output= vs. overwrite=true with output equal to path. It does not explicitly name sibling alternatives (e.g. append_rows for row insertion), which keeps it short of a 5.

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