Hospitality WebMCP Template
An AI-agent-ready hotel website with 15 WebMCP tools for room search, booking, concierge services, spa reservations, and loyalty programs. Supports both imperative JavaScript and declarative HTML forms.
Load live preview on demand to keep template pages fast.
// Register search_rooms tool
navigator.modelContext.registerTool({
name: "search_rooms",
description: "Search available rooms by type, dates, guest count, and price range.",
inputSchema: {
"type": "object",
"properties": {
"room_type": {
"type": "string",
"enum": [
"standard",
"deluxe",
"suite",
"penthouse",
"villa"
],
"description": "Room category"
},
"check_in": {
"type": "string",
"description": "Check-in date (YYYY-MM-DD)"
},
"check_out": {
"type": "string",
"description": "Check-out date (YYYY-MM-DD)"
},
"guests": {
"type": "number",
"description": "Number of guests"
},
"price_max": {
"type": "number",
"description": "Maximum nightly rate in USD"
}
},
"required": [
"check_in",
"check_out"
]
},
annotations: {"readOnlyHint":true},
execute: async (params) => {
const response = await fetch("/api/search_rooms", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify(params),
});
return response.json();
}
});What's Included
Search rooms by type, dates, and guest count with real-time availability and instant booking.
AI agents can order room service, request amenities, and get local recommendations.
Browse treatments, check availability, and book spa sessions through structured tool calls.
Check points balance and redeem rewards with secure user-confirmed transactions.
HTML forms for room booking and room service that agents can fill and submit without JavaScript.
Room booking and point redemption require explicit user confirmation before processing.
Why This Template Works
Designed for AI agent interoperability with structured tool definitions.
End-to-End Guest Journey
Covers the full stay lifecycle — from searching rooms to check-out and loyalty rewards.
Rich Structured Data
Every tool returns typed JSON with room details, pricing, amenities, and availability — ready for agent reasoning.
Safe Transaction Pattern
Booking and point redemption use requestUserInteraction to ensure guests confirm before charges apply.
Concierge-Grade Intelligence
Local attractions, dining options, and directions give agents enough context to act as a virtual concierge.
Implementation Guide
Follow these steps to deploy the template on your website.
Add the HTML template
Copy the self-contained HTML into your hotel website. All styles and scripts are inline — no external dependencies.
Connect your PMS & booking engine
Replace the mock execute() functions with API calls to your property management system and booking engine.
Verify with an AI agent
Use an MCP-enabled browser to test the full search → book → room-service → check-out flow end to end.
Download Options
Other Industry Templates
Ready to Make Your Site Agent-Ready?
Deploy this template and start receiving structured traffic from AI agents.