exportReservations
Export reservation data from Mews hospitality platform in CSV, JSON, or Excel format for specified date ranges and filters.
Instructions
Exports reservations in the specified format and period
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| StartUtc | Yes | Start date for export (ISO 8601) | |
| EndUtc | Yes | End date for export (ISO 8601) | |
| Format | Yes | Export format (CSV, JSON, etc.) | |
| ReservationIds | No | Specific reservation IDs to export | |
| States | No | Filter by reservation states | |
| TimeZone | No | Time zone for date formatting |
Implementation Reference
- The main handler function for the exportReservations tool. It processes input arguments and makes an HTTP request to the Mews API endpoint '/api/connector/v1/exports/reservations' to export reservations.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/exports/reservations', requestData); return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] }; }
- Input schema defining the parameters for the exportReservations tool, including required StartUtc, EndUtc, Format, and optional filters.inputSchema: { type: 'object', properties: { StartUtc: { type: 'string', description: 'Start date for export (ISO 8601)' }, EndUtc: { type: 'string', description: 'End date for export (ISO 8601)' }, Format: { type: 'string', description: 'Export format (CSV, JSON, etc.)', enum: ['Csv', 'Json', 'Excel'] }, ReservationIds: { type: 'array', items: { type: 'string' }, description: 'Specific reservation IDs to export', maxItems: 1000 }, States: { type: 'array', items: { type: 'string' }, description: 'Filter by reservation states' }, TimeZone: { type: 'string', description: 'Time zone for date formatting' } }, required: ['StartUtc', 'EndUtc', 'Format'], additionalProperties: false },
- src/tools/index.ts:145-145 (registration)Registration of the exportReservationsTool in the central allTools array exported from src/tools/index.ts.exportReservationsTool,
- src/tools/index.ts:60-60 (registration)Import statement bringing the exportReservationsTool into the index for registration.import { exportReservationsTool } from './exports/exportReservations.js';