getAllReservations
Retrieve hotel reservations from Mews platform using filters like date range, customer IDs, reservation states, and pagination for efficient management.
Instructions
Get reservations with filters. Note: The time interval between StartUtc and EndUtc must not exceed 100 hours.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ReservationIds | No | Specific reservation IDs to retrieve | |
| CustomerIds | No | Filter by customer IDs | |
| States | No | Filter by reservation states (Confirmed, Canceled, etc.) | |
| StartUtc | Yes | Start date for search (ISO 8601) | |
| EndUtc | Yes | End date for search (ISO 8601) | |
| Limitation | No | Pagination settings |
Implementation Reference
- The execute function that implements the core logic of the getAllReservations tool by calling the Mews API endpoint '/api/connector/v1/reservations/getAll' with the provided arguments and returning the JSON-formatted result.async execute(config: MewsAuthConfig, args: unknown): Promise<ToolResult> { const result = await mewsRequest(config, '/api/connector/v1/reservations/getAll', args); return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] }; }
- The inputSchema defining the parameters accepted by the getAllReservations tool, including filters for reservation IDs, customers, states, date range, and pagination.inputSchema: { type: 'object', properties: { ReservationIds: { type: 'array', items: { type: 'string' }, description: 'Specific reservation IDs to retrieve' }, CustomerIds: { type: 'array', items: { type: 'string' }, description: 'Filter by customer IDs' }, States: { type: 'array', items: { type: 'string' }, description: 'Filter by reservation states (Confirmed, Canceled, etc.)' }, StartUtc: { type: 'string', description: 'Start date for search (ISO 8601)' }, EndUtc: { type: 'string', description: 'End date for search (ISO 8601)' }, Limitation: { type: 'object', properties: { Count: { type: 'number', description: 'Maximum number of reservations to return' }, Cursor: { type: 'string', description: 'Pagination cursor for next page' } }, description: 'Pagination settings' } }, required: ['StartUtc', 'EndUtc'] },
- src/tools/index.ts:21-21 (registration)Import statement for the getAllReservationsTool.import { getAllReservationsTool } from './reservations/getAllReservations.js';
- src/tools/index.ts:106-106 (registration)Inclusion of getAllReservationsTool in the allTools array, registering it for use in the MCP server.getAllReservationsTool,