get_program
Retrieve a travel program by its unique ID using the LumbreTravel API. Simplifies access and management of travel-related data through structured queries.
Instructions
Obtiene un programa de viajes por ID
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | ID del programa |
Implementation Reference
- src/handlers/tools.handler.ts:1117-1127 (handler)Handler implementation for the 'get_program' tool. Extracts the program ID from input arguments, calls the ApiService.getProgram method, and returns the program data as a JSON string in MCP response format.switch (name) { case 'get_program': { const { id } = args as { id: string } const program = await this.apiService.getProgram(id) return { content: [{ type: 'text', text: JSON.stringify(program, null, 2) }] } }
- src/handlers/tools.handler.ts:16-29 (schema)Input schema and metadata definition for the 'get_program' tool, specifying the required 'id' parameter.{ name: 'get_program', description: 'Obtiene un programa de viajes por ID', inputSchema: { type: 'object', properties: { id: { type: 'string', description: 'ID del programa' } }, required: ['id'] } },
- src/index.ts:38-47 (registration)MCP server request handler registration for listing tools (via listTools()) and calling tools (via callTool()), which includes the 'get_program' tool.this.server.setRequestHandler( ListToolsRequestSchema, async () => this.toolsHandler.listTools() ) // Configure handlers for tools this.server.setRequestHandler( CallToolRequestSchema, async (request) => await this.toolsHandler.callTool(request.params.name, request.params.arguments, this.server) )
- src/services/api.service.ts:84-91 (helper)Helper service method that performs an authenticated GET request to retrieve a program by its ID from the backend API.async getProgram (id: string) { const headers = await this.getHeaders() const response = await fetch(`${API_CONFIG.baseUrl}/integrations/mcp/programs/get/${id}`, { method: 'GET', headers }) return await this.handleResponse<any>(response) }