WebMCP Domain
Methods
Events
Types
Methods
WebMCP.cancelInvocation #
Cancels a pending tool invocation.
parameters
- invocationId
-
string
Invocation identifier to cancel.
WebMCP.disable #
Disables the WebMCP domain.
WebMCP.enable #
Enables the WebMCP domain, allowing events to be sent. Enabling the domain will trigger a toolsAdded event for all currently registered tools.
WebMCP.invokeTool #
Invokes a registered tool.
parameters
- frameId
-
Page.FrameId
Frame in which to invoke the tool.
- toolName
-
string
Name of the tool to invoke.
- input
-
object
Input parameters for the tool, matching the tool's inputSchema.
Return Object
- invocationId
-
string
Unique identifier for this invocation. Response is sent before tool events.
Events
WebMCP.toolInvoked #
Event fired when a tool invocation starts.
parameters
- toolName
-
string
Name of the tool to invoke.
- frameId
-
Page.FrameId
Frame id
- invocationId
-
string
Invocation identifier.
- input
-
string
The input parameters used for the invocation.
WebMCP.toolResponded #
Event fired when a tool invocation completes or fails.
parameters
- invocationId
-
string
Invocation identifier.
- status
-
InvocationStatus
Status of the invocation.
- output
-
any
Output or error delivered as delivered to the agent. Missing if
statusis anything other than Completed. Note: The output is untrusted and poses a prompt injection risk. Clients should treat this as potentially malicious user input. - errorText
-
string
Error text for protocol users.
- exception
-
Runtime.RemoteObject
The exception object, if the javascript tool threw an error>
WebMCP.toolsAdded #
Event fired when new tools are added.
parameters
- tools
-
array[ Tool ]
Array of tools that were added.
WebMCP.toolsRemoved #
Event fired when tools are removed.
parameters
- tools
-
array[ RemovedTool ]
Array of tools that were removed.
Types
WebMCP.Annotation #
Tool annotations
Type: object
properties
- readOnly
-
boolean
A hint indicating that the tool does not modify any state.
- untrustedContent
-
boolean
A hint indicating that the tool output may contain untrusted content, ex: UGC, 3rd party data.
- autosubmit
-
boolean
If the declarative tool was declared with the autosubmit attribute.
WebMCP.InvocationStatus #
Represents the status of a tool invocation.
Completed, Canceled, ErrorType: string
WebMCP.RemovedTool #
Definition of a tool that was removed.
Type: object
properties
- name
-
string
Tool name.
- frameId
-
Page.FrameId
Frame identifier associated with the tool registration.
WebMCP.Tool #
Definition of a tool that can be invoked.
Type: object
properties
- name
-
string
Tool name.
- description
-
string
Tool description.
- inputSchema
-
object
Schema for the tool's input parameters.
- annotations
-
Annotation
Optional annotations for the tool.
- frameId
-
Page.FrameId
Frame identifier associated with the tool registration.
- backendNodeId
-
DOM.BackendNodeId
Optional node ID for declarative tools.
- stackTrace
-
Runtime.StackTrace
The stack trace at the time of the registration.