Book a table

Dineout journey - find a restaurant, check availability, reserve.

Dineout is Swiggy's table-reservation surface across 50+ Indian cities. The flow is compact: find → check slots → book → confirm.

The flow

search_restaurants_dineout ──► get_restaurant_details
                                        │
                                        ▼
                               get_available_slots ──► book_table ──► get_booking_status

Dineout search takes the coordinates of the city or area the user named. There is no saved-address lookup. If the user says "near me" without a place, ask which city or area.

// readToolData: see /docs/build/read-tool-results - returns structuredContent
// (or the JSON envelope's data when it's absent), throws on failure
const search = readToolData(
  await client.callTool({
    name: "search_restaurants_dineout",
    arguments: {
      latitude: 12.9716,
      longitude: 77.5946,
      query: "italian",
    },
  }),
);
// Reuse the resolved coordinates for every follow-up call
const { latitude, longitude } = search;
const restaurant = search.restaurants[0];

Results include rating, cuisines, cost for two, offers, and bookable deals (availableDeals). Use nextOffset to page through more results.

Step 2 - Dig into details

const details = readToolData(
  await client.callTool({
    name: "get_restaurant_details",
    arguments: { restaurantId: restaurant.id, latitude, longitude },
  }),
);
// details.data.restaurant (address, timings, deals), details.data.amenities, details.data.menuImages

Step 3 - Check available slots

const { slots } = readToolData(
  await client.callTool({
    name: "get_available_slots",
    arguments: {
      restaurantId: restaurant.id,
      date: "2026-05-01",
      latitude,
      longitude,
    },
  }),
);
// Up to 7 days from `date`, each slot tagged with a slotGroupName (breakfast/lunch/dinner)
 
// This recipe books a free reservation; paid prebook deals go through create_cart + UPI
const slot = slots.find((s) => s.availableInventory > 0 && s.deals.some((d) => d.isFree && !d.soldOut));
const deal = slot.deals.find((d) => d.isFree && !d.soldOut);

Surface slot times in the user's timezone (all restaurants are in India; IST applies).

Step 4 - Book

const booking = readToolData(
  await client.callTool({
    name: "book_table",
    arguments: {
      restaurantId: restaurant.id,
      slotId: deal.slotId,
      itemId: deal.itemId,
      reservationTime: slot.reservationTime,
      guestCount: 4,
      latitude,
      longitude,
    },
  }),
);

Important: book_table is not idempotent. On 5xx, don't retry blindly: if the failed call returned an orderId, check it with get_booking_status first; otherwise ask the user to check their Swiggy Dineout bookings before you book again.

Step 5 - Confirm

const status = readToolData(
  await client.callTool({
    name: "get_booking_status",
    arguments: { orderId: booking.orderId },
  }),
);
// status.status, status.reservationDate, status.reservationTime, status.restaurantLocation

Send the user the confirmation number and the restaurant's address.

Agent prompt

Common errors

  • SLOT_UNAVAILABLE → slot filled; refetch availability and offer alternatives.
  • RESTAURANT_NOT_BOOKABLE → restaurant isn't Dineout-enabled; offer dine-in walk-in guidance or a Food order instead.
  • BOOKING_WINDOW_CLOSED → outside booking hours; present next available day.

Full catalogue: errors.