get_programs_by_date_range
Retrieve travel programs available within a specified date range to plan trips effectively.
Instructions
Obtiene programas de viajes por rango de fechas
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| startDate | No | Fecha de inicio del programa (DD-MM-YYYY) | |
| endDate | No | Fecha de fin del programa (DD-MM-YYYY) |
Implementation Reference
- src/handlers/tools.handler.ts:1140-1152 (handler)The primary handler logic for the 'get_programs_by_date_range' MCP tool. It extracts startDate and endDate from arguments, formats them using the formatDate utility, calls the ApiService method, and returns the programs as formatted JSON text content.case 'get_programs_by_date_range': { const { startDate, endDate } = args const programs = await this.apiService.getProgramsByDateRange( formatDate(startDate), formatDate(endDate) ) return { content: [{ type: 'text', text: JSON.stringify(programs, null, 2) }] } }
- src/handlers/tools.handler.ts:44-60 (registration)Tool registration in listTools() method, defining the name, description, and input schema for 'get_programs_by_date_range'.{ name: 'get_programs_by_date_range', description: 'Obtiene programas de viajes por rango de fechas', inputSchema: { type: 'object', properties: { startDate: { type: 'string', description: 'Fecha de inicio del programa (DD-MM-YYYY)' }, endDate: { type: 'string', description: 'Fecha de fin del programa (DD-MM-YYYY)' } } } },
- src/handlers/tools.handler.ts:47-59 (schema)Input schema definition for validating tool arguments: startDate and endDate as strings in DD-MM-YYYY format.inputSchema: { type: 'object', properties: { startDate: { type: 'string', description: 'Fecha de inicio del programa (DD-MM-YYYY)' }, endDate: { type: 'string', description: 'Fecha de fin del programa (DD-MM-YYYY)' } } }
- src/services/api.service.ts:38-50 (helper)Supporting ApiService method that performs authenticated POST request to backend API endpoint to fetch programs by date range.async getProgramsByDateRange (startDate: string, endDate: string) { const headers = await this.getHeaders() const dataToSend = new URLSearchParams({ startDate, endDate }) const response = await fetch(`${API_CONFIG.baseUrl}/integrations/mcp/programs/get_programs_by_date_range`, { method: 'POST', headers, body: dataToSend }) return await this.handleResponse<any>(response) }