Fitness WebMCP Template
A complete AI-agent-ready fitness studio platform with 15 WebMCP tools for class booking, membership signups, personal training, and facility info. Supports both imperative JavaScript and declarative HTML integration.
Load live preview on demand to keep template pages fast.
// Register get_classes tool
navigator.modelContext.registerTool({
name: "get_classes",
description: "Browse fitness classes by type, time, and instructor.",
inputSchema: {
"type": "object",
"properties": {
"class_type": {
"type": "string",
"enum": [
"yoga",
"hiit",
"spin",
"pilates",
"boxing",
"strength",
"dance",
"stretch"
],
"description": "Type of fitness class"
},
"day": {
"type": "string",
"enum": [
"monday",
"tuesday",
"wednesday",
"thursday",
"friday",
"saturday",
"sunday"
],
"description": "Day of the week"
},
"instructor": {
"type": "string",
"description": "Instructor name"
},
"page": {
"type": "number",
"description": "Page number (1-indexed)"
}
},
"required": []
},
annotations: {"readOnlyHint":true},
execute: async (params) => {
const response = await fetch("/api/get_classes", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify(params),
});
return response.json();
}
});What's Included
Browse, filter, and explore fitness classes by type, time, instructor, and difficulty.
Full class booking flow with availability checks, confirmation, and cancellation support.
Membership plans, pricing tiers, and signup with user confirmation for payment.
Trainer profiles, availability, and session booking for one-on-one coaching.
Class booking and membership forms that agents can submit without JavaScript.
Membership signup requires explicit user confirmation before processing payment.
Why This Template Works
Designed for AI agent interoperability with structured tool definitions.
Complete Fitness Journey
Covers every step from class discovery to booking and membership signup, so agents never hit a dead end.
Structured Schedule Data
Tools return typed JSON with times, availability, trainer info, and pricing — no scraping needed.
Safe Payment Pattern
The membership signup tool uses requestUserInteraction to ensure members confirm before payment processes.
Dual API Surface
Imperative JS for rich agents and declarative HTML forms for simpler crawlers — both work out of the box.
Implementation Guide
Follow these steps to deploy the template on your website.
Drop in the HTML
Copy the template HTML into your site. All tools and styles are self-contained — no external dependencies.
Wire up your fitness API
Replace the mock execute() functions with real fetch() calls to your class schedule, booking, and membership APIs.
Test with an AI agent
Open the page in an MCP-capable browser or test harness and verify the full browse, book, and signup flow.
Download Options
Other Industry Templates
Ready to Make Your Site Agent-Ready?
Deploy this template and start receiving structured traffic from AI agents.