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: `Execute multiple browser actions in sequence with optimized response handling.RECOMMENDED:Use this tool instead of individual actions when performing multiple operations to significantly reduce token usage and improve performance.BY DEFAULT use for:form filling(multiple type→click),multi-step navigation,any workflow with 2+ known steps.Saves 90% tokens vs individual calls.globalExpectation:{includeSnapshot:false,snapshotOptions:{selector:"#app"},diffOptions:{enabled:true}}.Per-step override:steps[].expectation.Example:[{tool:"browser_navigate",arguments:{url:"https://example.com"}},{tool:"browser_type",arguments:{element:"username",ref:"#user",text:"john"}},{tool:"browser_click",arguments:{element:"submit",ref:"#btn"}}].Tool names must match exactly(e.g.browser_navigate,browser_click,browser_type).`,
16
+
description:
17
+
'Execute multiple browser actions in sequence. PREFER over individual tools for 2+ operations.',
description: `Handle a dialog(alert,confirm,prompt).accept:true to accept,false to dismiss.promptText:"answer" for prompt dialogs.expectation:{includeSnapshot:true} to see page after dialog handling.USE batch_execute if dialog appears during workflow.`,
10
+
description: 'Handle a dialog(alert,confirm,prompt)',
11
11
inputSchema: z.object({
12
-
accept: z.boolean().describe('Whether to accept the dialog.'),
13
-
promptText: z
14
-
.string()
15
-
.optional()
16
-
.describe('The text of the prompt in case of a prompt dialog.'),
17
-
expectation: expectationSchema,
12
+
accept: z.boolean().describe('Accept (true) or dismiss (false)'),
13
+
promptText: z.string().optional().describe('Text for prompt dialogs'),
14
+
expectation: expectationSchema.describe(
15
+
'Page state after dialog. Use batch_execute for workflows'
'System-generated element ID from previous tool results (e.g., "rNODE-45-1"). Never use custom values.'
25
23
),
26
-
expectation: expectationSchema,
24
+
expectation: expectationSchema.describe(
25
+
'Page state config. false for data extraction, true for DOM changes'
26
+
),
27
27
});
28
28
constevaluate=defineTabTool({
29
29
capability: 'core',
30
30
schema: {
31
31
name: 'browser_evaluate',
32
32
title: 'Evaluate JavaScript',
33
33
description:
34
-
'Evaluate JavaScript expression on page or element.Returns evaluation result.USE CASES:extract data,modify DOM,trigger events.expectation:{includeSnapshot:false} for data extraction,true if modifying page.element+ref to run on specific element.CONSIDER batch_execute for multiple evaluations.',
34
+
'Evaluate JavaScript expression on page or element and return result',
description: `Upload one or multiple files to file input.paths:["/path/file1.jpg","/path/file2.pdf"] for multiple files.expectation:{includeSnapshot:true,snapshotOptions:{selector:"form"}} to verify upload.Must be triggered after file input interaction.USE batch_execute for click→upload workflows.`,
10
+
description: 'Upload one or multiple files to file input',
11
11
inputSchema: z.object({
12
-
paths: z
13
-
.array(z.string())
14
-
.describe(
15
-
'The absolute paths to the files to upload. Can be a single file or multiple files.'
16
-
),
17
-
expectation: expectationSchema,
12
+
paths: z.array(z.string()).describe('Absolute paths to upload (array)'),
13
+
expectation: expectationSchema.describe(
14
+
'Page state config. Use batch_execute for click→upload'
'Press a key on the keyboard.Common keys:Enter,Escape,ArrowUp/Down/Left/Right,Tab,Backspace.expectation:{includeSnapshot:false} for navigation keys,true for content changes.CONSIDER batch_execute for multiple key presses.',
14
+
description: 'Press a key on the keyboard',
16
15
inputSchema: z.object({
17
-
key: z
18
-
.string()
19
-
.describe(
20
-
'Name of the key to press or a character to generate, such as `ArrowLeft` or `a`'
21
-
),
22
-
expectation: expectationSchema,
16
+
key: z.string().describe('Key to press'),
17
+
expectation: expectationSchema.describe(
18
+
'Page state config. Use batch_execute for multiple keys'
'System-generated element ID from previous tool results (e.g., "rNODE-45-1"). Never use custom values.'
45
+
'System-generated element ID from previous tool results. Never use custom values.'
49
46
),
50
-
text: z.string().describe('Text to type into the element'),
51
-
submit: z
52
-
.boolean()
53
-
.optional()
54
-
.describe('Whether to submit entered text (press Enter after)'),
47
+
text: z.string(),
48
+
submit: z.boolean().optional().describe('Press Enter after typing if true'),
55
49
slowly: z
56
50
.boolean()
57
51
.optional()
58
-
.describe(
59
-
'Whether type one character at a time. Useful for triggering key handlers in the page. By default entire text is filled in at once.'
60
-
),
61
-
expectation: expectationSchema,
52
+
.describe('Type slowly for auto-complete if true'),
53
+
expectation: expectationSchema.describe(
54
+
'Page state config. Use batch_execute for forms'
55
+
),
62
56
});
63
57
consttype=defineTabTool({
64
58
capability: 'core',
65
59
schema: {
66
60
name: 'browser_type',
67
61
title: 'Type text',
68
-
description: `Type text into editable element.FOR FORMS:Use batch_execute to fill multiple fields efficiently.slowly:true for auto-complete fields,submit:true to press Enter after.expectation:{includeSnapshot:false} when filling multiple fields(use batch),true for final verification.snapshotOptions:{selector:"form"} to focus on form only.diffOptions:{enabled:true} shows only what changed in form.`,
'Click at specific coordinates.Requires --caps=vision.x,y:click position.expectation:{includeSnapshot:true} to verify result.PREFER browser_click with element ref over coordinates.USE batch_execute for coordinate-based workflows.',
description: `Drag from one coordinate to another.Requires --caps=vision.startX,startY→endX,endY.expectation:{includeSnapshot:true,snapshotOptions:{selector:".drop-zone"}} to verify.PREFER browser_drag with element refs over coordinates.`,
73
+
description: 'Drag from one coordinate to another',
73
74
inputSchema: elementSchema.extend({
74
-
startX: z.number().describe('Start X coordinate'),
75
-
startY: z.number().describe('Start Y coordinate'),
76
-
endX: z.number().describe('End X coordinate'),
77
-
endY: z.number().describe('End Y coordinate'),
78
-
expectation: expectationSchema,
75
+
startX: z.number().describe('Start X (requires --caps=vision)'),
76
+
startY: z.number().describe('Start Y (requires --caps=vision)'),
77
+
endX: z.number().describe('End X'),
78
+
endY: z.number().describe('End Y'),
79
+
expectation: expectationSchema.describe(
80
+
'Page state after drag. Prefer element refs over coords'
Copy file name to clipboardExpand all lines: src/tools/navigate.ts
+8-10Lines changed: 8 additions & 10 deletions
Original file line number
Diff line number
Diff line change
@@ -12,10 +12,10 @@ const navigate = defineTool({
12
12
schema: {
13
13
name: 'browser_navigate',
14
14
title: 'Navigate to a URL',
15
-
description: `Navigate to a URL.expectation:{includeSnapshot:true} to see what loaded,false if you know what to do next.snapshotOptions:{selector:"#content"} to focus on main content(saves 50% tokens).diffOptions:{enabled:true} when revisiting pages to see only changes.CONSIDER batch_execute for navigate→interact workflows.`,
15
+
description: 'Navigate to a URL',
16
16
inputSchema: z.object({
17
17
url: z.string().describe('The URL to navigate to'),
18
-
expectation: expectationSchema,
18
+
expectation: expectationSchema.describe('Page state after navigation'),
'Go back to previous page.expectation:{includeSnapshot:true} to see previous page,false if continuing workflow.diffOptions:{enabled:true} shows only what changed from forward page.USE batch_execute for back→interact sequences.',
32
+
title: 'Go back to previous page',
33
+
description: 'Go back to previous page',
35
34
inputSchema: z.object({
36
-
expectation: expectationSchema,
35
+
expectation: expectationSchema.describe('Page state after going back'),
'Go forward to next page.expectation:{includeSnapshot:true} to see next page,false if continuing workflow.diffOptions:{enabled:true} shows only what changed from previous page.USE batch_execute for forward→interact sequences.',
48
+
title: 'Go forward to next page',
49
+
description: 'Go forward to next page',
52
50
inputSchema: z.object({
53
-
expectation: expectationSchema,
51
+
expectation: expectationSchema.describe('Page state after going forward'),
'Returns network requests since loading the page with optional filtering. urlPatterns:["api/users"] to filter by URL patterns. excludeUrlPatterns:["analytics"] to exclude specific patterns. statusRanges:[{min:200,max:299}] for success codes only. methods:["GET","POST"] to filter by HTTP method. maxRequests:10 to limit results. newestFirst:false for chronological order. Supports regex patterns for advanced filtering.',
45
+
'Returns network requests since loading the page with optional filtering',
0 commit comments