Skip to main content
Glama
alcylu

Nightlife Search

create_vip_booking_request

Submit a VIP table booking request to the venue's booking desk for nightlife events, with precise handling of late-night arrival times to prevent midnight confusion.

Instructions

Create a VIP table booking request and send it directly to the venue booking desk. The venue must have vip_booking_supported=true. Before calling this tool, always confirm booking date and arrival time in venue local time. For arrivals from 00:00 to 05:59, use the 'night + actual day' format to avoid midnight confusion. Required format: '[Night] night, [time] ([Actual Day] [time])' — e.g., 'Friday night, 2am (Saturday 2am)'. Example confirmation: 'So you're coming Friday night, 2am (Saturday 2am), table for 4 at Zouk?' If the user gives a time like 2am without a day, ask: 'Do you mean Thursday night, 2am (Friday morning), or Friday night, 2am (Saturday morning)?' If the user changes the requested day, regenerate confirmation before calling this tool.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
venue_idYes
booking_dateYes
arrival_timeYes
party_sizeYes
customer_nameYes
customer_emailYes
customer_phoneYes
preferred_table_codeNo
special_requestsNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
booking_request_idYes
statusYes
created_atYes
messageYes
preferred_table_codeYes
min_spendYes
min_spend_currencyYes
table_warningYes

Implementation Reference

  • The main handler function that creates a VIP booking request. Validates all inputs (venue_id, booking_date, arrival_time, party_size, customer_name, email, phone), checks VIP booking is enabled for the venue, resolves booking window dates, looks up table pricing if preferred_table_code is provided, inserts the booking into vip_booking_requests, records a status event in vip_booking_status_events, creates a pending agent task in vip_agent_tasks, and sends a confirmation email via sendBookingSubmittedEmail.
    export async function createVipBookingRequest(
      supabase: SupabaseClient,
      input: CreateVipBookingRequestInput,
      options?: { resendApiKey?: string },
    ): Promise<VipBookingCreateResult> {
      const venueId = ensureUuid(input.venue_id, "venue_id");
      const bookingDate = normalizeBookingDate(input.booking_date);
      const arrivalTime = normalizeArrivalTime(input.arrival_time);
      const partySize = normalizePartySize(input.party_size);
      const customerName = normalizeCustomerName(input.customer_name);
      const customerEmail = normalizeCustomerEmail(input.customer_email);
      const customerPhone = normalizeCustomerPhone(input.customer_phone);
      const preferredTableCode = normalizeOptionalTableCode(input.preferred_table_code);
      const specialRequests = normalizeOptionalText(input.special_requests, 2000);
    
      const window = await resolveBookingWindow(supabase, venueId);
      if (bookingDate < window.currentServiceDate || bookingDate > window.maxServiceDate) {
        throw new NightlifeError(
          "INVALID_BOOKING_REQUEST",
          `booking_date must be between ${window.currentServiceDate} and ${window.maxServiceDate}.`,
        );
      }
    
      let minSpend: number | null = null;
      let minSpendCurrency: string | null = null;
      let tableWarning: string | null = null;
    
      if (preferredTableCode) {
        const pricing = await lookupTablePricing(supabase, venueId, preferredTableCode, bookingDate);
        if (!pricing.found) {
          tableWarning = `Table "${preferredTableCode}" was not found in our system for this venue. The booking request has been submitted and the venue will confirm table availability.`;
        }
        minSpend = pricing.minSpend;
        minSpendCurrency = pricing.currency;
      }
    
      const { data: created, error: createError } = await supabase
        .from("vip_booking_requests")
        .insert({
          venue_id: venueId,
          booking_date: bookingDate,
          arrival_time: arrivalTime,
          party_size: partySize,
          customer_name: customerName,
          customer_email: customerEmail,
          customer_phone: customerPhone,
          preferred_table_code: preferredTableCode,
          min_spend: minSpend,
          min_spend_currency: minSpendCurrency,
          special_requests: specialRequests,
          status: "submitted",
          status_message: DEFAULT_STATUS_MESSAGE,
        })
        .select("id,status,created_at,status_message")
        .single<VipBookingInsertRow>();
    
      if (createError || !created) {
        throw new NightlifeError("REQUEST_WRITE_FAILED", "Failed to create VIP booking request.", {
          cause: createError?.message || "Unknown insert error",
        });
      }
    
      const { error: eventError } = await supabase
        .from("vip_booking_status_events")
        .insert({
          booking_request_id: created.id,
          from_status: null,
          to_status: "submitted",
          actor_type: "customer",
          note: "VIP booking request sent to venue booking desk.",
        });
    
      const { error: taskError } = await supabase
        .from("vip_agent_tasks")
        .insert({
          booking_request_id: created.id,
          task_type: "new_vip_request",
          status: "pending",
          attempt_count: 0,
          next_attempt_at: new Date().toISOString(),
        });
    
      if (eventError || taskError) {
        throw new NightlifeError(
          "REQUEST_WRITE_FAILED",
          "Failed to submit VIP booking request.",
          {
            cause: {
              status_event_error: eventError?.message || null,
              task_error: taskError?.message || null,
            },
          },
        );
      }
    
      // Send submitted email (fire-and-forget)
      if (options?.resendApiKey) {
        try {
          const { sendBookingSubmittedEmail } = await import("./email.js");
          await sendBookingSubmittedEmail(supabase, options.resendApiKey, created.id);
        } catch (emailError) {
          logEvent("email.send_error", {
            booking_request_id: created.id,
            error: emailError instanceof Error ? emailError.message : "Unknown error",
          });
        }
      }
    
      return {
        booking_request_id: created.id,
        status: created.status,
        created_at: created.created_at,
        message: created.status_message,
        preferred_table_code: preferredTableCode,
        min_spend: minSpend,
        min_spend_currency: minSpendCurrency,
        table_warning: tableWarning,
      };
    }
  • Input schema for the create_vip_booking_request tool using Zod validation. Defines required fields: venue_id, booking_date, arrival_time, party_size, customer_name, customer_email, customer_phone; and optional fields: preferred_table_code, special_requests.
    export const createVipBookingInputSchema = {
      venue_id: z.string().min(1),
      booking_date: z.string().min(1),
      arrival_time: z.string().min(1),
      party_size: z.number().int().min(1).max(30),
      customer_name: z.string().min(1),
      customer_email: z.string().min(1),
      customer_phone: z.string().min(1),
      preferred_table_code: z.string().optional(),
      special_requests: z.string().optional(),
    };
  • Output schema for the create_vip_booking_request tool using Zod. Returns booking_request_id, status, created_at, message, preferred_table_code, min_spend, min_spend_currency, and table_warning.
    export const createVipBookingOutputSchema = z.object({
      booking_request_id: z.string(),
      status: z.enum(["submitted", "in_review", "deposit_required", "confirmed", "rejected", "cancelled"]),
      created_at: z.string(),
      message: z.string(),
      preferred_table_code: z.string().nullable(),
      min_spend: z.number().nullable(),
      min_spend_currency: z.string().nullable(),
      table_warning: z.string().nullable(),
    });
  • Registers the create_vip_booking_request tool with the MCP server via server.registerTool(). Wires up description, inputSchema, outputSchema, and the handler callback that calls createVipBookingRequest from the services layer.
    export function registerVipBookingTools(server: McpServer, deps: ToolDeps): void {
      server.registerTool(
        "create_vip_booking_request",
        {
          description: createVipBookingToolDescription,
          inputSchema: createVipBookingInputSchema,
          outputSchema: createVipBookingOutputSchema,
        },
        async (args) => runTool(
          "create_vip_booking_request",
          createVipBookingOutputSchema,
          async () => createVipBookingRequest(deps.supabase, args, {
            resendApiKey: deps.config.resendApiKey ?? undefined,
          }),
        ),
      );
  • TypeScript interface VipBookingCreateResult defining the return type shape for the createVipBookingRequest handler.
    export interface VipBookingCreateResult {
      booking_request_id: string;
      status: VipBookingStatus;
      created_at: string;
      message: string;
      preferred_table_code: string | null;
      min_spend: number | null;
      min_spend_currency: string | null;
      table_warning: string | null;
    }
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries full burden. It discloses that the tool sends the request directly to the venue booking desk, requires a venue flag, and includes instructions for confirmation. However, it does not mention side effects like irreversible actions, confirmation emails, or failure modes. Still, it adds significant context beyond the schema.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is moderately lengthy but well-structured with examples and step-by-step instructions. It front-loads the core purpose and then provides essential usage details. Every sentence adds value, though it could be slightly shortened without losing clarity.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's complexity (9 parameters, no schema descriptions, and an output schema not referenced), the description covers key usage context but omits parameter details and return values. It is adequate for an agent if the schema is well-named, but not fully self-contained.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has 9 parameters with 0% description coverage. The description only indirectly explains booking_date, arrival_time, and party_size through format examples. Other required parameters like customer_name, customer_email, customer_phone, and venue_id are not explained. This is insufficient compensation for the lack of schema descriptions.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states it creates a VIP table booking request and sends it directly to the venue booking desk. It specifies the prerequisite (venue must have vip_booking_supported=true) and provides a distinct action from siblings like cancel_vip_booking_request. The verb 'create' combined with resource 'VIP booking request' is specific and unambiguous.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides explicit when-to-use guidance: confirm booking date and arrival time in venue local time before calling, handle midnight confusion with a specific format, and regenerate confirmation if the day changes. It does not explicitly state when not to use or name alternatives, but the context is clear for an agent.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/alcylu/nightlife-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server