Skip to main content
Glama

Interact with the page

computer

Controls 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

NameRequiredDescriptionDefault
refNoElement ref (alternative to coordinate)
textNoText to type, or key(s) to press (space-separated)
tabIdYesTarget tab ID (must be in the MCP group)
actionYesAction to perform
expectNoOptional postcondition: observes the declared UI outcome after one action; failure never repeats input
repeatNoRepeat count for key (1-200)
durationNoSeconds to wait (0-10)
modifiersNoModifier keys, e.g. "ctrl+shift"
allowFocusNoDefault 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.
coordinateNo[x, y] viewport coordinate
documentIdNoBind a resolved target to this document; stale documents fail before mutation
pointerModeNoDefault 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_amountNoScroll wheel ticks (default 3)
scroll_directionNo
start_coordinateNo[x, y] drag start for left_click_drag

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.24.1

TDQS

A4.1/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations supplied, the description carries the full burden and does so unusually well: it discloses failure semantics (stale ref fails before anything is typed, unknown key name is an error, a point over a frame is an error), non-obvious effects (scroll targets the nearest scrollable container, or the page, and reports `moved`/`reason` while still returning ok), and a capability limitation (sub-frame input is synthetic/untrusted, native widgets may not respond). These are exactly the traits an agent cannot infer from the schema.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Almost every clause carries real operational detail, but the whole thing is a single dense paragraph of chained conditionals, with no per-action structure or line breaks, making it hard to scan for the one action an agent needs. The leading sentence is front-loaded, but the remainder is a wall of text rather than an organized reference.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a 15-parameter, multi-action tool with no output schema, the definition covers the risky interactions thoroughly, including what `screenshot` returns (a PNG in CSS pixels, coordinates read off it are click coordinates) and what `scroll` reports. It is thinner on return values for the click/type/key actions and on the postcondition `expect` parameter, which is documented only in the schema.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 93%, so the baseline is 3, and the description adds genuine meaning on top: it defines what `ref` vs `coordinate` do mechanically (scroll-into-view, shadow-root reach, CSS pixels), specifies the key grammar accepted in `text` (named keys, chords like "ctrl+a", `modifiers` applied to every key), and explains `pointerMode` consequences. Several parameters (`expect`, `repeat`, `documentId`, `start_coordinate`, `duration`) are left entirely to the schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

Opens with a concrete scope statement ('Mouse/keyboard/screenshot interaction') and the body enumerates the exact action families it covers (pointer, type, key, scroll, screenshot). It also signals the relationship to siblings by noting refs come from read_page/find. It stops short of stating when to prefer this over the sibling `screenshot` or `fill_form` tools, which keeps it from a 5.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Gives explicit selection guidance between the two targeting modes: ref is scrolled into view first, coordinate is used in place so multiple coordinates read off one screenshot remain valid. It also states prerequisites (click the field before an unfocused `type`, use frame refs for sub-frame input, pointerMode:'browser' for points over frames). No sibling-level routing ('use X instead when...') is stated, so it falls just short of the top band.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.