addReservation
Create a new reservation with specified details, including customer ID, service ID, rate plan, check-in/out times, space category, and optional notes or voucher codes, via the Mews hospitality platform API.
Instructions
Adds a new reservation with the specified details
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| AdultCount | No | Number of adults | |
| BookingChannel | No | Channel for booking | |
| ChildCount | No | Number of children | |
| CustomerId | No | Customer ID for the reservation | |
| EndUtc | Yes | Check-out date/time (ISO 8601) | |
| Notes | No | Reservation notes | |
| RatePlanId | Yes | Rate plan ID | |
| ServiceId | Yes | Service ID | |
| SpaceCategoryId | No | Space category ID | |
| StartUtc | Yes | Check-in date/time (ISO 8601) | |
| VoucherCode | No | Discount voucher code |
Implementation Reference
- The execute function that implements the core logic of the addReservation tool, forwarding input arguments to the Mews API endpoint '/api/connector/v1/reservations/add' and returning the JSON result.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) }] }; }
- The inputSchema defining the structure and requirements for parameters accepted by the addReservation tool.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 statement that brings the addReservationTool into the tools index module.import { addReservationTool } from './reservations/addReservation.js';
- src/tools/index.ts:107-107 (registration)The addReservationTool is added to the central allTools registry array, making it available for execution.addReservationTool,