mirror of
https://github.com/hanzoai/puppeteer.git
synced 2026-09-24 17:02:14 +00:00
Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
1.4 KiB
1.4 KiB
sidebar_label
| sidebar_label |
|---|
| WebMCP |
WebMCP class
The experimental WebMCP class provides an API for the WebMCP API.
See the WebMCP guide for more details.
Signature
export declare class WebMCP extends EventEmitter<{
toolsadded: WebMCPToolsAddedEvent;
toolsremoved: WebMCPToolsRemovedEvent;
toolinvoked: WebMCPToolCall;
toolresponded: WebMCPToolCallResult;
}>
Extends: EventEmitter<{ toolsadded: WebMCPToolsAddedEvent; toolsremoved: WebMCPToolsRemovedEvent; toolinvoked: WebMCPToolCall; toolresponded: WebMCPToolCallResult; }>
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 WebMCP class.
Example
await page.goto('https://www.example.com');
const tools = page.webmcp.tools();
for (const tool of tools) {
console.log(`Tool found: ${tool.name} - ${tool.description}`);
}
Methods
|
Method |
Modifiers |
Description |
|---|---|---|
|
Gets all WebMCP tools defined by the page. |