Declarative API
A standard visible form becomes a browser-agent tool through semantic attributes. The 9bot resource form uses toolname, tooldescription, toolparamdescription, and toolautosubmit.
<form
toolname="explore_9bot_developer_resource"
tooldescription="Selects and opens a public 9bot developer resource."
toolautosubmit>
<label for="resource">Explore a resource</label>
<select id="resource" name="resource" required
toolparamdescription="The public 9bot resource to open.">
<option value="developers">Developer documentation</option>
<option value="openapi">OpenAPI specification</option>
<option value="mcp">MCP documentation</option>
</select>
<button type="submit">Open selected resource</button>
</form>
Imperative API
The public JavaScript checks for document.modelContext.registerTool and registers two focused, read-only tools:
get_9bot_capabilitiesreturns structured public capability information.open_9bot_resourceopens developer documentation, OpenAPI, MCP, WebMCP, authentication, or the trial page.
await document.modelContext.registerTool({
name: 'get_9bot_capabilities',
description: 'Returns a structured, read-only summary of 9bot capabilities.',
inputSchema: {
type: 'object',
properties: {
category: { type: 'string' }
}
},
execute: async ({ category = 'all' } = {}) => {
// Return public capability information.
}
});
Safety boundary
The website's WebMCP tools do not send WhatsApp messages, modify tenant settings, read private groups, or bypass OAuth. Operational access belongs to the authenticated MCP server.
Progressive enhancement
Browsers without WebMCP use the same interface as normal HTML and JavaScript. Unsupported experimental APIs are detected safely and do not generate user-facing errors.
Testing
- Load the 9bot home page or this page in a WebMCP-enabled browser build.
- Confirm that the declarative form appears as a registered tool.
- Confirm that
get_9bot_capabilitiesandopen_9bot_resourceappear as imperative tools. - Run the current Lighthouse agentic browsing audit and inspect registered WebMCP tools.
- Verify that a normal browser without WebMCP has no console errors and the form still works.