Skip to content

feat: add readCellFormat, copyFormatting, and batchWrite tools #69

@a-pedraza

Description

@a-pedraza

Description

Three new tools for advanced spreadsheet operations:

  • readCellFormat — Reads cell formatting (bold, italic, font size, colors, alignment, borders) from a given range. Returns only cells with explicit formatting applied.
  • copyFormatting — Copies formatting (not values) from a source range to a destination range within the same spreadsheet. Useful for replicating header styles, conditional formatting patterns, etc.
  • batchWrite — Writes data to multiple non-contiguous ranges in a single API call, reducing round-trips when updating several parts of a spreadsheet at once.

Motivation

  • readCellFormat fills a gap: there's currently no way to inspect cell formatting programmatically through the MCP tools
  • copyFormatting enables format replication without manually reading and applying styles
  • batchWrite improves efficiency when updating multiple ranges (common in dashboards and report generation)

Implementation Details

  • readCellFormat uses spreadsheets.get() with includeGridData: true
  • copyFormatting uses spreadsheets.batchUpdate with CopyPasteRequest and pasteType: PASTE_FORMAT
  • batchWrite uses spreadsheets.values.batchUpdate()
  • Exports 4 previously private helper functions from googleSheetsApiHelpers.ts: parseRange, resolveSheetId, colLettersToIndex, parseA1ToGridRange (no signature changes — existing internal callers unaffected)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions