Complete Guide

How to Make a Web Form Agent-Actionable: The Declarative WebMCP Guide

The declarative WebMCP API turns an HTML form you already have into a tool an AI agent can call, by adding two attributes to the form tag, no JavaScript and no server. This is the cheapest piece of real agent-actionability you can ship: the point where your site stops being something an agent merely reads and becomes something it can operate. This guide covers exactly what the two attributes do, how to name a tool so agents pick it, how to keep a human in the loop, the WordPress catch that your form is usually plugin-rendered (so you annotate via a filter, not a template edit), how to test it, and an honest account of what it is worth today: positioning and future-proofing, not a score bump.

7 min read 1,324 words Updated Jun 2026

This is a practical implementation guide by Sean Mullins of SEO Strategy Ltd, dated June 2026, for making a web form agent-actionable using the declarative WebMCP API. The declarative API converts an existing HTML form into a tool an AI agent can call by adding two required attributes to the form element: toolname (a verb-led action name) and tooldescription (what the tool does and what inputs it takes). The form’s fields, each needing a name attribute, become the tool’s parameters, and the browser generates a JSON tool schema automatically. By default the agent fills the fields visibly and waits for a human to submit; the optional toolautosubmit attribute allows automatic submission and should be reserved for read-only or low-risk actions. The API is experimental: it requires a recent Chrome build (early preview in Chrome 146, origin trial confirmed for Chrome 149) with the WebMCP testing flag enabled, and the declarative half of the spec is described by Chrome as still evolving. In WordPress, where forms are usually rendered by a plugin such as Formidable rather than the theme, the attributes should be added through the plugin’s form-HTML filter so they survive form edits, not via a template edit. The technique implements the fourth floor of the Four-Floor Model, agent execution, and is positioning and future-proofing today rather than a way to raise an Agentic Browsing audit score.

2 attributes a full declarative WebMCP tool needs only toolname and tooldescription on the form element; both are required, and omitting either prevents registration Chrome for Developers, WebMCP Declarative API, 2026
Chrome 149 the Chrome version in which the WebMCP origin trial was confirmed, after the early preview landed in Chrome 146 in February 2026; the testing flag is enable-webmcp-testing Chrome for Developers / WebMCP implementation reports, 2026
human-in-loop by default the agent populates form fields visibly and waits for the user to submit; auto-submission requires the optional toolautosubmit attribute and should be reserved for read-only or low-risk actions Chrome for Developers, WebMCP Declarative API, 2026

The declarative WebMCP API does something that sounds too small to matter: it turns an HTML form you already have into a tool an AI agent can call, by adding two attributes to the <form> tag. No JavaScript, no separate server. This is the cheapest piece of genuine agent-actionability you can ship, the point where your site stops being something an agent merely reads and becomes something it can operate. It is also experimental, gated behind a Chrome flag and an origin trial, and it will not move your Agentic Browsing audit score today. Build it as positioning and future-proofing, and know exactly what the two attributes do before you add them.

The whole declarative API is two attributes

Both attributes go on the <form> element itself, not a wrapping <div>, not the submit button. toolname names the tool; tooldescription says what it does. Miss either one and the browser does not register the form as a tool at all. Every input that should become a parameter needs a name attribute; inputs without one are silently dropped. The browser reads the form and generates a structured JSON tool schema from it, you write none of that schema by hand.

<form toolname="request_solar_quote"
              tooldescription="Request a solar installation quote. Collects property type, roof type and contact details.">
          <input type="text"  name="full_name">
          <input type="email" name="email">
          <select name="property_type" toolparamdescription="Type of property the quote is for.">
            <option>Detached house</option>
            <option>Commercial</option>
          </select>
          <button type="submit">Get my quote</button>
        </form>

One honesty note before you build on this: the declarative half of WebMCP is the less settled part of the spec, described by Chrome’s own team as an evolving direction rather than a finalised contract. The attribute names above are current as of writing; the durable advice in the rest of this guide will outlast them even if the syntax shifts.

Name the tool like the action it performs

Agents choose which tool to call from the name and description, so these are the new meta descriptions, conversion copy for a machine. Make toolname a clear verb-led action: request_solar_quote, book_appointment, search_catalogue, not form1. Make tooldescription specific about both the action and the inputs: “Search the catalogue by keyword, category and price” beats “Search”. Where a field is ambiguous, add toolparamdescription to it so the agent maps it correctly. And if your form uses custom UI, styled radio cards or a button group instead of a native <select>, add a hidden native <select> alongside it, because agents can only discover options through standard form elements.

Keep the human in the loop

By default, when an agent calls the tool the browser brings the form into focus, fills the fields visibly, and waits for the person to review and submit. That visible, human-confirmed execution is the entire safety model, and a trust feature, because the user watches the task happen rather than handing control to a black box. There is an optional toolautosubmit attribute that lets the agent submit without a click. Use it only for read-only or genuinely low-risk actions like search or lookup. For anything that creates a lead, a booking or a payment, leave it off. A quote request is a write action; the human confirms it.

The WordPress wrinkle: your form is probably not in your theme

This is where most WordPress implementations go wrong. If your form is rendered by a plugin, Formidable, Gravity Forms, Contact Form 7, the <form> tag is generated at runtime by the plugin, not sitting in a template file you can edit. Editing a page template will never catch it, and hand-editing the rendered markup breaks the moment someone re-saves the form in the plugin’s builder. The right move is to add the attributes through the plugin’s own form-HTML filter, so the annotation is applied every time the form renders and survives every future edit.

For Formidable, the durable approach is to filter the final rendered form HTML and inject the attributes into the opening <form tag:

add_filter( "frm_filter_final_form", function( $html ) {
            // Target only the relevant form (check its id) before injecting.
            return preg_replace(
                "/<form /",
                "<form toolname="request_solar_quote" tooldescription="Request a solar installation quote." ",
                $html,
                1
            );
        } );

Confirm the exact hook name against your installed Formidable version before relying on it. If a server-side filter is awkward, a small enqueued script that adds the attributes to the form by its container id on load is a workable fallback, it also survives form edits, though declarative-via-JavaScript is slightly less clean and the timing of registration can affect whether an audit snapshot catches it.

Test it before you trust it

The API is an early preview: you need a recent Chrome (the early preview landed in Chrome 146; the origin trial was confirmed for Chrome 149), with the WebMCP testing flag enabled at chrome://flags/#enable-webmcp-testing. Then, in DevTools, list the registered tools to confirm yours appears, and execute it with test input to dry-run the submit path. If your tool does not show up, work the checklist: are both toolname and tooldescription present and on the <form> itself? Is the form actually in the DOM (not hidden behind a conditional)? Does every input have a name?

Hold the imperative API for now

There is a richer, JavaScript-based path, navigator.modelContext.registerTool(), for exposing actions that are not forms, with a hand-written schema and an execute callback. It is genuinely interesting, and a strong thought-leadership angle, but it is more experimental and more involved, and not something to rush onto a live client site. One trap if you ever run both: a declarative tool and an imperative tool must have different names, or Chrome throws a duplicate-name error. Start declarative, on your highest-intent form, and learn from that.

What this is worth today

Be clear-eyed. This is experimental, it requires a bleeding-edge browser with a flag set, and it will not raise your Agentic Browsing audit score right now, that category is informational and the WebMCP checks need the origin trial. So why do it? Because it is two attributes; because the durable principles, name tools as actions, keep the human in the loop, annotate through a filter not a template, will outlast any change to the syntax; and because it is the on-site move that matches where this is heading. Once an agent is already on your site and ready to act, a callable tool is the fit, not a file that declares what you sell. This is the fourth floor of the Four-Floor Model, agent execution, made real on the one form that matters most to your business. The concept and the commercial case sit in the WebMCP guide; you can see our own agent-readiness verified on the proof page.

Currency note: the declarative attribute syntax is experimental and the specification is moving. Verify the attributes and the Chrome version against Chrome’s WebMCP documentation before you publish this or ship it to a client. The judgement in this guide, which form to expose, how to name it, when to allow auto-submit, how to annotate a plugin-rendered form, holds even if the exact attributes change.

Key Definitions

Declarative WebMCP API
A browser API that turns an existing HTML form into a tool an AI agent can call, by adding toolname and tooldescription attributes to the form element. The form fields become the tool’s parameters and the browser generates the JSON schema. It requires no JavaScript, contrasting with the imperative API.
toolname and tooldescription
The two required declarative WebMCP attributes on a form element. toolname is the action-oriented name an agent calls; tooldescription explains what the tool does and what inputs it expects. Agents select tools based on these, so they function like meta descriptions written for a machine. Omitting either prevents the form being registered as a tool.
toolautosubmit
An optional declarative WebMCP attribute that lets an agent submit a form without human action. When absent (the default), the browser fills fields visibly and waits for the user to review and submit, which is WebMCP’s core human-in-the-loop safety mechanism. It should be used only for read-only or low-risk actions, never for actions that create a lead, booking or payment.

How to Expose a Form to AI Agents with WebMCP

A practical sequence for turning a standard web form into one an AI agent can discover and complete, using WebMCP tool annotations.

  1. 1

    Choose the form to expose first

    Start with your single highest-intent conversion form, a quote request, booking or enquiry. One well-named tool on the form that matters most is worth more than blanket-annotating every form on the site.

  2. 2

    Add toolname and tooldescription to the form element

    Put both attributes on the form tag itself, not a wrapper or the submit button. Use a verb-led action name such as request_solar_quote, and a description specific about the action and its inputs. Omitting either attribute means the form is not registered as a tool.

  3. 3

    Make every parameter discoverable

    Ensure each input that should be a parameter has a name attribute, since inputs without one are dropped. Add toolparamdescription to ambiguous fields. If you use custom UI instead of a native select, add a hidden native select so the agent can discover the options.

  4. 4

    Decide on auto-submit deliberately

    Leave toolautosubmit off by default so the agent fills fields visibly and the human reviews and submits. Only add it for read-only or low-risk actions like search. Never auto-submit an action that creates a lead, booking or payment.

  5. 5

    Annotate plugin-rendered forms through a filter

    If the form is rendered by Formidable, Gravity Forms or Contact Form 7, do not edit a template. Add the attributes through the plugin’s form-HTML filter (for Formidable, filter the final rendered form HTML) so the annotation survives every future form edit. Confirm the exact hook against your installed version.

  6. 6

    Test before trusting

    On a recent Chrome with the WebMCP testing flag enabled, list registered tools in DevTools to confirm yours appears, then execute it with test input. If it is missing, check that both attributes are present and on the form, that the form is in the DOM, and that inputs have name attributes.

Frequently Asked Questions

Will adding WebMCP improve my Agentic Browsing audit score today?

No. The WebMCP checks are informational and require a recent Chrome with the origin trial enabled, so they will not raise your score right now. Add declarative WebMCP as positioning and future-proofing, not as an audit-score lever. The cheap audit wins today are a clean llms.txt, a sound accessibility tree and near-zero layout shift.

Do I need to know JavaScript to make my form agent-actionable?

No. The declarative API is two HTML attributes on the form element, toolname and tooldescription, plus a name attribute on each input. The browser builds the tool schema for you. JavaScript is only needed for the richer imperative API, which exposes non-form actions and is better held for later.

My form is built with Formidable or another plugin, how do I add the attributes?

Through the plugin’s form-HTML filter, not a template edit. The form tag is generated by the plugin at runtime, so a template change will not reach it and a hand-edit breaks on the next form save. For Formidable, filter the final rendered form HTML and inject the attributes into the opening form tag, so they reapply on every render. Confirm the exact hook against your installed version.

Is the declarative WebMCP API stable enough to rely on?

Not yet. It is an early preview, and the declarative half is the less settled part of the specification, described by Chrome as an evolving direction rather than a finalised contract. Verify the attribute syntax and Chrome version against the official documentation before publishing or shipping to a client. The strategic judgement, which form to expose and how to name it, holds even if the syntax changes.

Should I let agents submit my forms automatically?

Only for read-only or low-risk actions such as search or lookup, using the optional toolautosubmit attribute. For any form that creates a lead, a booking or a payment, leave auto-submit off so the agent fills the fields visibly and the person confirms the submission. That human-in-the-loop step is the core safety mechanism.

Sean Mullins

Founder of SEO Strategy Ltd with 20+ years in SEO, web development and digital marketing. Specialising in healthcare IT, legal services and SaaS — from technical audits to AI-assisted development.

Ready to improve your search visibility?

Book a free 30-minute consultation and let's discuss your SEO strategy.

Get in Touch