Add custom WebMCP tools
Add a namespaced batch of custom tools. A custom tool can be page-backed or CDP-backed.
Page-backed tools execute in the page via JavaScript. CDP-backed tools execute via CDP and
can use all browser REPL tools (see /repl). The source must evaluate to a non-empty array
of definitions with URL matchers, tool metadata (including an optional output schema), and
execute functions. The batch is added atomically. Matchers apply to top-level documents and
nested frames, including out-of-process iframes; each matching tool is exposed once on the
tab’s top-level document and appears in the WebMCP tool snapshot.
To update one tool, list the tools, delete its ID, and add its replacement. Set force_overwrite_namespace to replace every existing tool in the namespace atomically; omitted or false adds tools without replacing existing ones. Existing invocations continue.
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Browser session ID or name
Body
Source is limited to 8000000 UTF-8 bytes; the raw JSON body is limited to 8000000 bytes plus 4 KiB before decoding.
^[A-Za-z0-9_.-]{1,128}$JavaScript expression that evaluates to a non-empty array of custom tool definitions. Limited to 8,000,000 bytes when UTF-8 encoded, so multi-byte characters reduce the allowed character count.
8000000Atomically replace all existing tools in this namespace with this batch when true.
Response
Custom tools added. Contains only the newly added tools.