PageSourceSearch

https://pptr.dev/assets/js/5661c5f8.59125805.js

js pptr.dev collected 2026-09-24 07:03:28 UTC 6,529 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([["10188"],{52789(e,n,r){r.r(n),r.d(n,{metadata:()=>s,default:()=>a,frontMatter:()=>l,contentTitle:()=>d,toc:()=>o,assets:()=>c});var s=JSON.parse('{"id":"api/puppeteer.webmcptool","title":"WebMCPTool class","description":"Represents a registered WebMCP tool available on the page.","source":"@site/versioned_docs/version-25.12.0/api/puppeteer.webmcptool.md","sourceDirName":"api","slug":"/api/puppeteer.webmcptool","permalink":"/api/puppeteer.webmcptool","draft":false,"unlisted":false,"tags":[],"version":"25.12.0","frontMatter":{"sidebar_label":"WebMCPTool"},"sidebar":"api","previous":{"title":"WebMCP.tools","permalink":"/api/puppeteer.webmcp.tools"},"next":{"title":"WebMCPTool.execute","permalink":"/api/puppeteer.webmcptool.execute"}}'),t=r(74848),i=r(28453);let l={sidebar_label:"WebMCPTool"},d="WebMCPTool class",c={},o=[{value:"Signature",id:"signature",level:3},{value:"Remarks",id:"remarks",level:2},{value:"Properties",id:"properties",level:2},{value:"Methods",id:"methods",level:2}];function h(e){let n={a:"a",code:"code",h1:"h1",h2:"h2",h3:"h3",header:"header",p:"p",pre:"pre",strong:"strong",...(0,i.R)(),...e.components};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(n.header,{children:(0,t.jsx)(n.h1,{id:"webmcptool-class",children:"WebMCPTool class"})}),"\n",(0,t.jsx)(n.p,{children:"Represents a registered WebMCP tool available on the page."}),"\n",(0,t.jsx)(n.h3,{id:"signature",children:"Signature"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-typescript",children:"export declare class WebMCPTool extends EventEmitter<{\n    toolinvoked: WebMCPToolCall;\n}>\n"})}),"\n",(0,t.jsxs)(n.p,{children:[(0,t.jsx)(n.strong,{children:"Extends:"})," ",(0,t.jsx)(n.a,{href:"/api/puppeteer.eventemitter",children:"EventEmitter"}),"<{ toolinvoked: ",(0,t.jsx)(n.a,{href:"/api/puppeteer.webmcptoolcall",children:"WebMCPToolCall"}),"; }>"]}),"\n",(0,t.jsx)(n.h2,{id:"remarks",children:"Remarks"}),"\n",(0,t.jsxs)(n.p,{children:["The constructor for this class is marked as internal. Third-party code should not call the constructor directly or create subclasses that extend the ",(0,t.jsx)(n.code,{children:"WebMCPTool"})," class."]}),"\n",(0,t.jsx)(n.h2,{id:"properties",children:"Properties"}),"\n",(0,t.jsxs)("table",{children:[(0,t.jsx)("thead",{children:(0,t.jsxs)("tr",{children:[(0,t.jsx)("th",{children:(0,t.jsx)(n.p,{children:"Property"})}),(0,t.jsx)("th",{children:(0,t.jsx)(n.p,{children:"Modifiers"})}),(0,t.jsx)("th",{children:(0,t.jsx)(n.p,{children:"Type"})}),(0,t.jsx)("th",{children:(0,t.jsx)(n.p,{children:"Description"})})]})}),(0,t.jsxs)("tbody",{children:[(0,t.jsxs)("tr",{children:[(0,t.jsx)("td",{children:(0,t.jsx)("span",{id:"annotations",children:"annotations"})}),(0,t.jsx)("td",{children:(0,t.jsx)(n.p,{children:(0,t.jsx)(n.code,{children:"optional"})})}),(0,t.jsx)("td",{children:(0,t.jsx)(n.p,{children:"Protocol.WebMCP.Annotation"})}),(0,t.jsx)("td",{children:(0,t.jsx)(n.p,{children:"Optional annotations for the tool."})})]}),(0,t.jsxs)("tr",{children:[(0,t.jsx)("td",{children:(0,t.jsx)("span",{id:"description",children:"description"})}),(0,t.jsx)("td",{}),(0,t.jsx)("td",{children:(0,t.jsx)(n.p,{children:"string"})}),(0,t.jsx)("td",{children:(0,t.jsx)(n.p,{children:"Tool description."})})]}),(0,t.jsxs)("tr",{children:[(0,t.jsx)("td",{children:(0,t.jsx)("span",{id:"formelement",children:"formElement"})}),(0,t.jsx)("td",{children:(0,t.jsx)(n.p,{children:(0,t.jsx)(n.code,{children:"readonly"})})}),(0,t.jsx)("td",{children:(0,t.jsxs)(n.p,{children:["Promise<",(0,t.jsx)(n.a,{href:"/api/puppeteer.elementhandle",children:"ElementHandle"}),"<HTMLFormElement> | undefined>"]})}),(0,t.jsx)("td",{children:(0,t.jsx)(n.p,{children:"The corresponding ElementHandle when tool was registered via a form."})})]}),(0,t.jsxs)("tr",{children:[(0,t.jsx)("td",{children:(0,t.jsx)("span",{id:"frame",children:"frame"})}),(0,t.jsx)("td",{}),(0,t.jsx)("td",{children:(0,t.jsx)(n.p,{children:(0,t.jsx)(n.a,{href:"/api/puppeteer.frame",children:"Frame"})})}),(0,t.jsx)("td",{children:(0,t.jsx)(n.p,{children:"Frame the tool was defined for."})})]}),(0,t.jsxs)("tr",{children:[(0,t.jsx)("td",{children:(0,t.jsx)("span",{id:"inputschema",children:"inputSchema"})}),(0,t.jsx)("td",{children:(0,t.jsx)(n.p,{children:(0,t.jsx)(n.code,{children:"optional"})})}),(0,t.jsx)("td",{children:(0,t.jsx)(n.p,{children:"object"})}),(0,t.jsx)("td",{children:(0,t.jsx)(n.p,{children:"Schema for the tool's input parameters."})})]}),(0,t.jsxs)("tr",{children:[(0,t.jsx)("td",{children:(0,t.jsx)("span",{id:"location",children:"location"})}),(0,t.jsx)("td",{children:(0,t.jsx)(n.p,{children:(0,t.jsx)(n.code,{children:"optional"})})}),(0,t.jsx)("td",{children:(0,t.jsx)(n.p,{children:(0,t.jsx)(n.a,{href:"/api/puppeteer.consolemessagelocation",children:"ConsoleMessageLocation"})})}),(0,t.jsx)("td",{children:(0,t.jsx)(n.p,{children:"Source location that defined the tool (if available)."})})]}),(0,t.jsxs)("tr",{children:[(0,t.jsx)("td",{children:(0,t.jsx)("span",{id:"name",children:"name"})}),(0,t.jsx)("td",{}),(0,t.jsx)("td",{children:(0,t.jsx)(n.p,{children:"string"})}),(0,t.jsx)("td",{children:(0,t.jsx)(n.p,{children:"Tool name."})})]})]})]}),"\n",(0,t.jsx)(n.h2,{id:"methods",children:"Methods"}),"\n",(0,t.jsxs)("table",{children:[(0,t.jsx)("thead",{children:(0,t.jsxs)("tr",{children:[(0,t.jsx)("th",{children:(0,t.jsx)(n.p,{children:"Method"})}),(0,t.jsx)("th",{children:(0,t.jsx)(n.p,{children:"Modifiers"})}),(0,t.jsx)("th",{children:(0,t.jsx)(n.p,{children:"Description"})})]})}),(0,t.jsx)("tbody",{children:(0,t.jsxs)("tr",{children:[(0,t.jsx)("td",{children:(0,t.jsx)("span",{id:"execute",children:(0,t.jsx)(n.a,{href:"/api/puppeteer.webmcptool.execute",children:"execute(input, options)"})})}),(0,t.jsx)("td",{}),(0,t.jsx)("td",{children:(0,t.jsxs)(n.p,{children:["Executes tool with input parameters, matching tool's ",(0,t.jsx)(n.code,{children:"inputSchema"}),"."]})})]})})]})]})}function a(e={}){let{wrapper:n}={...(0,i.R)(),...e.components};return n?(0,t.jsx)(n,{...e,children:(0,t.jsx)(h,{...e})}):h(e)}},28453(e,n,r){r.d(n,{R:()=>l,x:()=>d});var s=r(96540);let t={},i=s.createContext(t);function l(e){let n=s.useContext(i);return s.useMemo(function(){return"function"==typeof e?e(n):{...n,...e}},[n,e])}function d(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(t):e.components||t:l(e.components),s.createElement(i.Provider,{value:n},e.children)}}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.