get_programs_by_name
Search and retrieve travel programs by specific name using LumbreTravel MCP Server, facilitating precise access to program details.
Instructions
Busca programas de viajes por nombre
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | Nombre del programa |
Implementation Reference
- src/handlers/tools.handler.ts:1129-1138 (handler)The handler logic in the callTool method for the 'get_programs_by_name' tool. It destructures the 'name' from arguments, calls apiService.getProgramsByName(name), and returns the result as a text content block with JSON stringified.case 'get_programs_by_name': { const { name } = args as { name: string } const program = await this.apiService.getProgramsByName(name) return { content: [{ type: 'text', text: JSON.stringify(program, null, 2) }] } }
- src/handlers/tools.handler.ts:30-43 (schema)The tool definition including name, description, and input schema requiring a 'name' string parameter.{ name: 'get_programs_by_name', description: 'Busca programas de viajes por nombre', inputSchema: { type: 'object', properties: { name: { type: 'string', description: 'Nombre del programa' } }, required: ['name'] } },
- src/index.ts:36-48 (registration)Registration of the tool handlers on the MCP server: setRequestHandler for ListToolsRequestSchema to listTools() and for CallToolRequestSchema to callTool().private setupHandlers (): void { // Configure handlers to list tools 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:93-104 (helper)Helper method in ApiService that performs the actual API call to fetch programs by name using POST request to the backend endpoint.async getProgramsByName (name: string) { const headers = await this.getHeaders() const dataToSend = new URLSearchParams({ name }) const response = await fetch(`${API_CONFIG.baseUrl}/integrations/mcp/programs/get_programs_by_name`, { method: 'POST', headers, body: dataToSend }) return await this.handleResponse<any>(response) }