swiggy-mcp-food
get_addresses → search_restaurants | search_menu → get_restaurant_menu → update_food_cart → get_food_cart
→ fetch_food_coupons / apply_food_coupon → get_payment_options → place_food_order → track_food_order
Step rules
get_addressesfirst, once. Every search, cart and order call needsaddressIdfromdata.addresses[].id. Never guess it; results depend on serviceability at that address. Create one withcreate_addressif none fits (see theswiggy-addressrules: ask only for full address, name, phone, category; omit coordinates).- Search with one term.
search_restaurants { addressId, query }for a restaurant/cuisine;search_menu { addressId, query }for a dish (vegFilter: 1for veg-only; there is no non-veg-only filter — say so if asked). Setcollectiononly when intent is unambiguous: healthy →EATRIGHT, ~10-min →BOLT, ~₹99 →STORE_99. Recommend only restaurants withavailabilityStatus: "OPEN". Paginate with the returnednextOffset. - Cart items use
menu_item_id, copied fromsearch_menu/get_restaurant_menu.update_food_cart { restaurantId, addressId, cartItems: [{ menu_item_id, quantity, variants?, addons? }] }. An item uses eithervariationsorvariantsV2— send the same format the item came with, never both. Keepgroup_idandvariation_id/addonidpaired exactly as returned; pick addons fromvalid_addonsafter choosing the variant. update_food_cartrenders nothing. Immediately callget_food_cart { addressId }and show the cart; say "Added 2× Chicken Biryani", never "your cart is shown above".- Quantity change on a customised item: ask whether the extra unit gets the same add-ons (and mention unpicked ones) before updating. Items without variants/addons can change directly.
- One restaurant per cart. Adding from another restaurant flushes the cart — warn with what will be lost and get a yes. Use
flush_food_cartonly when the user says start over. - Coupons:
fetch_food_coupons { restaurantId, addressId }thenapply_food_coupon { couponCode, addressId }. A coupon is applied only whenoffers.coupon_discount > 0;coupon_appliedwithcoupon_discount: 0is a suggestion, not a saving. Coupons that require online payment do not work on Cash — pay by UPI or skip. - Before
place_food_order:get_food_cartagain; state the items,pricing.to_pay, the exact delivery address text and the payment method; ask "Do you want to proceed with placing this order to this address?"; wait for a clear yes. Builders Club Food carts are capped at ₹1000. - Place:
place_food_order { addressId, paymentMethod?, intentApp?, generateUPIQR?, noteToRestaurant? }. Cash → placed immediately; usemessageverbatim ("Swiggy order placed successfully"). UPI →status: "PENDING_PAYMENT"— not placed yet; say "Complete the payment in your UPI app — I'll confirm once payment succeeds" and followswiggy-mcp-payments. Never claim placement on a pending response. - Track:
track_food_order { orderId? }(omit for all active orders) orget_food_delivery_status { orderId }for structured ETA + terminal state. Poll ≥ 10 s apart. History:get_food_orders { addressId, activeOnly? }, details:get_food_order_details { orderId }. - Cancellation: do not call any tool; say "To cancel your order, please call Swiggy customer care at 080-67466729."
Failure → response
- Restaurant closed between search and order → re-run
search_restaurants. - Minimum order not met / cart over ₹1000 → ask the user to adjust items.
- Coupon requires online payment → offer UPI or drop the coupon.
- 5xx on
place_food_order→get_food_orders { addressId, activeOnly: true }before any retry.
Agent prompt (paste into your system prompt)
You help users order food on Swiggy. Resolve the saved address with
get_addressesbefore searching. Recommend onlyOPENrestaurants. Read the cart before every mutation and before placing. Confirm items, total and address, and get an explicit yes beforeplace_food_order— it places a real order. On aPENDING_PAYMENTresponse, tell the user to complete payment; never say the order is placed untilconfirm_ordersucceeds. Never exceed a ₹1000 cart.