Skip to main content
Glama

Change a sheet

edit_sheet

Changes a sheet, read at "base": the version (v N) your last get, read or changes showed. Addresses, rows and headers mean what they meant at that version, wherever they moved since; so do chart and format numbers (#N, by order in the outline; a chart an earlier op here makes takes the next number) and sheet names (after a rename by an earlier op, either works). Every op applies, or none: a cell someone changed since is refused, naming who, so read again and apply on the new version. Answers each cell old → new, results that changed, and the new version. "dryRun" answers the same without saving; "undo" takes back a change of yours.

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": {
      "doc": "<doc>"
    },
    "name": "edit_sheet"
  }
}

Input Schema

NameRequiredDescriptionDefault
docYesThe doc's link or its code.
keyNoA retry key, up to 64 characters. Default: one made from the request, so the same request on the same version applies once.
opsNoChanges, applied in order; "sheet" can be left out when there's one. Each is one of: {"set": "Tasks!E17", "value": "Done"} · {"set": "Tasks!B2:C3", "values": [["Tile grout", "Kitchen"], ["Vent cover", "Bathrooms"]]} (the sheet grows past its edge) {"update": {"sheet": "Tasks", "where": "Area = Kitchen and Status = Open", "set": {"Status": "Done"}, "max": 50}} (rows matching at base, by header; max is 1 unless set, and more matches are refused) {"append": {"sheet": "Tasks", "rows": [{"ID": "T-214", "Item": "Gutter downspout", "Status": "Open"}]}} (after the last filled row, by header; column formulas carry down unless you give a value) {"insertRows": {"sheet": "Tasks", "after": 40, "count": 2}} (0: the top) · {"deleteRows": {"sheet": "Tasks", "rows": "9, 41:42"}} · {"moveRows": {"sheet": "Tasks", "rows": "5:6", "after": 10}} {"insertCols": {"sheet": "Tasks", "after": "C", "count": 1}} ("": before A) · {"deleteCols": {"sheet": "Tasks", "cols": "D:E"}} · {"moveCols": {"sheet": "Tasks", "cols": "F", "after": "B"}} {"format": {"range": "Tasks!1:1", "bold": true, "fill": "#fff2cc"}} (cells, rows or columns; null clears. bold italic underline strike wrap · size in points · font · color fill "#rrggbb" · hAlign left center right justify · vAlign top middle bottom · indent · borderTop/Right/Bottom/Left "thin #d0d5dd" (thin medium thick dashed dotted double) · numFmt as Excel's, "$#,##0.00") {"resize": {"range": "Tasks!B:C", "size": 120}} (points or "auto"; "hidden": true) · {"merge": "Tasks!A1:G1"} · {"unmerge": "Tasks!A1:G1"} {"copy": {"from": "Tasks!A2:C9", "to": "Tasks!F2"}} (a paste: references move, formats come; "to" a first cell or a range to repeat over; "paste": "values", "formats", "formulas" or "widths"; "transpose": true; copies cells as before this edit) {"addSheet": {"name": "Hours", "after": "Tasks"}} · {"renameSheet": {"sheet": "Hours", "name": "Time"}} · {"moveSheet": {"sheet": "Time", "first": true}} · {"deleteSheet": "Old"} · {"sheetProps": {"frozenRows": 1, "frozenCols": 0, "hidden": false, "tabColor": "#4472c4"}} {"setName": {"name": "Rate", "range": "Summary!B2"}} · {"deleteName": "Rate"} {"addTable": {"range": "Tasks!A1:G40", "name": "Tasks"}} (header and banded rows) · {"setTable": {"table": "Tasks", "range": "Tasks!A1:G60", "totals": true}} · {"deleteTable": "Tasks"} (cells stay) {"validate": {"range": "Tasks!E2:E", "list": ["Open", "In progress", "Done"], "reject": true, "help": "Pick a status"}} (E2:E: row 2 down, later rows too; reject refuses others, else marks them) · one kind: "list", "from": "Lists!A2:A20", "checkbox": true, "number": {"between": [0, 100]} ("equal to", "not equal to", "greater than", "at least", "less than", "at most", "not between"), "date": {"after": "2026-01-01"} ("before", "on or after", "on or before", "on", "not on", "between"; true: any), "text": {"contains": "x"} ("not contains", "exactly"), "email": true, "url": true, "length": {"at most": 50}, "formula": "=F2<G2" · a dropdown (list or from): "colors": {"Done": "green", "Blocked": "#f6d3d0"} (chips: grey, red, orange, yellow, green, teal, blue, purple, pink, brown, or "#rrggbb"), "show": "chip" (default), "arrow" (text with ▾) or "plain" · "remove": true {"conditional": {"range": "Tasks!E2:E", "text is": "Blocked", "format": {"fill": "#f6d3d0", "bold": true}}} (the outline lists rules as format #N; the first that matches wins; new go last) · one condition: "empty", "not empty": true, "text contains", "text not contains", "text starts with", "text ends with", "text is": "x", "date is", "date before", "date after": "today", "yesterday", "past week", "past month", "past year" or a date, "number": {"greater than": 8} (validate's words), "formula": "=$F2<TODAY()", "scale": {"min": "#ffffff", "mid": "#ffd666", "max": "#57bb8a"} (no format), "duplicate", "unique": true, "top", "bottom": 10 or "10%", "above average", "below average": true · format: bold italic underline strike color fill · "before": 2 or "first": true places it · {"conditional": {"rule": 3, "first": true}} moves or, with fields, changes rule 3 · "remove": true with a rule or a range {"replace": {"find": "Lee", "with": "Priya", "in": "Owner"}} (one change; "in" a column by header or letter, or a range; left out, the sheet) · "case", "whole", "regex" (RE2, $1), "formulas": true searches formula text · the answer says what was left and why {"chart": {"range": "Tasks!A1:C40", "type": "column", "title": "Costs by area"}} (chart #N in the outline; first row names series, first column labels points) · "header", "labels": true or false, guessed when left out · type: column, bar, line, area, pie, donut, scatter (first column x), "stacked column", "stacked bar", "stacked area", "doughnut", "horizontal bar" · "stacked": true for column, bar, area · "at": "E2", "below", "beside", "below chart #2", "beside chart #2" (default: beside the range, over nothing) · "width", "height" px · "x title", "y title" · "legend": right, bottom, top, none · "colors": ["#4285f4", null] · {"chart": {"chart": 2, "type": "line"}} changes it · {"chart": {"chart": 2, "remove": true}} Values: a number, true or false, null (empty), a string ("=…" a formula: "=SUM(F2:F40)", "=[@Hours]*85", "=Tasks[Hours]"), {"text": "=shown as typed"}, {"date": "2026-10-19"}, {"text": "Quote", "link": "https://…"} (or "mailto:…", "#Costs!A1:C9"). Formulas spill as in Excel ("=FILTER(A2:D40,D2:D40=\"Open\")", "=SORT(B2#)"); #SPILL! when blocked.
baseNoThe version you read: v N in the answer.
noteNoWhy, in a few words. Shown with the change in the sheet and in changes.
undoNoUndo your own change that made this version, as one change. Goes alone: no base, ops or expect.
dryRunNoWork it out and answer, saving nothing.
expectNoCells that must hold these values before the ops, as at base, or nothing applies: {"Tasks!E17": "Open"}. Not what the ops should make: the answer shows that.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4/5.0
Behavior4/5

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

Beyond the annotations, it discloses a lot that matters operationally: all-or-nothing application ("Every op applies, or none"), optimistic concurrency with named conflicting editors, stable address semantics across moves/renames/chart numbering, and a described response shape ("each cell old → new, results that changed, and the new version"). The one tension is that it advertises `deleteSheet`, `deleteRows`, `deleteCols` and `deleteTable` while `destructiveHint` is false, but the versioned/undoable model partly justifies that annotation, so it reads as a nuance rather than a flat contradiction.

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

Conciseness3/5

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

It is appropriately short and front-loads the purpose, but the prose is compressed into clause-heavy parentheticals ("the version (v N) your last get, read or changes showed") that take real effort to parse. The information earns its place; the sentence construction makes it harder to absorb than necessary.

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 an 8-parameter nested-op mutation tool with no output schema, the description covers what an agent needs: versioning contract, atomicity, conflict handling, dry-run semantics, undo, and the shape of the answer. Nothing essential about calling it correctly is missing.

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 genuinely adds meaning the schema does not: `base` is what makes addresses, headers, chart numbers and sheet names resolve consistently, and `undo` is constrained to "goes alone: no base, ops or expect." `note` and `key` are left mostly to their schema text, keeping this below a 5.

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

Purpose4/5

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

The opening clause "Changes a sheet" gives a clear verb plus resource, and the rest of the sentence sharpens scope by pinning the edit to a specific read version ("read at 'base': the version (v N) your last get, read or changes showed"). An agent can tell this is the mutation counterpart to `read`/`get`/`changes`, though the description never explicitly contrasts itself with adjacent editing siblings such as `edit_doc` or `apply`.

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?

It establishes the prerequisite (work from a version returned by get/read/changes) and gives a concrete recovery path when the assumption breaks: "a cell someone changed since is refused, naming who, so read again and apply on the new version." It also routes preview and revert behavior to `dryRun` and `undo`. It stops short of explicit when-not-to-use guidance or naming an alternative tool for a different editing surface.

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.

Resources