How to Deploy WebMCP Tools on Any Website Using GTM
By Bill Shultz | billshultz.com
Every WebMCP tutorial I have found assumes the same thing: you have direct access to your website’s source code, a comfortable relationship with JavaScript, and a developer standing by if things go sideways.
That describes maybe 10% of the people who actually manage websites.
The other 90% — marketers, consultants, agency practitioners, in-house SEO leads — manage sites built on WordPress, Drupal, or some enterprise CMS where touching the codebase requires a ticket, a sprint, and three rounds of approval.
There is a better way. If Google Tag Manager is already on your site, you can deploy WebMCP tools right now, today, without writing a single line of code into your CMS, without an API, and without a developer.
I know this because I have already done it — across a few live sites in completely different verticals. Here is exactly how.
What WebMCP Actually Is (The 60-Second Version)
WebMCP is a proposed W3C browser standard, co-authored by engineers at Google and Microsoft, that lets websites register structured tools directly in the browser. Those tools are discoverable and callable by AI agents — without screen-scraping, without DOM guessing, and without a backend server.
The technical mechanism is a browser API called navigator.modelContext. When a page loads, JavaScript registers tools onto that object. An AI agent running in a compatible browser (Chrome 146+ with WebMCP flags enabled, or Chrome 149+ via the origin trial) can see those tools, understand what they do, and invoke them directly.
Think of it this way: right now, AI agents interact with your website the way a tourist reads a menu in a foreign language — squinting, guessing, hoping for the best. WebMCP gives the agent a structured interface. It tells the agent exactly what your site can do and how to do it.
This is not theoretical. It is live in Chrome today.
Why GTM Is the Perfect Delivery Vehicle
The standard WebMCP implementation looks like this:
navigator.modelContext.registerTool({
name: "get_contact_info",
description: "Returns contact information for Bill Shultz",
inputSchema: { type: "object", properties: {} },
execute: async () => ({
name: "Bill Shultz",
email: "[email protected]",
website: "https://website.com"
})
});
That code needs to run in the browser on every page where you want the tool available. The traditional approach is to add it directly to your site’s source code or a theme file.
But Google Tag Manager already does exactly this — injects JavaScript into the browser on page load — across every page of your site, on any trigger you define, with zero CMS involvement. GTM is literally a remote JavaScript deployment system that every marketing team already controls.
The insight is simple: GTM Custom HTML tags are WebMCP tool containers. You paste your registerTool() code into a Custom HTML tag, set it to fire on All Pages, publish, and your WebMCP tools are live. On any CMS. Today.
No developer. No pull request. No deployment pipeline. No API.
What You Need Before You Start
- Google Tag Manager installed on your site (a standard GTM snippet in
<head>and<body>) - GTM publish access (Editor or Administrator role)
- Chrome 146 or higher for testing
- The Model Context Tool Inspector Chrome extension (search the Chrome Web Store — it lists all registered WebMCP tools on any page)
- About 15 minutes
That is the entire prerequisites list.
Step 1: Decide What Tools to Register
Before touching GTM, think about what an AI agent would actually want to do on your site. This is the same question you would ask for any structured data implementation — what is the most useful information or action you can expose?
ALL SITES: The Setup Context Tag
For a professional services site (like billshultz.com or fixclicks.net), useful tools include:
- Return contact and bio information
- List services offered
- Contact us form
For a medical practice (like medical.com):
- Return appointment booking information
- Describe procedures offered
- Personnel and location
For a local service business (like fixforu.com):
- Check whether an address falls within the service area
- Return service categories and descriptions
- Return a quote request contact path
For a portfolio site (like portfolio.com):
- List featured projects
- Return skills and technology stack
Start with static tools — tools that return fixed information. These require no backend, no API call in the execute function, just a JavaScript object returning data. They are the easiest to implement and still enormously useful for agents trying to understand your site.
Step 2: Write Your Tool Code
Here is a real example of a static WebMCP Tool Tag — the kind I deployed on fixforu.com for a Quote Tag (close to actual code):
modelContext.registerTool({
name: "getQuoteRequirements",
description: "Retrieves the mandatory information Jackson Enterprises needs from a customer before providing an estimate or quote. Execute this tool whenever a user asks about pricing, costs, or quotes.",
inputSchema: {
type: "object",
properties: {},
required: [] // No input required from the user, the AI just fires it!
},
execute: function() {
return new Promise(function(resolve) {
try {
// 👉 The exact items your brother needs from a lead
var quoteChecklist = [
"The town name, address, or zip code.",
"A brief description of the scope of work (e.g., size of the area, type of material, or specific problem).",
"The desired timeline for the project.",
"Any known site accessibility issues (e.g., narrow gates, steep hills, underground utilities)."
];
// We log this so you can track how often people ask for quotes!
console.log('🤖 WebMCP Tool Executed: Quote requirements served to AI.');
A few things to note about this code:
-
The
if ('modelContext' in navigator)check is not optional. This feature-detects WebMCP support before trying to use it. Without this check, the code throws a JavaScript error in every browser that does not support WebMCP — which is most of them right now. The check makes the implementation safe for all visitors regardless of browser. -
The
descriptionfield is the most important field you will write. This is what the AI agent reads to understand what the tool does and when to use it. Write it as a clear, natural language sentence. Treat it like alt text — precise, informative, not keyword-stuffed. -
The
executefunction returns a plain JavaScript object. For static tools, this is just data — no fetch calls, no async operations needed. Return whatever structured information you want the agent to have.
Step 3: Create the GTM Custom HTML Tag
- Plan your WebMCP Tags - I usually create one for the Quote/Contact Us page first
- Prompt AI to create your tag, trigger & variable if needed. AI will probably tell you the exact process to add to GTM if you ask it but the process is usually this:
-
Log into your Website’s GTM Container
-
Create a Trigger to fire on the /about/get-a-quote page (I usually create the Trigger before the Tag). Name it something like “Custom Event - Get a Quote”
-
Go to Tags → New and choose Custom HTML. Paste your WebMCP tool code into the HTML field — wrap it in
<script>tags & paste the code similar to above (copy the code your AI companion generated, but be sure to double check it of course):
if (!modelContext) {
return;
}
modelContext.registerTool({
name: "getQuoteRequirements",
description: "Retrieves the mandatory information Jackson Enterprises needs from a customer before providing an estimate or quote. Execute this tool whenever a user asks about pricing, costs, or quotes."
- Fire this Tag using the Trigger >> “Custom Event - Get a Quote”
- Save it, Preview it (it will show up in the preview mode), and Publish it
Your WebMCP tool is now live on the page you triggered. No CMS deployment. No API or submitting tickets to IT. Done.
Step 4: Check it with Chrome Inspect
Then open the Model Context Tool Inspector Chrome extension on that tab. You should see your tool listed in the extension panel. Click it — it will show you the tool name, description, and input schema exactly as an AI agent would see it.
If the tool appears in the Inspector, it is working. If it does not, check the GTM debug panel for JavaScript errors.
Be sure to check other pages that you don’t want the tag to fire!. When you start rolling out WebMCP tags, you will quickly learn a *CORE RULE:
- !!!!! BE SPECIFIC & KEEP ‘EM SHORT. Otherwise, the agents are going to get Lost in the Middle and start showing all kinds of hallucinations.
What I Have Deployed Across Five Sites
To demonstrate this is not theoretical, here is what is currently live:
billshultz.com — My personal authority site. Only a couple WebMCP Tool Tags running.
fixclicks.net — My consulting firm site, built on Joomla. GTM was already installed for analytics and schema delivery. WebMCP tools were added to the same container with zero Joomla involvement. About 15-20 or so pages, only 1-2 WebMCP Tool Tags running. I should do more.
medical.com — A surgical practice. Tools help agents answer patient questions about the practice, staff, procedures, location, and appointment pathways. GTM is the only deployment path available to me. 200+ Pages, 10+ WebMCP Tool Tags running (name withheld due to NDA).
This is a fun one & I learned quite a bit about how these WebMCP Tool Tags work with GTM here.
fixforu.com — A family-owned contractor business. Static tools expose service categories and geographic service area information. The most intuitive WebMCP use case: local service plus location check equals exactly what an agent needs to answer “can you help me in [city]?”. 20 pages, 4-5 WebMCP Tool Tags running (my bro’s site - he’s fine with it).
portfolio.com — A Power BI and data engineering portfolio site. Tools expose featured projects, technology stack (Snowflake, Microsoft Fabric, DAX, Power BI), and contact information for recruiters or potential clients navigating the portfolio via an AI agent. 20 pages, 2-3 WebMCP Tool Tags running (name withheld due to NDA)
Five sites. Three different CMS platforms. Five different verticals. Every implementation deployed through GTM, without touching a single CMS template or application file.
What About Dynamic Tools?
Everything above covers STATIC TOOLS — tools that return fixed data. That covers a surprisingly large percentage of useful agent interactions: contact info, service descriptions, business hours, team bios, product catalogs that do not change frequently.
DYNAMIC TOOLS — tools that query a live database, check real-time availability, or submit form data — require an execute function that makes an API call. The pattern looks like this:
execute: async (args) => {
const response = await fetch('/api/check-availability', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify(args)
});
return await response.json();
}
This still deploys through GTM the same way. The difference is that your backend needs an endpoint to receive the call. For most marketers, static tools are the right starting point — they deliver 80% of the value with none of the backend complexity.
The Bigger Picture: GTM as an Agent Optimization Layer
Here is what I think this actually means for digital marketing practice.
WebMCP is to AI agents what robots.txt and XML sitemaps were to search engine crawlers — a structured signal layer that helps machines understand your site’s capabilities. Sites that implement it early will have a meaningful advantage as agentic browsing matures.
But most of the content being written about WebMCP is written for developers. The tutorials assume source code access and a JavaScript development workflow.
GTM changes that equation entirely. Any marketer who already manages Google Analytics, conversion tracking, or remarketing pixels through GTM can deploy WebMCP tools using the exact same workflow they use today. The container is already there. The publish process is already understood. The trigger logic is already familiar.
This is not a developer capability. It is a marketer capability. And the marketers who figure that out first — before their competitors and before their agencies — will have established an agent-optimized presence while everyone else is still waiting for a developer to prioritize the ticket.
Getting Started Today
If GTM is on your site, you can have your first WebMCP Tool ‘Tag’ live within the hour. Start with a single static tool like the Quote Page.
Publish it & test it with the Chrome Inspector extension.
Then think about what an AI agent visiting your site actually needs to know to serve your customers or clients well. That question is the entire discipline in a single sentence.
The tools you register today are the ones agents will find tomorrow.
Bill Shultz is an enterprise digital marketing consultant with 20+ years of experience. He operates FixClicks LLC and writes about SEO, GTM, Analytics, Paid Search, and the emerging discipline of agent optimization at billshultz.com.