Expand description
WebMCP tool discovery and execution.
WebMCP is a protocol where websites expose structured
tool definitions to AI agents via navigator.modelContext. When a site
supports WebMCP, the tools are explicitly defined with typed parameters
and return values — the highest-reliability execution path.
WebMCP requires a browser context (the tools live in the page’s JS), but unlike DOM scraping, the tool contract is explicit and machine-readable.
Discovery is opportunistic: Cortex checks for WebMCP only when a browser context is already open (Layer 3 fallback or ACT). It never opens a browser just to check for WebMCP.
Structs§
- WebMcp
Result - Result of executing a WebMCP tool.
- WebMcp
Tool - A tool exposed by a web page via the WebMCP protocol.
Functions§
- discover_
webmcp_ tools - Discover WebMCP tools available on the current page.
- execute_
webmcp_ tool - Execute a WebMCP tool on the current page.
- find_
tool_ by_ name - Find a matching WebMCP tool by name from a list of discovered tools.
- find_
tools_ for_ opcode - Find WebMCP tools that match an opcode category.
- might_
have_ webmcp - Check if a page likely supports WebMCP by scanning its HTML source.