create_hotel
Add new hotels to the LumbreTravel system by providing name, description, contact details, and address information for travel program management.
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 |
|---|---|---|---|
| name | Yes | Nombre del hotel | |
| description | Yes | Descripción del hotel | |
| phone | Yes | Teléfono del hotel | |
| Yes | Email del hotel | ||
| address | Yes | Dirección del hotel |
Implementation Reference
- src/handlers/tools.handler.ts:1471-1477 (handler)MCP tool handler case for 'create_hotel': destructures input arguments, calls apiService.createHotel, and returns the hotel data as formatted text.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) }] } }
- Input schema and description for the 'create_hotel' tool, defining required properties for hotel creation.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)Helper service method that performs authenticated POST request to the backend API to create a new hotel.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:38-47 (registration)Registers the generic tool handlers (listTools and callTool) on the MCP server, which handle the 'create_hotel' tool via dispatch.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) )