You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
description: `Evaluate a JavaScript function inside the currently selected page. Returns the response as JSON.`,
14
+
description: `Evaluate a JavaScript function inside the currently selected page. Returns the response as JSON
15
+
so returned values have to JSON-serializable.`,
14
16
annotations: {
15
17
category: ToolCategories.DEBUGGING,
16
18
readOnlyHint: false,
17
19
},
18
20
schema: {
19
-
function: z
20
-
.string()
21
-
.describe(
22
-
'A JavaScript function to run in the currently selected page. Example: `() => {return document.title}` or `async () => {return await fetch("example.com")}`',
23
-
),
21
+
function: z.string().describe(
22
+
`A JavaScript function to run in the currently selected page.
23
+
Example without arguments: \`() => {
24
+
return document.title
25
+
}\` or \`async () => {
26
+
return await fetch("example.com")
27
+
}\`.
28
+
Example with arguments: \`(el) => {
29
+
return el.innerText;
30
+
}\`
31
+
`,
32
+
),
33
+
args: z
34
+
.array(
35
+
z.object({
36
+
uid: z
37
+
.string()
38
+
.describe(
39
+
'The uid of an element on the page from the page content snapshot',
40
+
),
41
+
}),
42
+
)
43
+
.optional()
44
+
.describe(`An optional list of arguments to pass to the function.`),
0 commit comments