list_calendars from yesterday gives you the calendar IDs. Now you need to see what's coming up — thesis committee meetings, lab sessions, submission deadlines. How do you fetch upcoming events?
list_calendars gave me the ID. I'd call a find-events action with that ID and a start time — find everything after today.
GOOGLECALENDAR_FIND_EVENT takes calendarId and timeMin — a start datetime in ISO 8601 format. Events from that time onwards come back in a list. The list_calendars call first, then find_events with the returned ID — that's the two-step pattern:
result = toolset.execute_action(
Action.GOOGLECALENDAR_FIND_EVENT,
{"calendarId": "primary", "timeMin": "2026-04-20T00:00:00Z"}
)
events = result.get("events", [])
for e in events:
print(f"{e.get('summary')}: {e.get('start')}")timeMin — does that have to be in that exact format? And calendarId: 'primary' — is that the actual string or a placeholder?
"primary" is the literal string Google uses for your main calendar — it's not a variable name. The timeMin format is ISO 8601 with timezone: "2026-04-20T00:00:00Z". Use the current date in that format as the start to get only future events:
def find_events(cal_id: str, time_min: str) -> list:
result = toolset.execute_action(
Action.GOOGLECALENDAR_FIND_EVENT,
{"calendarId": cal_id, "timeMin": time_min}
)
events = result.get("events", [])
print(f"Found {len(events)} upcoming events")
return eventsI called list_calendars to get my research calendar ID, then find_events with that ID to see all upcoming lab sessions. Two function calls, my whole schedule.
Your Calendar app just became a queryable Python list.
The pattern is the same as Gmail — list_calendars for the metadata, find_events for the content. Each step builds on the last.
ISO 8601 timezone suffix matters. "2026-04-20T00:00:00" without Z may be interpreted as local time or rejected depending on the API. Always append Z for UTC when querying Google Calendar endpoints.
Fetches events starting at or after timeMin. Required params:
| Param | Type | Example |
|---|---|---|
calendarId | str | "primary" or calendar ID |
timeMin | str | "2026-04-20T00:00:00Z" |
{"events": [{"summary": "...", "start": {...}, "end": {...}}]}
list_calendars() → get ID → find_events(cal_id, time_min)
timeMin must be in ISO 8601 with UTC timezone (Z suffix). Use datetime.utcnow().isoformat() + "Z" in Python to generate a current timestamp dynamically instead of hardcoding a date.
list_calendars from yesterday gives you the calendar IDs. Now you need to see what's coming up — thesis committee meetings, lab sessions, submission deadlines. How do you fetch upcoming events?
list_calendars gave me the ID. I'd call a find-events action with that ID and a start time — find everything after today.
GOOGLECALENDAR_FIND_EVENT takes calendarId and timeMin — a start datetime in ISO 8601 format. Events from that time onwards come back in a list. The list_calendars call first, then find_events with the returned ID — that's the two-step pattern:
result = toolset.execute_action(
Action.GOOGLECALENDAR_FIND_EVENT,
{"calendarId": "primary", "timeMin": "2026-04-20T00:00:00Z"}
)
events = result.get("events", [])
for e in events:
print(f"{e.get('summary')}: {e.get('start')}")timeMin — does that have to be in that exact format? And calendarId: 'primary' — is that the actual string or a placeholder?
"primary" is the literal string Google uses for your main calendar — it's not a variable name. The timeMin format is ISO 8601 with timezone: "2026-04-20T00:00:00Z". Use the current date in that format as the start to get only future events:
def find_events(cal_id: str, time_min: str) -> list:
result = toolset.execute_action(
Action.GOOGLECALENDAR_FIND_EVENT,
{"calendarId": cal_id, "timeMin": time_min}
)
events = result.get("events", [])
print(f"Found {len(events)} upcoming events")
return eventsI called list_calendars to get my research calendar ID, then find_events with that ID to see all upcoming lab sessions. Two function calls, my whole schedule.
Your Calendar app just became a queryable Python list.
The pattern is the same as Gmail — list_calendars for the metadata, find_events for the content. Each step builds on the last.
ISO 8601 timezone suffix matters. "2026-04-20T00:00:00" without Z may be interpreted as local time or rejected depending on the API. Always append Z for UTC when querying Google Calendar endpoints.
Fetches events starting at or after timeMin. Required params:
| Param | Type | Example |
|---|---|---|
calendarId | str | "primary" or calendar ID |
timeMin | str | "2026-04-20T00:00:00Z" |
{"events": [{"summary": "...", "start": {...}, "end": {...}}]}
list_calendars() → get ID → find_events(cal_id, time_min)
timeMin must be in ISO 8601 with UTC timezone (Z suffix). Use datetime.utcnow().isoformat() + "Z" in Python to generate a current timestamp dynamically instead of hardcoding a date.
Create a free account to get started. Paid plans unlock all tracks.