prototype demo
SWIGGY MCP ยท FOOD + DINEOUT

Your evening, planned
in one conversation

An AI agent that coordinates dining-out and food delivery across Swiggy's MCP stack โ€” with live availability checks, staged confirmations, and graceful fallbacks when things don't go perfectly.

Food MCP
Dineout MCP
14 tools ยท OAuth 2.1 PKCE
occasion-copilot โ€” interactive prototype
MCP v1.0
๐ŸŒ†
Hi! Tell me what you're planning tonight โ€” a dinner out, food delivered home, or both. I'll coordinate across Swiggy Food and Dineout and confirm each step separately before acting.
Date night โ€” Italian in Indiranagar, 2 people, 8pm, gelato after
Rooftop for 4 tonight, biryani delivered home around 10
Show me what happens when a slot isn't available
Agent flow
๐Ÿ’ฌ
Parse intent
LLM extracts
constraints &
occasion type
โ†’
๐Ÿ”
Find table
search_restaurants
_dineout
get_available_slots
โ†’
๐Ÿ“‹
Confirm ยท book
book_table
get_booking
_status โœ“
โ†’
๐Ÿ›ต
Build cart
search_restaurants
get_restaurant
_menu ยท update_cart
โ†’
โœ…
Confirm ยท order
get_food_cart
place_food_order
track_food_order

Each server confirmation is independent. Partial success is surfaced explicitly โ€” a failed food order never silently cancels a Dineout booking.

Edge case handling
graceful degradation
Slot unavailable at chosen time
Agent re-fetches 7-day availability window, surfaces the 3 closest alternatives with times and party-size fit. Never dead-ends.
safe retry
book_table returns 5xx
Calls get_booking_status before retrying โ€” non-idempotent endpoint, so check-then-retry prevents double bookings.
staged confirm
Dineout books, food order fails
Each action confirms separately. If food placement fails, booking remains intact. Agent offers: retry delivery, prepare cart for later, or skip.
cart safety
User edits cart in Swiggy app mid-chat
get_food_cart is called right before every place_food_order โ€” never trusts what was added earlier in the conversation.
auth recovery
401 mid-session on either server
Re-runs OAuth 2.1 PKCE flow once, updates the shared bearer token across both MCP clients, then retries the failed call.
coupon safety
Coupon requires online payment
v1 is COD-only. fetch_food_coupons is filtered at the agent layer โ€” requiresOnlinePayment coupons are never surfaced to the user.
Technical implementation
LLM
Claude Sonnet
Multi-tool orchestration, constraint extraction, occasion-type classification
FRAMEWORK
Next.js 14
Server-side MCP calls via API routes, streaming responses, Vercel deploy
MCP CLIENT
Streamable HTTP
Parallel clients to /food and /dineout โ€” single OAuth 2.1 PKCE token across both
RESILIENCE
Retry + fallback
Exponential backoff (500msโ†’8s), check-then-retry on placement, 30s wall-clock cap
STATE
Server-authoritative
No client-side cart caching โ€” always re-fetches before mutations or confirmations
OBSERVABILITY
Session ID logging
Every tool call logs session ID for Swiggy-side trace correlation on failures