Skip to main content
Version: Next

WebMCPTool class

Represents a registered WebMCP tool available on the page.

Signature

export declare class WebMCPTool extends EventEmitter<{
toolinvoked: WebMCPToolCall;
}>

Extends: EventEmitter<{ toolinvoked: WebMCPToolCall; }>

Remarks

The constructor for this class is marked as internal. Third-party code should not call the constructor directly or create subclasses that extend the WebMCPTool class.

Properties

Property

Modifiers

Type

Description

annotations

optional

WebMCPAnnotation

Optional annotations for the tool.

description

string

Tool description.

formElement

readonly

Promise<ElementHandle<HTMLFormElement> | undefined>

The corresponding ElementHandle when tool was registered via a form.

frame

Frame

Frame the tool was defined for.

inputSchema

optional

object

Schema for the tool's input parameters.

location

optional

ConsoleMessageLocation

Source location that defined the tool (if available).

name

string

Tool name.