execute-browser-commands
Runs a safe sequence of browser commands—click, type, navigate, wait, drag, scroll—to automate UI testing, extract element attributes, and control web pages.
Instructions
Executes a sequence of predefined browser commands safely. Available commands:
click: Clicks on an element matching the selector or at specified coordinates
type: Types text into an input element
wait: Waits for an element, a specified time period, or a condition
navigate: Navigates to a specified URL
select: Selects an option in a dropdown
check: Checks or unchecks a checkbox
hover: Hovers over an element
focus: Focuses an element
blur: Removes focus from an element
keypress: Simulates pressing a keyboard key
scroll: Scrolls the page or an element
getAttribute: Gets an attribute value from an element
getProperty: Gets a property value from an element
drag: Performs a drag operation from one position to another
refresh: Refreshes the current page
Note on coordinates: For all mouse-related commands (click, drag, etc.), coordinates are relative to the browser viewport where (0,0) is the top-left corner. X increases to the right, Y increases downward.
Examples are available in the schema definition.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"commands": "<commands>"
},
"name": "execute-browser-commands"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| timeout | No | Overall timeout in milliseconds (default: 30000) | |
| commands | Yes | Array of commands to execute in sequence | |
| contextId | No | Browser ID to execute commands on (uses most recent browser if not provided) |