create_hotel
Add new hotel details to the LumbreTravel MCP Server by providing name, description, phone, email, and address. Ensures hotel data is accurately recorded and managed.
Instructions
Antes de crear un nuevo hotel se debe preguntar al si quiere que primero se busque el hotel a ver si existe.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| address | Yes | Dirección del hotel | |
| description | Yes | Descripción del hotel | |
| Yes | Email del hotel | ||
| name | Yes | Nombre del hotel | |
| phone | Yes | Teléfono del hotel |
Implementation Reference
- src/handlers/tools.handler.ts:1471-1477 (handler)The execution logic for the 'create_hotel' MCP tool. Destructures input arguments and delegates to ApiService.createHotel, then formats the response.case 'create_hotel': { const { name, description, phone, email, address } = args const hotel = await this.apiService.createHotel({ name, description, phone, email, address }) return { content: [{ type: 'text', text: JSON.stringify(hotel, null, 2) }] } }
- The input schema and metadata for the 'create_hotel' tool, defining parameters and requirements.name: 'create_hotel', description: 'Antes de crear un nuevo hotel se debe preguntar al si quiere que primero se busque el hotel a ver si existe.', inputSchema: { type: 'object', properties: { name: { type: 'string', description: 'Nombre del hotel' }, description: { type: 'string', description: 'Descripción del hotel' }, phone: { type: 'string', description: 'Teléfono del hotel' }, email: { type: 'string', description: 'Email del hotel' }, address: { type: 'string', description: 'Dirección del hotel' } }, required: ['name', 'description', 'phone', 'email', 'address'] } },
- src/services/api.service.ts:492-506 (helper)Supporting utility in ApiService that sends HTTP POST request to the backend API to create a hotel resource.async createHotel (data: { name: string description: string phone: string email: string address: string }) { const headers = await this.getHeaders() const response = await fetch(`${API_CONFIG.baseUrl}/integrations/mcp/hotels/create`, { method: 'POST', headers: { ...headers, 'Content-Type': 'application/json' }, body: JSON.stringify(data) }) return await this.handleResponse<any>(response) }
- src/index.ts:44-47 (registration)Server registration of the generic tool call handler, which dispatches to ToolsHandler.callTool based on tool name including 'create_hotel'.this.server.setRequestHandler( CallToolRequestSchema, async (request) => await this.toolsHandler.callTool(request.params.name, request.params.arguments, this.server) )