Implement WebMCP Declarative API: annotate HTML forms with toolname/tooldescription attributes for automatic agent tool extraction and submission handling.
npx claudepluginhub orcaqubits/agentic-commerce-skills-plugins --plugin webmcp-browser-agentsThis skill is limited to using the following tools:
**Fetch live docs**:
Guides Next.js Cache Components and Partial Prerendering (PPR) with cacheComponents enabled. Implements 'use cache', cacheLife(), cacheTag(), revalidateTag(), static/dynamic optimization, and cache debugging.
Migrates code, prompts, and API calls from Claude Sonnet 4.0/4.5 or Opus 4.1 to Opus 4.5, updating model strings on Anthropic, AWS, GCP, Azure platforms.
Automates semantic versioning and release workflow for Claude Code plugins: bumps versions in package.json, marketplace.json, plugin.json; verifies builds; creates git tags, GitHub releases, changelogs.
Fetch live docs:
https://webmachinelearning.github.io/webmcp/ for the declarative form attribute specificationwebmcp declarative form toolname tooldescription HTML attributes for attribute syntax and behaviorsite:developer.chrome.com webmcp declarative forms for Chrome implementation detailswebmcp SubmitEvent agentInvoked for the agent submission event APIThe Declarative API lets developers make existing HTML forms agent-ready by adding attributes — no JavaScript required for basic cases. Chrome auto-extracts form tools and exposes them to agents.
| Attribute | Applied To | Purpose |
|---|---|---|
toolname | <form> | Unique tool name (becomes the tool's name) |
tooldescription | <form> | Natural-language description for the agent |
Standard name, type | <input>, <select>, <textarea> | Mapped to JSON Schema properties automatically |
toolname and tooldescription to a <form> elementSubmitEvent fires with agentInvoked property set to true<form toolname="searchProducts" tooldescription="Search the product catalog by keyword and price range">
<label>
Search: <input name="query" type="text" required />
</label>
<label>
Max Price: <input name="maxPrice" type="number" min="0" />
</label>
<label>
Category:
<select name="category">
<option value="all">All</option>
<option value="electronics">Electronics</option>
<option value="clothing">Clothing</option>
</select>
</label>
<button type="submit">Search</button>
</form>
form.addEventListener("submit", (event) => {
if (event.agentInvoked) {
// Agent submitted this form — handle programmatically
event.preventDefault();
const data = new FormData(form);
handleAgentSearch(Object.fromEntries(data));
}
// Otherwise, normal user submission
});
The browser infers JSON Schema from form fields:
<input type="text"> → { type: "string" }<input type="number"> → { type: "number" }<input type="email"> → { type: "string", format: "email" }<input required> → Added to required array<select> → { type: "string", enum: [...options] }<input type="checkbox"> → { type: "boolean" }| Scenario | Recommended |
|---|---|
| Simple search or filter forms | Declarative |
| Legacy server-rendered pages | Declarative |
| Complex multi-step interactions | Imperative |
| Dynamic SPA with state management | Imperative |
| Quick agent enablement of existing forms | Declarative |
| Tools that need user confirmation dialogs | Imperative |
| Both simple and complex on one page | Both |
A page can use both declarative forms and imperative tools simultaneously:
toolname/tooldescription attributesnavigator.modelContext.registerTool()toolname values that clearly identify the actiontooldescription for the agent, not the user — explain what the form does and what it returnsname attributes are semantic (query not q, maxPrice not mp)agentInvoked submissions gracefully — return structured data, not HTML redirectsrequired attributes to mandatory fields so the schema reflects themFetch the specification for exact attribute names, SubmitEvent properties, and schema inference rules before implementing.