Skip to main content
Glama

Format a Google spreadsheet

google_sheets_format
Idempotent

Format Google Sheets cells, rows, columns, and tabs using ordered batch operations that apply all-or-none and never change cell values.

Instructions

Format a Google spreadsheet's cells, rows, columns and tabs, by spreadsheet (its id or URL): 1 to 100 operations that apply in order as one batch, so all of them land or none does. It never changes a cell's value and never removes anything; applying the same operations again leaves the same result. Each operation is an object with op and its arguments, and the ranges of an operation are A1 notation in range or ranges (a block, whole rows 3:5, whole columns B:D, or a tab's name for all of it). format sets only the properties given on cells (bold, italic, underline, strikethrough, font, font_size, color, background as #rrggbb or null to clear, horizontal_align, vertical_align, wrap, number_format as { type, pattern }, rotation, padding), and reset: true clears every format first. borders draws sides (top, bottom, left, right, inner_horizontal, inner_vertical, all, outer, inner, or none to remove them) with a style and color. size sets the pixels of whole rows or columns, or fits them to their contents with auto: true; hide and unhide act on whole rows or columns; group (optionally collapsed) and ungroup do the same for outline groups, where a span that already is a group is not grouped again and a span that is not a group cannot be ungrouped; unmerge splits merged cells. freeze sets how many rows and columns of a tab stay in view; tab sets a tab's color, hidden, position (from 0) and gridlines, never its title. Any other operation is refused. Read the current formatting with google_sheets_read method format. A call names at most 500 ranges in all. It is asked about every time. account is needed when several accounts are set up.

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": {
      "spreadsheet": "<spreadsheet>",
      "operations": "<operations>"
    },
    "name": "google_sheets_format"
  }
}

Input Schema

NameRequiredDescriptionDefault
accountNoThe account's label. Left out, the only account is used; with several accounts, the call fails and lists them.
operationsYes1 to 100 operations, each an object with an `op` (format, borders, size, hide, unhide, group, ungroup, unmerge, freeze, tab) and that operation's arguments; they apply in order, and all of them land or none does.
spreadsheetYesThe spreadsheet's id, or its URL (https://docs.google.com/spreadsheets/d/<id>/…).

Output Schema

NameRequiredDescriptionDefault
tabsYesThe titles of the tabs that were changed, left to right.
appliedYesOne line per operation, in order, with its ranges as Google resolves them: what was applied.
requestsYesHow many requests the operations made up in the one batch.
spreadsheet_idYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.9/5.0
Behavior5/5

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

Beyond the annotations, the description discloses atomic batch behavior, idempotence, no value changes, no removals, reset behavior, grouping constraints, unmerge behavior, freeze semantics, tab metadata behavior, and a 500-range limit. These details materially improve correct invocation and align with the annotations rather than contradicting them.

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?

The description is front-loaded with purpose and batch semantics, and nearly every sentence carries operational information. It is long and dense, with one unclear phrase ('It is asked about every time') that slightly weakens clarity, but the complexity of the operation union justifies most of its length.

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?

Given a complex ten-operation batch tool, the description covers the operation types, range notation, atomicity, idempotence, limits, and account selection. An output schema exists, so the description does not need to explain return values, and nothing essential for calling the tool correctly appears 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?

Although schema description coverage is already 100%, the description adds substantial semantics beyond the schema: operations apply in order as one batch, A1 range forms are explained, each op's effect is summarized, format only sets given properties, reset clears first, and unsupported operations are refused. This is well beyond the baseline for fully documented schemas.

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 a specific verb and resource: formatting a spreadsheet's cells, rows, columns and tabs by spreadsheet id or URL. It clearly scopes the tool to formatting only and distinguishes it from reading formatting via google_sheets_read method format.

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?

It explicitly directs agents to google_sheets_read method format to read current formatting, and states that this tool never changes a cell's value and never removes anything, which effectively routes value edits and deletions elsewhere. The operation list also tells agents which formatting actions belong here.

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