WebMCP

class WebMCP(cdp: CDP) : Domain

Constructors

Link copied to clipboard
constructor(cdp: CDP)

Types

Link copied to clipboard
@Serializable
data class Annotation(val readOnly: Boolean? = null, val autosubmit: Boolean? = null)

Tool annotations

Link copied to clipboard

Represents the status of a tool invocation.

Link copied to clipboard
@Serializable
data class Tool(val name: String, val description: String, val inputSchema: Map<String, JsonElement>? = null, val annotations: WebMCP.Annotation? = null, val frameId: String, val backendNodeId: Int? = null, val stackTrace: Runtime.StackTrace? = null)

Definition of a tool that can be invoked.

Link copied to clipboard
@Serializable
data class ToolInvokedParameter(val toolName: String, val frameId: String, val invocationId: String, val input: String)

Event fired when a tool invocation starts.

Link copied to clipboard
@Serializable
data class ToolRespondedParameter(val invocationId: String, val status: WebMCP.InvocationStatus, val output: JsonElement? = null, val errorText: String? = null, val exception: Runtime.RemoteObject? = null)

Event fired when a tool invocation completes or fails.

Link copied to clipboard
@Serializable
data class ToolsAddedParameter(val tools: List<WebMCP.Tool>)

Event fired when new tools are added.

Link copied to clipboard
@Serializable
data class ToolsRemovedParameter(val tools: List<WebMCP.Tool>)

Event fired when tools are removed.

Properties

Link copied to clipboard

Event fired when a tool invocation starts.

Link copied to clipboard

Event fired when a tool invocation completes or fails.

Link copied to clipboard

Event fired when new tools are added.

Link copied to clipboard

Event fired when tools are removed.

Functions

Link copied to clipboard
suspend fun disable(mode: CommandMode = CommandMode.DEFAULT)

Disables the WebMCP domain.

Link copied to clipboard
suspend fun enable(mode: CommandMode = CommandMode.DEFAULT)

Enables the WebMCP domain, allowing events to be sent. Enabling the domain will trigger a toolsAdded event for all currently registered tools.