AI agents are beginning to use the web the way humans do — browsing, clicking, filling forms, booking appointments. The websites that are ready for them will capture more business. The ones that are not will get skipped.
Making your site agent-ready does not mean rebuilding it. In most cases, it means auditing what you already have, fixing a few structural issues, and adding the right annotations. This guide walks you through the full process step by step.
What “agent-ready” means
An agent-ready website exposes structured, callable tools so AI agents can take action on your site — booking, searching, submitting — without guessing at your UI.
WebMCP is the browser standard that makes this possible. It is live in Chrome 146 as of February 2026.
Step 1: Run a Readiness Audit
Before writing a single line of code, assess where you stand. Most sites are further along than their owners realize. Check these four areas:
HTTPS Coverage
WebMCP APIs only activate in secure contexts. Every page on your site must be served over HTTPS. Run your domain through SSL Labs (ssllabs.com/ssltest/) to verify. Fix any mixed content warnings — pages loading HTTP resources over HTTPS.
Form Quality
Open every form on your site (contact, quote, booking, checkout) and check:
- Every input has a clear, descriptive name attribute (not “field1” or “input_a”)
- Every required field is marked required
- Input types are correct (type=”email”, type=”tel”, type=”url” not just type=”text” for everything)
- Form has a clear action — what happens when it is submitted?
- Success/error states are clear and reliable
If your forms pass this check, you are likely 80% ready for the Declarative API.
JavaScript Architecture
For the Imperative API, you need client-side JavaScript running on the page. Check whether your site uses a CMS or framework that restricts custom JS injection (some Wix/Squarespace plans do). WordPress, Shopify, and custom builds have no restrictions.
Tool Opportunity Mapping
Ask: what would I want an AI agent to do on my site? List the top 3–5 actions. These become your priority tools. Common ones for service businesses:
- Book a consultation or free audit
- Request a quote
- Search services by type or industry
- Get pricing information
- Find case studies or portfolio items
Step 2: Enable WebMCP in Chrome for Testing
Before you implement anything, set up your testing environment.
- Download Chrome Canary or Chrome Beta (requires Chrome 146+)
- Navigate to
chrome://flagsin the address bar - Search for “WebMCP” and set the flag to Enabled
- Relaunch Chrome
- Install the Model Context Tool Inspector extension from the Chrome Web Store
The Inspector lets you see registered tools on any page and test them with custom parameters — essential for debugging your implementation.
Step 3: Implement the Declarative API (Start Here)
The Declarative API is the fastest path to agent-readiness. It works by annotating existing HTML forms with two new attributes.
The Two Attributes You Need
- toolname: A camelCase identifier for the tool (e.g., bookFreeAudit, requestQuote, searchServices). Must be unique on the page.
- tooldescription: A plain-English description of what the tool does, what inputs it accepts, and what it returns. Write this for an AI agent, not a human.
Before and After Example
Before — standard HTML form:
<form action="/contact" method="POST">
<input name="name" type="text" required>
<input name="email" type="email" required>
<input name="website" type="url">
<button type="submit">Get Free Audit</button>
</form>
After — WebMCP Declarative API:
<form
action="/contact"
method="POST"
toolname="bookFreeAudit"
tooldescription="Book a free SEO audit with Salam Experts.
Accepts: name (full name, text), email (email address),
website (URL of site to audit). Returns: confirmation
message and estimated response time.">
<input name="name" type="text" required>
<input name="email" type="email" required>
<input name="website" type="url">
<button type="submit">Get Free Audit</button>
</form>
Writing good tool descriptions
State what it does (verb first): “Book a…”, “Search for…”, “Submit a…”, “Get pricing for…”
List the inputs and their expected format: name (text), email (email), budget (enum: starter/growth/enterprise)
State what it returns: “Returns confirmation ID” or “Returns list of matching services with pricing”
Keep it under 200 characters if possible — concise descriptions perform better with agents
Step 4: Implement the Imperative API (For Complex Flows)
When your tool needs custom logic — fetching data from an API, running calculations, or handling multi-step flows — use the Imperative API. It requires JavaScript but gives you full control.
Basic Structure
if ("modelContext" in navigator) {
navigator.modelContext.registerTool({
name: "searchServices",
description: "Search available SEO services by
type and industry. Returns matching packages
with descriptions and pricing.",
readOnly: true, // no user confirmation needed
inputSchema: {
type: "object",
properties: {
serviceType: {
type: "string",
enum: ["seo", "technical-seo", "shopify-seo"],
description: "Type of SEO service"
},
industry: {
type: "string",
description: "Target industry (optional)"
}
},
required: ["serviceType"]
},
async execute({ serviceType, industry }) {
const data = await fetch(
`/api/services?type=${serviceType}&industry=${industry || ""}`,
).then(r => r.json());
return { content: [{ type: "text",
text: JSON.stringify(data) }] };
}
});
}
Read-Only vs. Write Tools
Set readOnly: true for tools that only retrieve information (search, get pricing, list services). These do not require user confirmation — the agent can call them silently.
Set readOnly: false (or omit it) for tools that take action (booking, form submission, purchase). These trigger a browser confirmation prompt before the agent proceeds — keeping the human in the loop.
Step 5: Test With the Inspector
Once your tools are implemented, test them before going live:
- Open your site in Chrome with WebMCP enabled
- Open DevTools and navigate to the Model Context Tool Inspector tab
- Verify your tools appear in the tool list with correct names and descriptions
- Click each tool, enter test parameters, and confirm it executes correctly
- Check the response format — confirm it returns structured, useful data
- Test edge cases: empty required fields, invalid formats, slow network conditions
Common issues to watch for
- Tool not appearing: Check that navigator.modelContext exists and the script runs on page load
- Tool description truncated: Keep descriptions clear and under 250 characters
- Execution errors: Wrap all async operations in try/catch and return human-readable error messages
- Missing HTTPS: Tools will not register on HTTP pages — check your protocol
Step 6: Monitor and Maintain
WebMCP implementation is not set-and-forget. Track these after launch:
- Agent-invoked submissions: Use the SubmitEvent.agentInvoked flag server-side to log when an agent (not a human) triggers a form. Track volume over time.
- Tool error rates: Log execution errors from your tool handlers and alert on spikes.
- Spec updates: WebMCP is still evolving. Monitor the W3C GitHub repo and Chrome release notes for API changes.
- New tool opportunities: As you add new features or pages, evaluate whether they should expose new tools.
Quick Reference: Agent-Readiness Checklist
| Readiness Check | ☐ Done |
|---|---|
| All pages served over HTTPS | ☐ Done |
| Forms have descriptive name attributes | ☐ Done |
| Required fields marked required | ☐ Done |
| Correct input types (email, url, tel) | ☐ Done |
| Declarative API added to top 3 forms | ☐ Done |
| Tool descriptions written clearly | ☐ Done |
| Imperative API for complex tools | ☐ Done |
| Tested with Model Context Tool Inspector | ☐ Done |
| Agent invocation logging set up | ☐ Done |
Ready to implement WebMCP?
Not sure which steps apply to your site? Our free WebMCP Readiness Audit tells you exactly where you stand and what to fix first.
WebMCP Readiness AuditRelated Reading
- What Is WebMCP? Complete Guide
- WebMCP Declarative API Tutorial
- WebMCP Imperative API Guide
- WebMCP Implementation Services