/ Cases / Tourism / AI agent

MCP server: ChatGPT and Claude sell your tours

Any AI agent can search tours, check availability, get an exact quote and hold a booking for 48 hours. The person pays on the website.

/ Atitlán Experience/ 2026/ MCP + REST with OpenAPI + llms.txt

8

MCP tools

48 h

booking hold

/ The problem

More and more travelers plan with an AI assistant. If the assistant can't see your availability or your exact price, it recommends someone else.

/ What we built

  • An MCP server with tools to search, check availability, quote and hold.
  • A REST API with OpenAPI and llms.txt so any agent can understand it.
  • The booking is held for 48 hours; payment always happens on the website, by a person.
  • Per-IP limits and edge caching so a crawler can't take down the database.

/ How it works

  1. 01Traveler asks their AI
  2. 02The AI queries the MCP
  3. 03Quotes and holds
  4. 04The person pays on the website

/ Real code

worker/mcp.tsts
    server.registerTool('hold_booking', {
        title: 'Hold a booking (unpaid)',
        description: 'Reserve a tour under the customer\'s name WITHOUT payment. Returns checkout_url with their details filled in; the person must pay there to confirm. The hold expires in 48 hours if unpaid and does not reserve the departure until paid. Only call this after the person has agreed and given their name and email. Calling it again with the same email, tour and date updates the same hold.',
        inputSchema: z.object({
            tour_id: tourId, date,
            start_time: z.string().describe('HH:MM, one of the tour start times.'),
            ...people, price_option: priceOption,
            customer_name: z.string().min(2).describe('Full name of the person traveling.'),
            customer_email: z.string().describe('Their email. Needed later to check the booking status.'),
            // …
            notes: z.string().max(300).optional().describe('Allergies, special occasion, hotel.'),
            lang,
        }),
        annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: true, openWorldHint: false },
    }, async (a) => guard(async () => {
        // Mismo límite y MISMA clave que POST /api/agent/bookings: 10 por minuto por IP entre las dos puertas.
        if (!rateLimit(`${deps.ip}:/api/agent/bookings`, 10, 60000).ok) return { status: 429, body: { error: 'Too many requests. Please try again in a minute.', code: 'rate_limited' } };
        // …
        return createAgentBooking(deps.supabase(), {
            tour_id: a.tour_id, date: a.date, start_time: a.start_time,
            adults: a.adults, children: a.children, infants: a.infants, price_option: a.price_option,
            customer: { name: a.customer_name, email: a.customer_email, phone: a.customer_phone },
            notes: a.notes, lang: a.lang, agent: 'MCP',
        });
    }));

■ An MCP tool an AI agent can call: it holds the booking unpaid, is idempotent and shares its per-IP rate limit with the REST API.

/ Stack

MCP Streamable HTTPOpenAPIllms.txtCloudflare WorkersRate limiting