# WebMCP

> How to declare a form as a callable tool with WebMCP: toolname, tooldescription, parameter descriptions, and the deprecated namespace.

This check reports without moving the score.

*These remediation guides are written in English.*

Today an agent that wants to use your form looks at pixels, guesses which field is which, types into them and hopes. WebMCP lets a page declare a form as a callable tool with named parameters, so the agent calls it instead of driving it.

```
<form toolname="searchDocs" tooldescription="Search the documentation">
  <input name="q" toolparamdescription="The search query">
</form>
```

> **This check never asks you to adopt it**
>
> WebMCP is a W3C Community Group draft with a Chrome origin trial, not a standard, not on by default, and not implemented in Firefox or Safari. Adoption is close to zero. The check scores nothing for lacking it and reports not applicable on a page with no forms. What it does is catch the mistakes a static read can be certain about, on pages that have already adopted it.

---

<a id="no-annotations"></a>

## Forms on the page, none declared as tools

Informational, and the reason it is worth knowing: a declared form is called by an agent rather than driven pixel by pixel. Search, filter and subscribe are the three worth declaring first, because they are the ones an agent is most often trying to reach on somebody's behalf.

Nothing breaks if you ignore this. It is a bet on where browser agents go next, and the cost of the bet is two attributes.

---

<a id="missing-description"></a>

## A named tool with no description

The form has `toolname` and no `tooldescription`. The description is what an agent reads to decide whether to call the tool at all, so a named tool without one is discoverable and unusable at the same time. The two attributes are required together, and this is the exact condition Lighthouse fails in its own WebMCP audit.

---

<a id="missing-name"></a>

## A description with no name

The mirror image: `tooldescription` without `toolname`. There is nothing to call. Usually a half-finished edit.

---

<a id="invalid-name"></a>

## A tool name an agent cannot call

Tool names are identifiers, not labels. Spaces, punctuation and accented characters make a name that cannot be referenced in a tool call. Use a short verb phrase in camel case.

```
<!-- no -->
<form toolname="Search the docs!">

<!-- yes -->
<form toolname="searchDocs" tooldescription="Search the documentation">
```

---

<a id="undescribed-params"></a>

## Parameters with no descriptions

The form is declared but its named controls carry no `toolparamdescription`. An agent then knows the tool exists and what it does, and has to guess what to put in each field, which is most of the problem WebMCP was meant to remove.

Describe the value, not the label. "The search query" is useful; "Query" repeats the field name back.

---

<a id="deprecated-namespace"></a>

## navigator.modelContext is deprecated

Chrome moved the imperative API to `document.modelContext`. While the origin trial runs, feature-detect both rather than picking one:

```
const ctx = document.modelContext ?? navigator.modelContext;
ctx?.registerTool({ name: "searchDocs", description: "Search the documentation" });
```

Tools registered this way cannot be validated from the HTML, so the check reports that they exist and stops there.

---

Markdown representation of https://axrush.com/guides/webmcp
