Skip to content

feat(sheets): add sheets.batchUpdate tool for formatting and structural edits - #449

Open
tmack8001 wants to merge 1 commit into
gemini-cli-extensions:mainfrom
tmack8001:feat/sheets-batchupdate
Open

tmack8001 wants to merge 1 commit into
gemini-cli-extensions:mainfrom
tmack8001:feat/sheets-batchupdate

Conversation

@tmack8001

@tmack8001 tmack8001 commented Oct 23, 2026 •

Copy link
Copy Markdown

Closes #450

Summary

Adds a general-purpose sheets.batchUpdate tool to the Sheets service. This is the missing write primitive for everything beyond cell values: cell and text formatting (bold, colors, number formats, borders), column widths, text wrapping, frozen rows, conditional formatting, merges, and sheet properties.

Today the sheets service only exposes read tools (getText, getRange, getMetadata), and the sheets.write feature group is empty and defaultEnabled: false. There is no way to apply formatting — the Sheets spreadsheets.batchUpdate endpoint is only used internally. This PR exposes it as a tool.

What changed

  • SheetsService.batchUpdate — accepts a requests JSON string, parses and validates it is a Request[], and calls spreadsheets.batchUpdate. Returns { spreadsheetId, repliesCount }, mirroring the error/return shape of the existing service methods.
  • index.ts — registers sheets.batchUpdate as a write tool (no readOnlyToolProps) with a schema that documents the Google Request shape and a worked bold example.
  • feature-config.ts — adds sheets.batchUpdate to the sheets.write group and sets defaultEnabled: true, consistent with the other write groups (docs/drive/calendar/chat). The spreadsheets scope was already declared on the group.
  • Tests — updates the two tests that asserted the old sheets.write = OFF defaults, and adds SheetsService.batchUpdate coverage (success, invalid-JSON, non-array, API error).

Design notes

  • A single passthrough tool (JSON requests string) was chosen over many narrow formatting tools to keep the surface small while covering the whole batchUpdate schema — matching the precedent set by slides.updateShapeProperties, which takes a JSON ShapeProperties string plus a field mask.
  • extractDocId is applied so a spreadsheet URL or bare ID both work, as with the other Sheets tools.

Testing

Run from the repo root:

npm run lint
npm run format:check
npx tsc --noEmit --project workspace-server
npm run test:ci
npm run build

All pass locally (625 tests, including 4 new batchUpdate tests). Lint, format, typecheck, and build are clean.

…al edits

Adds a general-purpose sheets.batchUpdate tool that passes an array of
Google Sheets Request objects to spreadsheets.batchUpdate, enabling cell
and text formatting (bold, colors, number formats, borders), column
widths, wrapping, frozen rows, conditional formatting, merges, and sheet
properties -- none of which the values-based tools can express.

The sheets.write feature group was previously empty and default-OFF; it
now contains sheets.batchUpdate and is default-ON, consistent with the
other write groups (docs/drive/calendar/chat). Updates the two tests that
asserted the old sheets.write=OFF defaults and adds SheetsService
batchUpdate tests (success, invalid-JSON, non-array, API error).

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(sheets): expose spreadsheets.batchUpdate for formatting and structural edits

2 participants