/webmcp-browser-agents:webmcp-declarative-formsfrom webmcp-browser-agents
Annotates HTML forms with toolname and tooldescription attributes to make them agent-ready via the WebMCP Declarative API. Use to expose existing forms as tools with minimal code changes.
Ships in webmcp-browser-agents. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
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.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub orcaqubits/agentic-commerce-skills-plugins --plugin webmcp-browser-agents14 skills in this plugin
/webmcp-authenticationImplement WebMCP authentication patterns — browser session inheritance, cookie-based auth, role-gated tool registration, and conditional tool exposure. Use when managing which tools are available based on user authentication state./webmcp-commerce-toolsImplement commerce-specific WebMCP tools — product search, cart management, checkout, returns, subscriptions, and support. Use when building agentic shopping experiences on e-commerce websites./webmcp-context-providerImplement the WebMCP provideContext API — bulk tool registration, contextual metadata, page state sharing, and dynamic context updates. Use when providing rich context and multiple tools to agents simultaneously.Other plugins' skills for the same job