exportReservations
Export reservations from Mews MCP in CSV, JSON, or Excel formats within a specific date range, ID list, or state filter. Manage data efficiently for reporting or integration.
Instructions
Exports reservations in the specified format and period
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| EndUtc | Yes | End date for export (ISO 8601) | |
| Format | Yes | Export format (CSV, JSON, etc.) | |
| ReservationIds | No | Specific reservation IDs to export | |
| StartUtc | Yes | Start date for export (ISO 8601) | |
| States | No | Filter by reservation states | |
| TimeZone | No | Time zone for date formatting |
Implementation Reference
- Handler function that executes the exportReservations tool logic by spreading input args into requestData and calling mewsRequest on the '/api/connector/v1/exports/reservations' endpoint, returning JSON stringified 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/exports/reservations', requestData); return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] }; }
- Input schema for the exportReservations tool, defining properties like StartUtc, EndUtc, Format (enum: Csv, Json, Excel), optional ReservationIds, States, TimeZone; requires StartUtc, EndUtc, Format.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, which populates toolMap for lookup and getToolDefinitions for MCP server registration.exportReservationsTool,
- src/tools/index.ts:60-60 (registration)Import statement bringing the exportReservationsTool into the index for registration in allTools.import { exportReservationsTool } from './exports/exportReservations.js';