update_program
Modify travel program details in LumbreTravel, including name, dates, and associated agency, ensuring accurate and up-to-date information for seamless trip planning.
Instructions
Actualiza un programa de viajes en LumbreTravel
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| agencyId | Yes | ID de la agencia a asociar con este programa | |
| endDate | Yes | Fecha de fin del programa (DD-MM-YYYY), salvo que el usuario lo indique las fechas siempre deben ser en el futuro. Y la fecha de fin debe ser mayor que la fecha de inicio | |
| id | Yes | ID del programa | |
| name | Yes | Nombre del programa | |
| startDate | Yes | Fecha de inicio del programa (DD-MM-YYYY), salvo que el usuario lo indique las fechas siempre deben ser en el futuro |
Implementation Reference
- src/handlers/tools.handler.ts:1193-1208 (handler)Main execution logic for the update_program tool: destructures arguments, formats dates, calls ApiService.updateProgram, and returns formatted response.case 'update_program': { const { id, name, startDate, endDate, agencyId } = args const program = await this.apiService.updateProgram({ id, name, startDate: formatDate(startDate), endDate: formatDate(endDate), agency: { id: agencyId } }) return { content: [{ type: 'text', text: `Programa "${name}" actualizado exitosamente.\n\nDetalles del programa:\n${JSON.stringify(program, null, 2)}` }] }
- Tool definition including name, description, and input schema for 'update_program' in the listTools() array.{ name: 'update_program', description: 'Actualiza un programa de viajes en LumbreTravel', inputSchema: { type: 'object', properties: { id: { type: 'string', description: 'ID del programa' }, name: { type: 'string', description: 'Nombre del programa' }, startDate: { type: 'string', description: 'Fecha de inicio del programa (DD-MM-YYYY), salvo que el usuario lo indique las fechas siempre deben ser en el futuro' }, endDate: { type: 'string', description: 'Fecha de fin del programa (DD-MM-YYYY), salvo que el usuario lo indique las fechas siempre deben ser en el futuro. Y la fecha de fin debe ser mayor que la fecha de inicio' }, agencyId: { type: 'string', description: 'ID de la agencia a asociar con este programa' } }, required: ['id', 'name', 'startDate', 'endDate', 'agencyId'] } },
- src/services/api.service.ts:121-135 (helper)ApiService method that sends PUT request to backend API to update program details.async updateProgram (data: { id: string name: string startDate: string endDate: string agency: { id: string } }) { const headers = await this.getHeaders() const response = await fetch(`${API_CONFIG.baseUrl}/integrations/mcp/programs/update`, { method: 'PUT', headers: { ...headers, 'Content-Type': 'application/json' }, body: JSON.stringify(data) }) return await this.handleResponse<any>(response) }