get_vehicle_by_name
Search for vehicles by name to retrieve a list of matching results from the travel database.
Instructions
Buscar vehículos por su nombre, retorna la lista de vehículos encontrados.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | Nombre del vehículo |
Implementation Reference
- src/handlers/tools.handler.ts:1623-1629 (handler)MCP tool handler implementation that executes get_vehicle_by_name by calling the ApiService method and formatting the response as MCP content.case 'get_vehicle_by_name': { const { name } = args as { name: string } const vehicle = await this.apiService.getVehicleByName(name) return { content: [{ type: 'text', text: JSON.stringify(vehicle, null, 2) }] } }
- Tool definition in listTools() including name, description, and input schema requiring a 'name' string.{ name: 'get_vehicle_by_name', description: 'Buscar vehículos por su nombre, retorna la lista de vehículos encontrados.', inputSchema: { type: 'object', properties: { name: { type: 'string', description: 'Nombre del vehículo' } }, required: ['name'] } },
- src/services/api.service.ts:856-864 (helper)Supporting ApiService method that performs the actual API call to retrieve vehicles by name using authenticated POST request.async getVehicleByName (name: string) { const headers = await this.getHeaders() const response = await fetch(`${API_CONFIG.baseUrl}/integrations/mcp/vehicle/get_vehicles_by_name`, { method: 'POST', headers: { ...headers, 'Content-Type': 'application/json' }, body: JSON.stringify({ name }) }) return await this.handleResponse<any>(response) }
- src/index.ts:36-48 (registration)Registers the MCP request handlers for listTools and callTool using the ToolsHandler instance, enabling all tools including get_vehicle_by_name.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) ) }