addReservation
Create new reservations in Mews hospitality platform by specifying customer, service, dates, and booking details to manage hotel bookings.
Instructions
Adds a new reservation with the specified details
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| CustomerId | No | Customer ID for the reservation | |
| ServiceId | Yes | Service ID | |
| RatePlanId | Yes | Rate plan ID | |
| StartUtc | Yes | Check-in date/time (ISO 8601) | |
| EndUtc | Yes | Check-out date/time (ISO 8601) | |
| VoucherCode | No | Discount voucher code | |
| BookingChannel | No | Channel for booking | |
| Notes | No | Reservation notes | |
| SpaceCategoryId | No | Space category ID | |
| AdultCount | No | Number of adults | |
| ChildCount | No | Number of children |
Implementation Reference
- Handler (execute function) for 'addReservation' tool that sends a POST request to the Mews reservations/add endpoint using the mewsRequest utility.async execute(config: MewsAuthConfig, args: unknown): Promise<ToolResult> { const inputArgs = args as Record<string, unknown>; const requestData = { ...inputArgs }; const result = await mewsRequest(config, '/api/connector/v1/reservations/add', requestData); return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] }; }
- Input schema defining the parameters accepted by the addReservation tool, with required fields ServiceId, RatePlanId, StartUtc, EndUtc.inputSchema: { type: 'object', properties: { CustomerId: { type: 'string', description: 'Customer ID for the reservation' }, ServiceId: { type: 'string', description: 'Service ID' }, RatePlanId: { type: 'string', description: 'Rate plan ID' }, StartUtc: { type: 'string', description: 'Check-in date/time (ISO 8601)' }, EndUtc: { type: 'string', description: 'Check-out date/time (ISO 8601)' }, VoucherCode: { type: 'string', description: 'Discount voucher code' }, BookingChannel: { type: 'string', description: 'Channel for booking' }, Notes: { type: 'string', description: 'Reservation notes' }, SpaceCategoryId: { type: 'string', description: 'Space category ID' }, AdultCount: { type: 'number', description: 'Number of adults' }, ChildCount: { type: 'number', description: 'Number of children' } }, required: ['ServiceId', 'RatePlanId', 'StartUtc', 'EndUtc'], additionalProperties: false },
- src/tools/index.ts:22-22 (registration)Import of the addReservationTool for inclusion in the tools registry.import { addReservationTool } from './reservations/addReservation.js';
- src/tools/index.ts:107-107 (registration)Registration of addReservationTool in the allTools array exported for use across the application.addReservationTool,