v1

OpenAPI 3.1.02026-07-13632897.9 KB
focused-tools

Sync Calendar

Manually trigger calendar sync for a user.

Used for testing and manual sync operations. Syncs Google Calendar events into focused_focus_sessions table.

Process: 1. Check needs_sync flag in Redis 2. Fetch events from Google Calendar (timeMin=-1d, timeMax=+30d) 3. Upsert events in batches of 100 4. Detect and soft-delete orphaned events 5. Update last_synced_at timestamp 6. Clear needs_sync flag

Identity Source (Increment 7D): - Primary: X-User-ID header (from MCP after JWT validation) - Fallback: payload.user_id (for backward compatibility) - Logs warning if fallback is used or mismatch detected

Returns: { "success": True, "data": { "events_fetched": int, "events_inserted": int, "events_updated": int, "events_deleted": int } }

post/api/focused/tools/sync_calendar

Request body

user_idstring required

User ID to sync calendar for

Response

Successful Response

{"stackTrail":"paths:/api/focused/tools/sync_calendar:post:responses:200:content:application/json:schema","oasType":"schema","type":"unknown"}