Skip to content

fix(google-calendar): align with live API docs, add calendar/ACL update+delete tools#5485

Merged
waleedlatif1 merged 2 commits into
stagingfrom
validate/google-calendar-integration
Jul 7, 2026
Merged

fix(google-calendar): align with live API docs, add calendar/ACL update+delete tools#5485
waleedlatif1 merged 2 commits into
stagingfrom
validate/google-calendar-integration

Conversation

@waleedlatif1

Copy link
Copy Markdown
Collaborator

Summary

  • Validated the full Google Calendar integration against the live Google Calendar API v3 reference docs
  • Removed any types from V2 response typing in get.ts, move.ts, quick_add.ts, instances.ts — now use concrete GoogleCalendarApiEventResponse field types
  • Added google_calendar_update_calendar (PATCH /calendars/{id}) — was missing, could create/share calendars but not update one
  • Added google_calendar_delete_calendar (DELETE /calendars/{id}) — was missing
  • Added google_calendar_update_acl (PATCH /calendars/{id}/acl/{ruleId}) — could share/list/remove ACL rules but not change an existing rule's role without delete+recreate
  • All new tools use only the existing https://www.googleapis.com/auth/calendar OAuth scope — no new scopes requested
  • Wired new tools into the block (operation dropdown, subBlocks, tools.access, tools.config), tools/registry.ts (alphabetical), and index.ts exports

Type of Change

  • Bug fix
  • New feature (non-breaking)

Testing

Tested manually. Ran multiple independent verification passes:

  • All 19 tool files (v1 + v2) cross-checked against live Google Calendar API v3 docs (events, calendars, calendarList, acl, freebusy) — endpoints, methods, params, request/response shapes all confirmed correct
  • Backwards-compatibility audit — confirmed no pre-existing tool ID, param, or output field was renamed/removed; all changes are additive or type-only tightening
  • Block wiring audit — confirmed every tool has correct subBlock gating, tools.access, tools.config.tool/params mapping, BlockMeta templates/skills, registry entries
  • OAuth scope audit — confirmed all tools (existing + new) are covered by the currently configured scope, no scope expansion needed
  • bun run lint and tsc --noEmit both clean

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

…te+delete tools

- remove any types from V2 response typing in get/move/quick_add/instances
- add google_calendar_update_calendar (PATCH calendars.patch)
- add google_calendar_delete_calendar (DELETE calendars.delete)
- add google_calendar_update_acl (PATCH acl.patch)
- all new tools covered by existing calendar OAuth scope, no new scopes requested
@vercel

vercel Bot commented Jul 7, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
docs Skipped Skipped Jul 7, 2026 6:46pm

Request Review

@cursor

cursor Bot commented Jul 7, 2026

Copy link
Copy Markdown

PR Summary

Medium Risk
New destructive delete-calendar and ACL role-change paths run on user OAuth tokens; changes are additive with no new scopes, but misconfigured workflows could delete calendars or alter sharing.

Overview
Extends the Google Calendar block and tools with Update Calendar, Delete Calendar, and Update Sharing operations, each backed by new v1/v2 tool implementations (PATCH /calendars/{id}, DELETE /calendars/{id}, PATCH /calendars/{id}/acl/{ruleId}) and registered in the tool index and registry.

The block gains matching operation dropdown entries, conditional sub-blocks (calendar metadata for updates, shared role/notification/rule fields for ACL updates), tool routing, and v2 output for deleted calendarId. sendNotifications boolean coercion now applies to both share and update ACL operations.

Several existing v2 event tools (get, move, quick_add, instances) replace loose any typings with GoogleCalendarApiEventResponse field types; GoogleCalendarAclRole is exported for the new ACL update tool.

Reviewed by Cursor Bugbot for commit ee6cbf8. Configure here.

@greptile-apps

greptile-apps Bot commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR extends the Google Calendar integration with three new tools — update_calendar (PATCH), delete_calendar (DELETE), and update_acl (PATCH) — filling genuine API gaps. It also tightens V2 response typings across get.ts, move.ts, quick_add.ts, and instances.ts by replacing any with concrete GoogleCalendarApiEventResponse field references.

  • New tools (update_calendar, delete_calendar, update_acl) are consistently wired through the block operations dropdown, tools.access/config, the index exports, and the global tool registry; the V2 block inherits the same subBlocks via spread and uses createVersionedToolSelector to auto-generate the _v2 IDs.
  • Type improvements in four existing V2 response interfaces replace all any fields with typed references to GoogleCalendarApiEventResponse, improving type safety without changing runtime behavior.
  • GoogleCalendarAclRole is exported from types.ts so update_acl.ts can import it instead of re-declaring (resolved from a prior review thread).

Confidence Score: 5/5

Safe to merge — the three new tools are fully wired through the block, registry, and exports, and follow the same patterns as the existing Google Calendar tools.

All new tools consistently mirror the established patterns of existing tools (e.g., share_calendar.ts for PATCH+ACL, create_calendar.ts for calendar management). Block wiring — dropdown options, subBlock conditions, tools.access, config.tool switch, config.params coercion — is complete for all three operations in both V1 and V2 blocks. The V2 block correctly inherits V1 subBlocks via spread and generates versioned tool IDs automatically. Type improvements in the four modified files replace any with concrete indexed-access types without touching runtime logic.

No files require special attention.

Important Files Changed

Filename Overview
apps/sim/tools/google_calendar/delete_calendar.ts New tool for DELETE /calendars/{id}; correctly handles 204 No Content response and error fallback; both v1 and v2 variants implemented consistently.
apps/sim/tools/google_calendar/update_acl.ts New tool for PATCH /calendars/{id}/acl/{ruleId}; follows the same transformResponse pattern as share_calendar.ts; imports GoogleCalendarAclRole from types.ts after previous review fix.
apps/sim/tools/google_calendar/update_calendar.ts New tool for PATCH /calendars/{id}; builds partial body correctly to only include provided fields; v2 variant returns API-aligned flat fields.
apps/sim/blocks/blocks/google_calendar.ts Wires three new operations into V1 block (dropdown, subBlocks, tools.access, config.tool switch, sendNotifications coercion); V2 block inherits subBlocks via spread and uses createVersionedToolSelector, so no duplicate wiring needed.
apps/sim/tools/google_calendar/types.ts Exports GoogleCalendarAclRole so update_acl.ts can import it; no other changes.
apps/sim/tools/google_calendar/get.ts Replaces five any fields in GoogleCalendarGetV2Response with concrete GoogleCalendarApiEventResponse indexed-access types.
apps/sim/tools/google_calendar/quick_add.ts Removes any from V2 response interface and casts API responses to GoogleCalendarApiEventResponse; also tightens optional fields to non-optional with null union.
apps/sim/tools/google_calendar/instances.ts Replaces Record<string, any>[] with a concrete GoogleCalendarInstancesV2Instance type that mirrors the API shape.
apps/sim/tools/google_calendar/move.ts Replaces five any fields in V2 response with indexed-access types from GoogleCalendarApiEventResponse, consistent with get.ts changes.
apps/sim/tools/google_calendar/index.ts Adds imports and named exports for the six new tool variants (v1 and v2 for each of the three new tools).
apps/sim/tools/registry.ts Registers all six new tool variants in alphabetical order within the tools record.

Sequence Diagram

%%{init: {'theme': 'neutral'}}%%
sequenceDiagram
    participant UI as Block UI
    participant Block as google_calendar.ts
    participant Registry as tools/registry.ts
    participant Tool as Tool (v1/v2)
    participant GCal as Google Calendar API v3

    UI->>Block: Select operation (update_calendar / delete_calendar / update_acl)
    Block->>Block: config.tool() → tool ID
    Block->>Block: config.params() → coerce calendarId, sendNotifications
    Block->>Registry: Resolve ToolConfig by ID
    Registry->>Tool: updateCalendarTool / deleteCalendarTool / updateAclTool

    alt Update Calendar
        Tool->>GCal: "PATCH /calendars/{calendarId} {summary, description, location, timeZone}"
        GCal-->>Tool: 200 OK + Calendar resource
        Tool-->>Block: "{ id, summary, description, location, timeZone }"
    end

    alt Delete Calendar
        Tool->>GCal: "DELETE /calendars/{calendarId}"
        GCal-->>Tool: 204 No Content
        Tool-->>Block: "{ calendarId, deleted: true }"
    end

    alt Update ACL
        Tool->>GCal: "PATCH /calendars/{calendarId}/acl/{ruleId}?sendNotifications={bool} { role }"
        GCal-->>Tool: 200 OK + AclRule resource
        Tool-->>Block: "{ id, role, scope }"
    end
Loading
%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%%
sequenceDiagram
    participant UI as Block UI
    participant Block as google_calendar.ts
    participant Registry as tools/registry.ts
    participant Tool as Tool (v1/v2)
    participant GCal as Google Calendar API v3

    UI->>Block: Select operation (update_calendar / delete_calendar / update_acl)
    Block->>Block: config.tool() → tool ID
    Block->>Block: config.params() → coerce calendarId, sendNotifications
    Block->>Registry: Resolve ToolConfig by ID
    Registry->>Tool: updateCalendarTool / deleteCalendarTool / updateAclTool

    alt Update Calendar
        Tool->>GCal: "PATCH /calendars/{calendarId} {summary, description, location, timeZone}"
        GCal-->>Tool: 200 OK + Calendar resource
        Tool-->>Block: "{ id, summary, description, location, timeZone }"
    end

    alt Delete Calendar
        Tool->>GCal: "DELETE /calendars/{calendarId}"
        GCal-->>Tool: 204 No Content
        Tool-->>Block: "{ calendarId, deleted: true }"
    end

    alt Update ACL
        Tool->>GCal: "PATCH /calendars/{calendarId}/acl/{ruleId}?sendNotifications={bool} { role }"
        GCal-->>Tool: 200 OK + AclRule resource
        Tool-->>Block: "{ id, role, scope }"
    end
Loading

Reviews (3): Last reviewed commit: "fix(google-calendar): dedupe GoogleCalen..." | Re-trigger Greptile

Comment thread apps/sim/tools/google_calendar/update_acl.ts Outdated
export it from types.ts and import instead of redeclaring locally
@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@greptile review

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@cursor review

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit ee6cbf8. Configure here.

@waleedlatif1 waleedlatif1 merged commit 82de725 into staging Jul 7, 2026
18 checks passed
@waleedlatif1 waleedlatif1 deleted the validate/google-calendar-integration branch July 7, 2026 19:10
@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@greptile review

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.

1 participant