create_vehicle
Generate and manage vehicles within LumbreTravel MCP Server by providing details like name, description, brand, model, capacity, and provider.
Instructions
Crear un vehículo.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| brand | No | Marca del vehículo | |
| capacity | No | Capacidad del vehículo | |
| description | Yes | Descripción del vehículo | |
| model | No | Modelo del vehículo | |
| name | Yes | Nombre del vehículo | |
| provider | Yes |
Implementation Reference
- src/handlers/tools.handler.ts:1591-1597 (handler)Handler implementation for the 'create_vehicle' tool in the callTool method of ToolsHandler class. It destructures the input arguments and delegates to ApiService.createVehicle, then returns the result as MCP content.case 'create_vehicle': { const { name, description, brand, model, capacity, provider } = args const vehicle = await this.apiService.createVehicle({ name, description, brand, model, capacity, provider }) return { content: [{ type: 'text', text: JSON.stringify(vehicle, null, 2) }] } }
- Tool schema definition including inputSchema for 'create_vehicle' in the listTools method.{ name: 'create_vehicle', description: 'Crear un vehículo.', inputSchema: { type: 'object', properties: { name: { type: 'string', description: 'Nombre del vehículo' }, description: { type: 'string', description: 'Descripción del vehículo' }, brand: { type: 'string', description: 'Marca del vehículo' }, model: { type: 'string', description: 'Modelo del vehículo' }, capacity: { type: 'number', description: 'Capacidad del vehículo' }, provider: { type: 'object', properties: { id: { type: 'string', description: 'ID del proveedor del vehículo.' }, name: { type: 'string', description: 'Nombre del proveedor del vehículo' } } } }, required: ['name', 'description', 'provider'] }
- src/services/api.service.ts:796-814 (helper)ApiService method that makes the HTTP POST request to the backend API to create a vehicle.async createVehicle (data: { name: string description: string brand: string model: string capacity: number provider: { id: string name: string } }) { const headers = await this.getHeaders() const response = await fetch(`${API_CONFIG.baseUrl}/integrations/mcp/vehicle/create`, { method: 'POST', headers: { ...headers, 'Content-Type': 'application/json' }, body: JSON.stringify(data) }) return await this.handleResponse<any>(response) }
- src/index.ts:43-47 (registration)Registration of the generic callTool handler for all tools, including 'create_vehicle', in the MCP server setup.// Configure handlers for tools this.server.setRequestHandler( CallToolRequestSchema, async (request) => await this.toolsHandler.callTool(request.params.name, request.params.arguments, this.server) )
- src/index.ts:38-41 (registration)Registration of the listTools handler which includes the 'create_vehicle' tool definition.this.server.setRequestHandler( ListToolsRequestSchema, async () => this.toolsHandler.listTools() )