Elements
Elements — MCP tools exposed to agents.
34 tools in this group.
browser_find
Find an element and return its info (tag, text, bounding box). Use a CSS selector or a semantic locator (role, text, label, placeholder, testid, xpath, alt, title). Combine role with text or other locators to narrow results.
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
alt | string | no | Find element by alt attribute | |
index | integer | no | 0-based positional index: select the Nth match of the CSS selector (default: the first match). Mutually exclusive with last. | |
label | string | no | Find input by associated label text or aria-label | |
last | boolean | no | Select the last match of the CSS selector. Mutually exclusive with index. | |
placeholder | string | no | Find element by placeholder attribute | |
role | string | no | ARIA role to match (e.g., "button", "link", "textbox", "heading", "checkbox") | |
selector | string | no | CSS selector for the element to find | |
session | string | no | Optional: named session to run this call in (default: current session). | |
testid | string | no | Find element by data-testid attribute | |
text | string | no | Find element containing this text | |
timeout | integer | no | 30000 | Timeout in milliseconds (default: 30000) |
title | string | no | Find element by title attribute | |
xpath | string | no | Find element by XPath expression |
browser_find_all
Find all elements matching a CSS selector and return their info (tag, text, bounding box)
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
limit | integer | no | 10 | Maximum number of elements to return (default: 10) |
selector | string | yes | CSS selector to match elements | |
session | string | no | Optional: named session to run this call in (default: current session). |
browser_map
Map interactive page elements with @refs for targeting. Returns a list of interactive elements (buttons, links, inputs, etc.) each with a short @ref like @e1, @e2. Use these refs as selectors in other commands (click, fill, etc.).
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
selector | string | no | CSS selector to scope element discovery to a subtree (e.g. "nav", "#sidebar") | |
session | string | no | Optional: named session to run this call in (default: current session). |
browser_get_attribute
Get the value of an HTML attribute on an element
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
attribute | string | yes | Attribute name to retrieve (e.g., "href", "src", "class", "data-id") | |
selector | string | yes | CSS selector for the element | |
session | string | no | Optional: named session to run this call in (default: current session). |
browser_get_value
Get the current value of an input, textarea, or select element
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
selector | string | yes | CSS selector for the form element | |
session | string | no | Optional: named session to run this call in (default: current session). |
browser_count
Count the number of elements matching a CSS selector
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
selector | string | yes | CSS selector to count matches for | |
session | string | no | Optional: named session to run this call in (default: current session). |
browser_is_visible
Check if an element is visible on the page. Returns true/false; an element that does not exist is false. Errors only when the check itself cannot run (invalid selector, lost browser connection).
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
selector | string | yes | CSS selector for the element | |
session | string | no | Optional: named session to run this call in (default: current session). |
browser_is_enabled
Check if an element is enabled (not disabled). Returns true/false.
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
selector | string | yes | CSS selector or @ref for the element | |
session | string | no | Optional: named session to run this call in (default: current session). |
browser_is_checked
Check if a checkbox or radio button is checked. Returns true/false.
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
selector | string | yes | CSS selector or @ref for the checkbox/radio element | |
session | string | no | Optional: named session to run this call in (default: current session). |
browser_expect
Assert a condition about the current page (URL, title, text, element state, count, or a JS expression). Returns a PASS message when the assertion holds; fails with the actual value otherwise. Use this to verify a browser flow reached the expected state.
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
expected | string | number | boolean | no | Expected value: the string/substring for url, title, text, and value targets, or the element count for the count target | |
expression | string | no | JavaScript expression for the "js" target; the assertion passes when it evaluates to a truthy value (false, null, empty string, 0, and errors fail) | |
negate | boolean | no | false | Invert the assertion (e.g. target "checked" with negate asserts the box is unchecked). Default: false |
operator | string | no | How to compare the actual value with "expected" for the url, title, text, and value targets (default: "contains") (one of: contains, equals) | |
selector | string | no | CSS selector or @ref: required for visible, hidden, enabled, checked, value, and count targets; optional for text (defaults to full page text) | |
session | string | no | Optional: named session to run this call in (default: current session). | |
target | string | yes | What to assert on: "url", "title", "text" (page or element text), "visible", "hidden" (absent or not visible), "enabled", "checked" (element state), "value" (form element value), "count" (matching-element count), or "js" (expression truthiness) (one of: url, title, text, visible, hidden, enabled, checked, value, count, js) |
browser_click
Click an element by CSS selector. Waits for element to be visible, stable, and enabled.
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
index | integer | no | 0-based positional index: select the Nth match of the CSS selector (default: the first match). Mutually exclusive with last. | |
last | boolean | no | Select the last match of the CSS selector. Mutually exclusive with index. | |
selector | string | yes | CSS selector for the element to click | |
session | string | no | Optional: named session to run this call in (default: current session). | |
timeout | integer | no | 30000 | Timeout in milliseconds (default: 30000) |
browser_dblclick
Double-click an element by CSS selector or @ref
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
index | integer | no | 0-based positional index: select the Nth match of the CSS selector (default: the first match). Mutually exclusive with last. | |
last | boolean | no | Select the last match of the CSS selector. Mutually exclusive with index. | |
selector | string | yes | CSS selector or @ref for the element to double-click | |
session | string | no | Optional: named session to run this call in (default: current session). |
browser_hover
Hover over an element by CSS selector
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
index | integer | no | 0-based positional index: select the Nth match of the CSS selector (default: the first match). Mutually exclusive with last. | |
last | boolean | no | Select the last match of the CSS selector. Mutually exclusive with index. | |
selector | string | yes | CSS selector for the element to hover over | |
session | string | no | Optional: named session to run this call in (default: current session). |
browser_type
Type text into an element by CSS selector. Waits for element to be visible, stable, enabled, and editable.
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
index | integer | no | 0-based positional index: select the Nth match of the CSS selector (default: the first match). Mutually exclusive with last. | |
last | boolean | no | Select the last match of the CSS selector. Mutually exclusive with index. | |
selector | string | yes | CSS selector for the element to type into | |
session | string | no | Optional: named session to run this call in (default: current session). | |
text | string | yes | The text to type | |
timeout | integer | no | 30000 | Timeout in milliseconds (default: 30000) |
browser_fill
Clear an input field and type new text. Waits for element to be editable, clears existing value, then types. Use this instead of browser_type when you want to replace the field contents.
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
index | integer | no | 0-based positional index: select the Nth match of the CSS selector (default: the first match). Mutually exclusive with last. | |
last | boolean | no | Select the last match of the CSS selector. Mutually exclusive with index. | |
selector | string | yes | CSS selector for the input element | |
session | string | no | Optional: named session to run this call in (default: current session). | |
text | string | yes | The text to fill in |
browser_press
Press a key or key combination on a specific element or the focused element. If selector is given, clicks the element first to focus it, then presses the key.
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
key | string | yes | Key or key combination to press (e.g., "Enter", "Control+a", "Escape") | |
selector | string | no | CSS selector for the element to focus before pressing (optional, defaults to currently focused element) | |
session | string | no | Optional: named session to run this call in (default: current session). |
browser_keys
Press a key or key combination (e.g., "Enter", "Control+a", "Shift+Tab")
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
keys | string | yes | Key or key combination to press (e.g., "Enter", "Control+a", "Shift+ArrowDown") | |
session | string | no | Optional: named session to run this call in (default: current session). |
browser_keyboard_type
Type text at the current focus, generating real key events. No selector — acts on the focused element.
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
session | string | no | Optional: named session to run this call in (default: current session). | |
text | string | yes | Text to type at the focused element |
browser_keyboard_inserttext
Insert text at the current focus WITHOUT synthesizing key events (IME/paste-like). No selector.
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
session | string | no | Optional: named session to run this call in (default: current session). | |
text | string | yes | Text to insert at the focused element |
browser_keydown
Press and hold a key without releasing it (pair with browser_keyup for held-modifier sequences).
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
key | string | yes | Key to hold down (e.g., "Shift", "Control", "a") | |
session | string | no | Optional: named session to run this call in (default: current session). |
browser_keyup
Release a held key (pair with browser_keydown).
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
key | string | yes | Key to release (e.g., "Shift", "Control", "a") | |
session | string | no | Optional: named session to run this call in (default: current session). |
browser_select
Select an option in a <select> element by value
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
index | integer | no | 0-based positional index: select the Nth match of the CSS selector (default: the first match). Mutually exclusive with last. | |
last | boolean | no | Select the last match of the CSS selector. Mutually exclusive with index. | |
selector | string | yes | CSS selector for the <select> element | |
session | string | no | Optional: named session to run this call in (default: current session). | |
value | string | yes | The value to select |
browser_check
Check a checkbox or radio button. Idempotent — does nothing if already checked.
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
index | integer | no | 0-based positional index: select the Nth match of the CSS selector (default: the first match). Mutually exclusive with last. | |
last | boolean | no | Select the last match of the CSS selector. Mutually exclusive with index. | |
selector | string | yes | CSS selector for the checkbox or radio button | |
session | string | no | Optional: named session to run this call in (default: current session). |
browser_uncheck
Uncheck a checkbox. Idempotent — does nothing if already unchecked.
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
index | integer | no | 0-based positional index: select the Nth match of the CSS selector (default: the first match). Mutually exclusive with last. | |
last | boolean | no | Select the last match of the CSS selector. Mutually exclusive with index. | |
selector | string | yes | CSS selector for the checkbox | |
session | string | no | Optional: named session to run this call in (default: current session). |
browser_focus
Focus an element by CSS selector or @ref
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
index | integer | no | 0-based positional index: select the Nth match of the CSS selector (default: the first match). Mutually exclusive with last. | |
last | boolean | no | Select the last match of the CSS selector. Mutually exclusive with index. | |
selector | string | yes | CSS selector or @ref for the element to focus | |
session | string | no | Optional: named session to run this call in (default: current session). |
browser_scroll
Scroll the page or a specific element
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
amount | integer | no | 3 | Number of scroll increments (default: 3) |
direction | string | no | "down" | Scroll direction: up, down, left, right (default: down) (one of: up, down, left, right) |
selector | string | no | CSS selector for element to scroll to (optional, defaults to viewport center) | |
session | string | no | Optional: named session to run this call in (default: current session). |
browser_scroll_into_view
Scroll an element into view, centering it on screen
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
selector | string | yes | CSS selector for the element to scroll into view | |
session | string | no | Optional: named session to run this call in (default: current session). |
browser_mouse_click
Click at coordinates or at the current mouse position. If x and y are provided, moves the mouse there first.
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
button | integer | no | 0 | Mouse button (0=left, 1=middle, 2=right). Default: 0 |
session | string | no | Optional: named session to run this call in (default: current session). | |
x | number | no | X coordinate to click at | |
y | number | no | Y coordinate to click at |
browser_mouse_move
Move the mouse to specific coordinates
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
session | string | no | Optional: named session to run this call in (default: current session). | |
x | number | yes | X coordinate | |
y | number | yes | Y coordinate |
browser_mouse_down
Press a mouse button down at the current position
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
button | integer | no | 0 | Mouse button (0=left, 1=middle, 2=right). Default: 0 |
session | string | no | Optional: named session to run this call in (default: current session). |
browser_mouse_up
Release a mouse button at the current position
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
button | integer | no | 0 | Mouse button (0=left, 1=middle, 2=right). Default: 0 |
session | string | no | Optional: named session to run this call in (default: current session). |
browser_drag
Drag from one element to another
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
session | string | no | Optional: named session to run this call in (default: current session). | |
source | string | yes | CSS selector or @ref for the source element | |
target | string | yes | CSS selector or @ref for the target element |
browser_upload
Set files on an input[type=file] element
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
files | array | yes | Array of absolute file paths to upload | |
selector | string | yes | CSS selector for the file input element | |
session | string | no | Optional: named session to run this call in (default: current session). |
browser_highlight
Highlight an element with a red outline for 3 seconds. Useful for visual debugging.
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
selector | string | yes | CSS selector or @ref for the element to highlight | |
session | string | no | Optional: named session to run this call in (default: current session). |