Skip to content

feat(sheets,calendar): add Sheets write tools and fix Calendar updateEvent to use patch#326

Open
tuannvm wants to merge 4 commits intogemini-cli-extensions:mainfrom
tuannvm:feat/sheets-write-tools
Open

feat(sheets,calendar): add Sheets write tools and fix Calendar updateEvent to use patch#326
tuannvm wants to merge 4 commits intogemini-cli-extensions:mainfrom
tuannvm:feat/sheets-write-tools

Conversation

@tuannvm
Copy link
Copy Markdown
Contributor

@tuannvm tuannvm commented Apr 7, 2026

Summary

Fixes #253 — Adds write tools to the Google Sheets service and fixes the Calendar updateEvent method to use events.patch (partial update) instead of events.update (full replacement).

Sheets Write Tools

Six new tools: sheets.updateRange, sheets.appendRange, sheets.clearRange, sheets.createSpreadsheet, sheets.addSheet, and sheets.deleteSheet. Upgrades the OAuth scope from spreadsheets.readonly to spreadsheets when enabled.

Calendar Fix

updateEvent now uses events.patch instead of events.update, preventing existing event fields (attendees, description, etc.) from being wiped when only updating specific fields.

Use Case

Sheets — write data:

  1. sheets.updateRange with spreadsheetId, range: "Sheet1!A1:B2", and values: [["Name", "Score"], ["Alice", 95]]
  2. sheets.appendRange to add rows after the last data row

Sheets — manage structure:

  1. sheets.createSpreadsheet with title and optional sheetTitles
  2. sheets.addSheet / sheets.deleteSheet to manage tabs

Calendar — safe partial updates:

  1. calendar.updateEvent with eventId and only the fields to change — other fields are preserved

Enabling Sheets Write Tools

Write tools are disabled by default (consistent with slides.write, tasks.read, tasks.write). To enable:

export WORKSPACE_FEATURE_OVERRIDES="sheets.write:on"

This adds the spreadsheets scope to the OAuth flow and registers all 6 write tools. See Feature Configuration for details.

Changes

  • SheetsService.ts: Added updateRange, appendRange, clearRange, createSpreadsheet, addSheet, and deleteSheet methods
  • CalendarService.ts: Changed updateEvent to use events.patch instead of events.update for partial update semantics
  • index.ts: Registered 6 new Sheets write tools with Zod input schemas, using registerTool helper
  • feature-config.ts: Populated sheets.write feature group with tool names (defaultEnabled: false)
  • feature-config.test.ts: Verified sheets.write remains in the off-by-default group
  • SheetsService.test.ts: Added tests covering happy paths, options, and error handling for all write operations
  • CalendarService.test.ts: Updated tests to use events.patch mock

Testing

All 107 relevant tests pass (CalendarService, SheetsService, feature-config).

tuannvm added 2 commits March 2, 2026 11:15
Signed-off-by: Tommy Nguyen <tuannvm@hotmail.com>
Signed-off-by: Tommy Nguyen <tuannvm@hotmail.com>
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request significantly expands the Google Workspace integration by adding comprehensive Google Sheets management capabilities and enhancing Google Calendar event handling. New Sheets tools include updating, appending, and clearing ranges, as well as creating spreadsheets and managing individual sheets. The Google Sheets API scope has been updated to allow write access. For Google Calendar, the service now supports adding Google Meet links and file attachments during event creation and updates. A critical improvement was identified regarding the use of the update method in the Calendar service, which performs a full resource replacement and may inadvertently delete existing event data; switching to a patch operation is recommended to ensure partial updates.

tuannvm added 2 commits April 7, 2026 08:29
Signed-off-by: Tommy Nguyen <tuannvm@hotmail.com>

# Conflicts:
#	workspace-server/src/__tests__/services/CalendarService.test.ts
#	workspace-server/src/index.ts
#	workspace-server/src/services/CalendarService.ts
#	workspace-server/src/services/SheetsService.ts
…y default

Signed-off-by: Tommy Nguyen <tuannvm@hotmail.com>
@tuannvm tuannvm marked this pull request as ready for review April 7, 2026 15:52
@tuannvm tuannvm changed the title Feat/sheets write tools feat(sheets,calendar): add Sheets write tools and fix Calendar updateEvent to use patch Apr 7, 2026
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.

OAuth scope upgrade needed: spreadsheets.readonly → spreadsheets for write tools

1 participant