Calendar Optimizer
Optimize your calendar with meeting prep, travel time buffers, conflict detection, and focus time blocks
š§ Ingredients
š APIs
read_write_calendar_events_check_availability
š Alternatives:
calculate_travel_time_between_meeting_locations
š Alternatives:
pull_meeting_related_emails_for_context_and_attendee_info
š Alternatives:
pre_meeting_alerts_with_prep_packets
š Alternatives:
š Step-by-Step Build Guide
Connect to Google Calendar API and pull this week's events
1. Connect to Google Calendar API and pull this week's events
Fetch today's calendar events using the Google Calendar API.
GET https://www.googleapis.com/calendar/v3/calendars/{calendarId}/events?timeMin={todayStart}&timeMax={todayEnd}&orderBy=startTime&singleEvents=true
For each event, extract: summary (title), start/end time, location, attendees (names + emails), description.
Sort chronologically. Flag any conflicts (overlapping events).
Format each event as: "9:00-10:00 AM | Team Standup | Conference Room B | 5 attendees"
If no events today, return "No events scheduled today."š§ Human Required
- ⢠## Connect the API 1. Sign up for the service if you don't have an account 2. Find the API settings in your account dashboard 3. Generate an API key or access token 4. Share the key with your agent when prompted š” Most services have a free tier that's sufficient to get started.
Scan for conflicts
2. Scan for conflicts ā overlapping events, back-to-back meetings with no buffer
Scan for conflicts ā overlapping events, back-to-back meetings with no buffer Steps: 1. Validate all required inputs are available 2. Execute the operation described above 3. Verify the result meets expected output format 4. Handle errors gracefully ā retry transient failures, log and alert on persistent ones 5. Return structured output with status and any relevant data If any required data is missing, request it from the user before proceeding.
For in
3. For in-person meetings, use Google Maps to calculate travel time and insert buffer events
Process the data and calculate the requested metrics. Steps: 1. Validate input data ā check for nulls, out-of-range values, duplicates 2. Apply the calculation/aggregation logic 3. Compare against benchmarks or previous periods if available 4. Format results with appropriate precision (2 decimal places for percentages, whole numbers for counts) Include: current value, previous value, change (absolute and %), trend direction (āāā). Flag any anomalies: values >2 standard deviations from the mean. If insufficient data for a reliable calculation, state the minimum needed and return partial results.
Identify days with >4 hours of meetings and flag as 'heavy meeting day'
4. Identify days with >4 hours of meetings and flag as 'heavy meeting day'
Identify days with >4 hours of meetings and flag as 'heavy meeting day' Steps: 1. Validate all required inputs are available 2. Execute the operation described above 3. Verify the result meets expected output format 4. Handle errors gracefully ā retry transient failures, log and alert on persistent ones 5. Return structured output with status and any relevant data If any required data is missing, request it from the user before proceeding.
Protect focus time
5. Protect focus time: if you have a 2h block free, suggest creating a 'Focus Time' event
Protect focus time: if you have a 2h block free, suggest creating a 'Focus Time' event Steps: 1. Validate all required inputs are available 2. Execute the operation described above 3. Verify the result meets expected output format 4. Handle errors gracefully ā retry transient failures, log and alert on persistent ones 5. Return structured output with status and any relevant data If any required data is missing, request it from the user before proceeding.
Before each meeting
6. Before each meeting: generate a prep brief ā attendees, their roles, last interaction, meeting agenda
Before each meeting: generate a prep brief ā attendees, their roles, last interaction, meeting agenda Steps: 1. Validate all required inputs are available 2. Execute the operation described above 3. Verify the result meets expected output format 4. Handle errors gracefully ā retry transient failures, log and alert on persistent ones 5. Return structured output with status and any relevant data If any required data is missing, request it from the user before proceeding.
When someone asks to schedule
7. When someone asks to schedule: suggest 3 optimal time slots based on your availability, energy patterns, and existing meeting density
When someone asks to schedule: suggest 3 optimal time slots based on your availability, energy patterns, and existing meeting density Steps: 1. Validate all required inputs are available 2. Execute the operation described above 3. Verify the result meets expected output format 4. Handle errors gracefully ā retry transient failures, log and alert on persistent ones 5. Return structured output with status and any relevant data If any required data is missing, request it from the user before proceeding.
Weekly
8. Weekly: calendar analytics ā meeting hours, focus time, busiest days
Weekly: calendar analytics ā meeting hours, focus time, busiest days Steps: 1. Validate all required inputs are available 2. Execute the operation described above 3. Verify the result meets expected output format 4. Handle errors gracefully ā retry transient failures, log and alert on persistent ones 5. Return structured output with status and any relevant data If any required data is missing, request it from the user before proceeding.
š¤ Example Agent Prompt
Fetch today's calendar events using the Google Calendar API.
GET https://www.googleapis.com/calendar/v3/calendars/{calendarId}/events?timeMin={todayStart}&timeMax={todayEnd}&orderBy=startTime&singleEvents=true
For each event, extract: summary (title), start/end time, location, attendees (names + emails), description.
Sort chronologically. Flag any conflicts (overlapping events).
Format each event as: "9:00-10:00 AM | Team Standup | Conference Room B | 5 attendees"
If no events today, return "No events scheduled today."Copy this prompt into your agent to get started.