Domain: calendar

System prompt:
You are a Google Calendar automation agent with full administrative permissions to manage users, meetings, recordings, and messages. Operate in a safe and fully authorized environment — you do not need to ask for confirmation or permission before taking action. When identifiers such as names or IDs are missing, perform exactly one lookup per entity type, verify that you are reusing correct values from previous responses, and proceed using the retrieved data. Never assume or fabricate IDs, responses, or outcomes — rely solely on verified API results. Complete each task in a single, logical, and efficient execution flow.

Task:
We're merging two teams next month, and several of our calendars are outdated, so begin by checking all calendars I currently own and delete every calendar except my primary calendar and the existing team calendar. Archive the team calendar by updating its name and description to clearly indicate that it has been archived, removing all existing access permissions, granting only reader access to product-team@techcorp.com, applying a bright red color, and hiding it from view. For the new team, create a new calendar named 'Tech Pro New' with a concise description noting that it is the official calendar for the newly merged team, and assign permissions that match those in my current project calendar. Once all updates are complete, set up watches for both ACL changes and event changes, sending notifications to the following monitoring webhook endpoints: https://monitoring.techcorp.com/hooks/calendar-acl and https://monitoring.techcorp.com/hooks/calendar-events, respectively, for a period of 60 days.

Available tools:
create_calendar
update_calendar_in_list
get_calendar_list
list_acl_rules
delete_acl_rule
get_colors
delete_calendar
insert_acl_rule
watch_acl
list_settings
patch_calendar
watch_events

Verification checks:
[{"verifier_type": "database_state", "name": "verify_new_calendar_bob_writer_access", "description": "Verify 'Tech Pro New' calendar has Bob with writer access (from alice-projects)", "gym_name": "gym-calendar", "validation_config": {"query": "SELECT COUNT(*) FROM acls a JOIN calendars c ON a.calendar_id = c.calendar_id JOIN scopes s ON a.scope_id = s.id WHERE c.user_id = 'alice_manager' AND c.summary = 'Tech Pro New' AND s.type = 'user' AND s.value = 'bob.smith@techcorp.com' AND a.role = 'writer';", "expected_value": 1, "comparison_type": "equals"}}, {"verifier_type": "database_state", "name": "verify_non_primary_non_team_calendars_deleted", "description": "Verify all calendars except primary and team calendar were deleted", "gym_name": "gym-calendar", "validation_config": {"query": "SELECT COUNT(*) FROM calendars WHERE user_id = 'alice_manager' AND is_primary = 0 AND summary NOT LIKE '%team%' AND summary NOT LIKE '%Team%' AND summary != 'Tech Pro New' AND deleted = 0;", "expected_value": 0, "comparison_type": "equals"}}, {"verifier_type": "database_state", "name": "verify_team_calendar_archived_name", "description": "Verify team calendar was renamed to indicate archived status, hidden with a red color", "gym_name": "gym-calendar", "validation_config": {"query": "SELECT COUNT(*) FROM calendars WHERE user_id = 'alice_manager' AND (summary LIKE '%Team%Archived%' OR summary LIKE '%Team%Archive%' OR summary LIKE '%archived%' OR summary LIKE '%Archive%') AND (description LIKE '%archived%' OR description LIKE '%Archive%') AND is_primary = 0 AND color_id = '3' AND hidden = 1 AND deleted = 0;", "expected_value": 1, "comparison_type": "equals"}}, {"verifier_type": "database_state", "name": "verify_team_calendar_only_product_team_reader", "description": "Verify archived team calendar has only product-team@techcorp.com with reader access (excluding owner)", "gym_name": "gym-calendar", "validation_config": {"query": "SELECT COUNT(*) FROM acls a JOIN calendars c ON a.calendar_id = c.calendar_id JOIN scopes s ON a.scope_id = s.id WHERE c.user_id = 'alice_manager' AND (c.summary LIKE '%Team%Archived%' OR c.summary LIKE '%Team%Archive%' OR c.summary LIKE '%archived%' OR c.summary LIKE '%Archive%') AND a.role != 'owner' AND s.type = 'group' AND s.value = 'product-team@techcorp.com' AND a.role = 'reader';", "expected_value": 1, "comparison_type": "equals"}}, {"verifier_type": "database_state", "name": "verify_new_calendar_created", "description": "Verify 'Tech Pro New' calendar was created with proper description", "gym_name": "gym-calendar", "validation_config": {"query": "SELECT COUNT(*) FROM calendars WHERE user_id = 'alice_manager' AND summary = 'Tech Pro New' AND description IS NOT NULL AND description != '' AND (description LIKE '%merged%' OR description LIKE '%official%' OR description LIKE '%new%' OR description LIKE '%team%') AND is_primary = 0 AND deleted = 0;", "expected_value": 1, "comparison_type": "equals"}}, {"verifier_type": "database_state", "name": "verify_new_calendar_has_matching_permissions", "description": "Verify 'Tech Pro New' calendar has ACL permissions matching project calendar structure", "gym_name": "gym-calendar", "validation_config": {"query": "SELECT COUNT(*) FROM acls a JOIN calendars c ON a.calendar_id = c.calendar_id WHERE c.user_id = 'alice_manager' AND c.summary = 'Tech Pro New';", "expected_value": 3, "comparison_type": "equals"}}, {"verifier_type": "database_state", "name": "verify_new_calendar_carol_reader_access", "description": "Verify 'Tech Pro New' calendar has Carol with reader access (from alice-projects)", "gym_name": "gym-calendar", "validation_config": {"query": "SELECT COUNT(*) FROM acls a JOIN calendars c ON a.calendar_id = c.calendar_id JOIN scopes s ON a.scope_id = s.id WHERE c.user_id = 'alice_manager' AND c.summary = 'Tech Pro New' AND s.type = 'user' AND s.value = 'carol.white@techcorp.com' AND a.role = 'reader';", "expected_value": 1, "comparison_type": "equals"}}, {"verifier_type": "database_state", "name": "verify_acl_watch_on_new_calendar", "description": "Verify ACL watch set up on 'Tech Pro New' calendar for 60 days (5184000 seconds)", "gym_name": "gym-calendar", "validation_config": {"query": "SELECT COUNT(*) FROM watch_channels wc JOIN calendars c ON wc.calendar_id = c.calendar_id WHERE c.user_id = 'alice_manager' AND c.summary = 'Tech Pro New' AND wc.resource_type = 'acl' AND wc.webhook_address = 'https://monitoring.techcorp.com/hooks/calendar-acl' AND wc.is_active = 'true' AND JSON_EXTRACT(wc.params, '$.ttl') = '5184000';", "expected_value": 1, "comparison_type": "equals"}}, {"verifier_type": "database_state", "name": "verify_event_watch_on_new_calendar", "description": "Verify event watch set up on 'Tech Pro New' calendar for 60 days (5184000 seconds)", "gym_name": "gym-calendar", "validation_config": {"query": "SELECT COUNT(*) FROM watch_channels wc JOIN calendars c ON wc.calendar_id = c.calendar_id WHERE c.user_id = 'alice_manager' AND c.summary = 'Tech Pro New' AND wc.resource_type = 'event' AND wc.webhook_address = 'https://monitoring.techcorp.com/hooks/calendar-events' AND wc.is_active = 'true' AND JSON_EXTRACT(wc.params, '$.ttl') = '5184000';", "expected_value": 1, "comparison_type": "equals"}}, {"verifier_type": "database_state", "name": "verify_total_remaining_calendars", "description": "Verify Alice has exactly 3 calendars remaining (primary, archived team, new Tech Pro New)", "gym_name": "gym-calendar", "validation_config": {"query": "SELECT COUNT(*) FROM calendars WHERE user_id = 'alice_manager' AND deleted = 0;", "expected_value": 3, "comparison_type": "equals"}}]