AgentSkillsCN

googlecalendar

以恰当的时区处理,管理 Google Calendar 日程。在安排、更新或修补日程事件时,可灵活运用此方法。触发条件包括:“安排会议”、“更新事件”、“更改会议时间”、“重新安排”、“把时长定为 30 分钟”。

SKILL.md
--- frontmatter
name: googlecalendar
description: Manages Google Calendar events with proper timezone handling. Use when scheduling, updating, or patching calendar events. Triggers include "schedule meeting", "update event", "change meeting time", "reschedule", "make it 30 minutes".
metadata:
  version: 1.1.0
  category: operations
  tags:
    - calendar
    - scheduling
    - events
    - meetings
    - mcp
  author:
    name: NimbleBrain
    url: https://www.nimblebrain.ai

Google Calendar Integration

Quick Start: Create Event

code
GOOGLECALENDAR_CREATE_EVENT
  summary: "[TITLE]"
  start_time: "YYYY-MM-DDTHH:MM:SS"
  end_time: "YYYY-MM-DDTHH:MM:SS"
  timezone: "[IANA_TIMEZONE]"
  attendees: ["[EMAIL]"]

Critical Rules

1. PATCH/UPDATE Requires Both Times

Always send both start_time AND end_time when patching. Single-field patches cause timezone interpretation bugs.

code
GOOGLECALENDAR_PATCH_EVENT
  event_id: "[EVENT_ID]"
  calendar_id: "primary"
  start_time: "YYYY-MM-DDTHH:MM:SS"   # Always include
  end_time: "YYYY-MM-DDTHH:MM:SS"     # Always include
  timezone: "[IANA_TIMEZONE]"          # Always include

2. Always Specify Timezone

Never omit the timezone parameter. Without it, times are interpreted as UTC, causing events to land at wrong times.

3. Reuse IDs from Prior Tool Calls

Never fabricate IDs. Always use exact values returned from previous tool calls:

  • connectionId - from search_connections result
  • event_id - from GOOGLECALENDAR_FIND_EVENT result
  • toolName - exact spelling from connection's tool list (e.g., GOOGLECALENDAR_UPDATE_EVENT, not GOOGLE_CALENDAR_UPDATE_EVENT)

4. Verify Day-of-Week Matches Date

When scheduling involves a day name (e.g., "next Monday", "this Friday"):

  1. Calculate the target date from the day name
  2. Verify the calculated date's day-of-week matches what user requested
  3. State both day AND date when confirming with user (e.g., "Monday, January 27")

Timezone Reference

Common Abbreviations to IANA Names

AbbrevNameUTC OffsetIANA Timezone
US
ESTEastern StandardUTC-5America/New_York
EDTEastern DaylightUTC-4America/New_York
CSTCentral StandardUTC-6America/Chicago
CDTCentral DaylightUTC-5America/Chicago
MSTMountain StandardUTC-7America/Denver
MDTMountain DaylightUTC-6America/Denver
PSTPacific StandardUTC-8America/Los_Angeles
PDTPacific DaylightUTC-7America/Los_Angeles
AKSTAlaska StandardUTC-9America/Anchorage
AKDTAlaska DaylightUTC-8America/Anchorage
HSTHawaii StandardUTC-10Pacific/Honolulu
Europe
GMTGreenwich MeanUTC+0Europe/London
BSTBritish SummerUTC+1Europe/London
CETCentral EuropeanUTC+1Europe/Paris
CESTCentral European SummerUTC+2Europe/Paris
EETEastern EuropeanUTC+2Europe/Helsinki
EESTEastern European SummerUTC+3Europe/Helsinki
Asia/Pacific
ISTIndia StandardUTC+5:30Asia/Kolkata
SGTSingaporeUTC+8Asia/Singapore
CSTChina StandardUTC+8Asia/Shanghai
JSTJapan StandardUTC+9Asia/Tokyo
KSTKorea StandardUTC+9Asia/Seoul
AESTAustralian Eastern StdUTC+10Australia/Sydney
AEDTAustralian Eastern DstUTC+11Australia/Sydney
NZSTNew Zealand StandardUTC+12Pacific/Auckland
NZDTNew Zealand DaylightUTC+13Pacific/Auckland
Other
UTCCoordinated UniversalUTC+0UTC
ASTAtlantic StandardUTC-4America/Halifax
ADTAtlantic DaylightUTC-3America/Halifax

Timezone Conversion

To convert between timezones:

  1. Find UTC offset for source timezone (from table above)
  2. Find UTC offset for target timezone
  3. Calculate difference: target_offset - source_offset
  4. Add difference to the time

Examples:

ConvertCalculationResult
4 PM EST to PSTPST(-8) - EST(-5) = -3 hours1 PM PST
4 PM EST to HSTHST(-10) - EST(-5) = -5 hours11 AM HST
9 AM PST to JSTJST(+9) - PST(-8) = +17 hours2 AM next day JST
3 PM CET to ESTEST(-5) - CET(+1) = -6 hours9 AM EST

Quick mental model:

  • Negative offset = behind UTC (Americas)
  • Positive offset = ahead of UTC (Europe, Asia, Pacific)
  • Moving east (toward positive) = add hours
  • Moving west (toward negative) = subtract hours

Situational Handling

Change duration ("make it 30 minutes")

  1. Get current event if needed: GOOGLECALENDAR_FIND_EVENT
  2. Patch with BOTH times:
    • start_time: keep original
    • end_time: calculate new (start + new duration)
    • timezone: user's timezone (IANA format)

Reschedule to new time

  1. If day name given, verify day-of-week matches calculated date
  2. Convert requested time to user's timezone if cross-timezone
  3. Patch with BOTH times:
    • start_time: new time
    • end_time: new time + original duration
    • timezone: user's timezone (IANA format)

Create for Zoom meeting

code
GOOGLECALENDAR_CREATE_EVENT
  summary: "[ZOOM_TOPIC]"
  start_time: "YYYY-MM-DDTHH:MM:SS"
  end_time: "YYYY-MM-DDTHH:MM:SS"
  timezone: "[IANA_TIMEZONE]"
  attendees: ["[EMAIL]"]
  location: "[ZOOM_JOIN_URL]"
  description: "Join Zoom: [ZOOM_JOIN_URL]"

Date/Time Format

Use ISO 8601 WITHOUT offset. Let timezone param handle it:

json
{
  "start_time": "YYYY-MM-DDTHH:MM:SS",
  "end_time": "YYYY-MM-DDTHH:MM:SS",
  "timezone": "[IANA_TIMEZONE]"
}

Never use Z suffix or offset like -10:00 in the time string.

Error Recovery

ErrorCauseFix
"time range is empty"Only end_time providedSend both start_time and end_time
"Invalid start_time"Timezone in time stringUse plain ISO 8601, set timezone separately
"CONNECTION_NOT_FOUND"Wrong connection IDUse ID from search_connections, not fabricated
"Invalid request data"Wrong parameter namesUse start_time/end_time, not start_datetime/end_datetime

Example: The "time range is empty" Bug

Wrong (only end_time):

json
{
  "end_time": "YYYY-MM-DDTHH:MM:SS",
  "timezone": "[IANA_TIMEZONE]"
}

API interprets end as UTC while start stays in local time. End appears before start.

Right (both times):

json
{
  "start_time": "YYYY-MM-DDTHH:MM:SS",
  "end_time": "YYYY-MM-DDTHH:MM:SS",
  "timezone": "[IANA_TIMEZONE]"
}

Anti-Patterns

WrongRight
Patch only end_timeSend both times
"YYYY-MM-DDTHH:MM:SSZ""YYYY-MM-DDTHH:MM:SS" + timezone param
Guess event_idUse FIND_EVENT result
Fabricate connection IDUse search_connections result
start_datetime parameterstart_time parameter
Day name without verifying dateConfirm day-of-week matches date
Skip timezone paramAlways include timezone