Interact with the page
computerControls browser pages by clicking, typing, scrolling, and capturing screenshots using element refs or viewport coordinates, so agents can perform and verify UI interactions.
Instructions
Mouse/keyboard/screenshot interaction. Provide ref (from read_page/find) or coordinate [x,y] in CSS pixels for pointer actions. A ref target is scrolled into view first; a coordinate is used where it is (the page is not scrolled, so several coordinates read off one screenshot stay valid) and reaches into open shadow roots, but a point over a frame is an error — use the control's frame ref (ref_N@frameId) or pointerMode:"browser". 'type' inserts text: with ref it focuses that field first (a stale ref fails before anything is typed); without ref it needs a focused editable element in the main frame (click it first — an unfocused type is an error). When focus is inside a frame, type with the field's own frame ref (ref_N@frameId); typing there is synthetic. 'key' presses keys into ref (focused first) or the focused element, space-separated: single characters or Enter/Tab/Escape/Backspace/Delete/Space/Home/End/PageUp/PageDown/Insert/ArrowUp|Down|Left|Right/F1-F12; chords like "ctrl+a" or "shift+Tab" are parsed, and modifiers (e.g. "ctrl+shift") applies to every key; an unknown key name is an error. 'scroll' scrolls the nearest container under ref/coordinate (default: the viewport centre) that can still move in that direction, else the page, as a wheel does (a point over a frame scrolls what is around the frame; with ref the scroll stays in that ref's own container and never moves the page behind it); moved says whether anything moved — false with a reason at an end or where nothing can scroll, and the call is still ok. 'screenshot' returns a PNG of the viewport in CSS pixels (coordinates read off it are click coordinates). Note: sub-frame input is synthetic (untrusted) — some native widgets may not respond.
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": {
"action": "<action>",
"tabId": "<tabId>"
},
"name": "computer"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ref | No | Element ref (alternative to coordinate) | |
| text | No | Text to type, or key(s) to press (space-separated) | |
| tabId | Yes | Target tab ID (must be in the MCP group) | |
| action | Yes | Action to perform | |
| expect | No | Optional postcondition: observes the declared UI outcome after one action; failure never repeats input | |
| repeat | No | Repeat count for key (1-200) | |
| duration | No | Seconds to wait (0-10) | |
| modifiers | No | Modifier keys, e.g. "ctrl+shift" | |
| allowFocus | No | Default false. Request focus for browser pointer clicks or screenshot fallback after background capture fails. Requires the user's popup setting 'Tillåt att agenter tar fram Chrome', which is off by default; otherwise FOCUS_DISABLED. Prefer background tools. | |
| coordinate | No | [x, y] viewport coordinate | |
| documentId | No | Bind a resolved target to this document; stale documents fail before mutation | |
| pointerMode | No | Default synthetic preserves background pointer behavior. browser sends trusted main-frame clicks through Chrome; supports left/right/double/triple click, requires focus, and never falls back or replays. Coordinates are CSS pixels. | |
| scroll_amount | No | Scroll wheel ticks (default 3) | |
| scroll_direction | No | ||
| start_coordinate | No | [x, y] drag start for left_click_drag |