> ## Documentation Index
> Fetch the complete documentation index at: https://docs.mcp-b.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# WebMCP declarative API

> Short reference and upstream links for the evolving HTML form integration.

The declarative API explores how HTML workflows, especially forms, can become
agent-readable tools while preserving browser validation and user review.

```html theme={null}
<form toolname="search_catalog" tooldescription="Search the product catalog">
  <label>
    Query
    <input name="query" required />
  </label>
  <button type="submit">Search</button>
</form>
```

The attribute names, schema synthesis rules, constraint mapping, submission
behavior, and iframe model are still evolving. Use Chrome's
[Declarative API docs](https://developer.chrome.com/docs/ai/webmcp/declarative-api),
the [official explainer](https://github.com/webmachinelearning/webmcp/blob/main/docs/explainer.md),
and the [declarative draft](https://github.com/webmachinelearning/webmcp/blob/main/docs/declarative.md)
as the current authorities. Do not treat this example as a stable compatibility
contract.

For production JavaScript integrations, use
[`document.modelContext.registerTool()`](/reference/webmcp/standard-api).
