Skip to main content
Glama
google-sheets-mcp
by ezrazhang7

Fill a formula across a range

fill_formula

Fill a whole range with one formula, adjusting relative references per cell like dragging the fill handle. Use it to apply calculations across rows or columns in Google Sheets.

Instructions

Write one formula into every cell of a range, with relative references adjusting per cell (like dragging the fill handle). For a formula in a single cell, update_cells works too.

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>",
      "formula": "<formula>"
    },
    "name": "fill_formula"
  }
}

Input Schema

NameRequiredDescriptionDefault
rangeYesA1 range to fill, e.g. "D2:D100"
sheetNoSheet (tab) name; defaults to the first sheet
formulaYesThe formula as written for the top-left cell of the range, e.g. "=B2*C2"
spreadsheetIdYesSpreadsheet ID or full Google Sheets URL

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.2.4

TDQS

A4.2/5.0
Behavior3/5

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

With no annotations at all, the description carries the full burden. It helpfully discloses the key behavioral trait that relative references adjust per cell like a fill handle, but says nothing about overwriting existing values, formula validation/errors, or authorization needs for a write operation.

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 tight sentences, zero filler, with the core behavior front-loaded and the alternative tucked into the second sentence.

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 a 4-parameter mutation tool with no annotations and no output schema, the description covers purpose, propagation behavior, and an alternative. Minor gaps around overwrite semantics and error handling remain but do not block correct invocation.

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, and the description goes beyond it by explaining how the range and formula interact: the formula is authored for the top-left cell and its relative references shift for each subsequent cell, which the schema only partially implies.

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 specific verb and resource ('Write one formula into every cell of a range') and immediately differentiates itself from the sibling update_cells, so an agent can pick it correctly without opening schemas.

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?

Explicitly routes single-cell formula writes to update_cells, giving clear when-to-use context. It does not spell out exclusions (e.g. non-contiguous ranges or multi-range fills), which keeps it just 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.