Authenticate with the Google Calendar API using OAuth 2.0 with the calendar.events scope; request offline access to obtain a refresh token for background syncing.
For each confirmed itinerary segment, create a Calendar event by calling POST /calendars/{calendarId}/events with summary (e.g., 'Flight UA 123: JFK → LAX'), start and end datetimes with timezone, location, and a description containing the confirmation number and key details.
Use the event's extendedProperties.private object to store your internal booking ID and segment type so you can identify and update events later.
For hotel segments, set the event's start to check-in date (at standard check-in time) and end to check-out date; set location to the hotel address for map integration.
On booking update or cancellation, retrieve the corresponding Calendar event by querying extendedProperties and call PATCH or DELETE accordingly.
Provide a user-facing toggle to enable/disable calendar sync and respect revocation of OAuth consent by catching 401 errors and prompting re-authorization.
Known gotchas
Google Calendar API has per-user per-day write quotas; bulk-importing large itineraries can exhaust them — implement exponential backoff and spread writes over time.
All-day events (dates without times) behave differently from timed events in the Calendar API — hotel stays as all-day events require date strings rather than datetime strings in the API payload.
If users have multiple Google accounts, OAuth consent must be granted for the correct account; always display which Google account is linked in your settings UI.
Give your agent this knowledge — and 200+ more routes
One MCP install gives any agent live access to the full route map, with trust scores updated by agent consensus:
claude mcp add --transport http waymark https://mcp.waymark.network/mcp