Skip to main content
Glama

formatCells

Applies bold, font size, colors, alignment, and number formats to a bounded Google Sheets range, including clearing date formats by setting type to TEXT.

Instructions

Applies formatting to a range of cells in a spreadsheet. Supports bold, italic, font size, text color, background color, alignment, and number format. Modern runtimes require a bounded readCellFormat handle for the exact overwritten range. Use a bounded range such as 'A1:D1' for header cells. Direct legacy callers retain whole-row and whole-column formatting through the tracker fallback. Use numberFormat to control how values are displayed (e.g. as numbers, text, dates) or to clear a format by setting type to 'TEXT'.

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": {
      "spreadsheetId": "<spreadsheetId>",
      "range": "<range>"
    },
    "name": "formatCells"
  }
}

Input Schema

NameRequiredDescriptionDefault
boldNoApply bold text formatting.
rangeYesBounded A1 range to format, such as "Sheet1!A1:D1" or "B2:E10". Modern calls require a matching readCellFormat handle; unbounded rows/columns remain available only to direct legacy callers.
italicNoApply italic text formatting.
fontSizeNoFont size in points.
readHandleNoCapability returned by the corresponding read tool. Required on the modern MCP runtime, including modern stdio.
numberFormatNoControls how cell values are displayed. Useful for clearing date formatting (set type to "TEXT") or applying a custom number pattern.
spreadsheetIdYesThe spreadsheet ID — the long string between /d/ and /edit in a Google Sheets URL.
backgroundColorNoCell background color as hex (e.g., "#D9EAD3").
foregroundColorNoText color as hex (e.g., "#FF0000").
horizontalAlignmentNoHorizontal text alignment.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv4.0.0-rc.1

TDQS

A4/5.0
Behavior4/5

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

With no annotations supplied, the description discloses two non-obvious behavioral facts: the operation overwrites an exact range and modern runtimes require a matching readCellFormat capability handle, with a legacy whole-row/column path only for direct callers. It still does not say whether unspecified formatting properties are merged or reset, nor what permissions are needed, which are the remaining behavioral gaps for a mutation tool.

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 core purpose is front-loaded in the first sentence and the sentence count is low. However, the closing numberFormat sentence duplicates the schema almost verbatim and the readHandle/legacy-caller material is stated twice across the description and schema property text.

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

Completeness3/5

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

For a 10-parameter mutation tool with no annotations and no output schema, the description covers the runtime prerequisite and display-format semantics well. It omits the two things an agent most needs to invoke it safely: whether only the supplied properties change versus all formatting being reset, and whether any confirmation of applied formatting is returned.

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%, so every parameter including the nested numberFormat object is already documented. The description's notes on numberFormat largely restate the schema text rather than adding new meaning beyond it, so the baseline of 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?

The definition opens with a specific verb and resource ("Applies formatting to a range of cells in a spreadsheet") and enumerates the formatting dimensions it controls, which cleanly separates it from the slide-formatting siblings (formatSlidesText, formatSlidesParagraph) and names readCellFormat as its counterpart.

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 gives actionable conditions: use a bounded range like 'A1:D1' for header cells, supply a readHandle on modern runtimes, and use numberFormat with type 'TEXT' to clear date/number formatting. It never explicitly routes an agent away from alternatives such as copyFormatting or addConditionalFormatting, so it stops short of full when-not guidance.

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

Deploy Server

Other Tools