update_hotel
Modify hotel details like name, description, contact information, and address in the LumbreTravel system to keep listings current and accurate.
Instructions
Actualizar un hotel
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"id": "<id>",
"name": "<name>",
"description": "<description>",
"phone": "<phone>",
"email": "<email>",
"address": "<address>"
},
"name": "update_hotel"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | ID del hotel a actualizar | |
| 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:1479-1485 (handler)The main handler logic for the 'update_hotel' tool within the callTool switch statement. It extracts arguments, calls the ApiService updateHotel method, and returns the result.
case 'update_hotel': { const { id, name, description, phone, email, address } = args const hotel = await this.apiService.updateHotel({ id, name, description, phone, email, address }) return { content: [{ type: 'text', text: JSON.stringify(hotel, null, 2) }] } } - The tool definition including name, description, and input schema in the listTools() method.
{ name: 'update_hotel', description: 'Actualizar un hotel', inputSchema: { type: 'object', properties: { id: { type: 'string', description: 'ID del hotel a actualizar' }, 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: ['id', 'name', 'description', 'phone', 'email', 'address'] } }, - src/services/api.service.ts:508-522 (helper)Supporting ApiService method that sends a PUT request to the external API endpoint to update a hotel.
async updateHotel (data: { id: string 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/update`, { method: 'PUT', 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 callTool handler, which dispatches to the specific tool handler based on name.
this.server.setRequestHandler( CallToolRequestSchema, async (request) => await this.toolsHandler.callTool(request.params.name, request.params.arguments, this.server) ) - src/index.ts:39-41 (registration)Server registration of the listTools handler, which returns the list of available tools including update_hotel.
ListToolsRequestSchema, async () => this.toolsHandler.listTools() )