Skip to main content
Glama

browser_click

Click a DOM element in Chrome/Edge by CSS selector or semantic text, role, or ARIA label; it stops on ambiguity or blocking modals and reports delivery status.

Instructions

Click a DOM element in Chrome/Edge. Two ways to target: (1) selector — a CSS selector (combines browser_locate + mouse_click; stable across repaints); or (2) by-axis (semantic) — by:'text'|'regex'|'role'|'ariaLabel' + pattern, so you do not have to build a CSS selector for dynamic-class SPAs. by-axis resolves to a SINGLE actionable element (climbing to a clickable ancestor up to 3 levels, hit-testing for occlusion) and STOPS with code:'BrowserAmbiguousTarget' (candidates[] + next[] hints) when 2+ actionable elements match, or code:'BrowserNoActionableTarget' when matches exist but none is clickable — it never guesses. If the target is behind a modal dialog blocking the page, BOTH targeting modes STOP with code:'BrowserModalBlocking' (context.blockingElement {name, role}) instead of clicking through to the backdrop — dismiss the dialog (its close button or Escape) and retry; a plain navigation drawer does not count as blocking. Optionally add role to filter (by:'text',pattern:'Save',role:'button') and scope to narrow the search. Provide EITHER selector OR by+pattern (not both). Pass tabId+port so the server auto-guards (verifies tab readyState and identity) and returns post.perception.status. lensId is optional for advanced pinned-tab workflows. Caveats: selector mode fails if the element is outside the visible viewport — scroll it into view with browser_eval("document.querySelector('sel').scrollIntoView()") first (by-axis only resolves in-viewport actionable targets). hints.verifyDelivery:{status:'delivered'|'unverifiable', reason, observedSignals:{mutationCount,urlChanged,activeElementChanged}} reports the post-click observation in 2 values: 'delivered' fires only when mutationCount>0 OR urlChanged (activeElementChanged is recorded in observedSignals but intentionally NOT a delivery signal — plain clicks on focusable controls always update focus, treating that as 'delivered' would mask silent-fail regressions); 'unverifiable' reason ∈ {'iframe_context_mismatch','no_dom_mutation','probe_install_failed','probe_read_failed'}. CDP emits 2 values only (focus_only is a UIA-path concept, N/A here). BrowserClickNotDelivered is reserved-only (false-positive risk too high to emit) — degradation reads from 'unverifiable' status.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
byNoSemantic axis to target by INSTEAD of a CSS selector: 'text' (visible text), 'regex', 'role' (ARIA/implicit role), 'ariaLabel'. Pair with `pattern`. The server resolves to a SINGLE actionable element — climbing to a clickable ancestor up to 3 levels — and STOPS with a candidate list (code:'BrowserAmbiguousTarget') if the match is ambiguous; it never guesses.
portNoChrome/Edge CDP remote debugging port (default 9222; configurable via desktop-touch-config.json)
roleNoOptional ARIA/implicit-role filter AND-combined with `by` (e.g. by:'text', pattern:'Save', role:'button').
fixIdNoApprove a pending suggestedFix (one-shot, 15s TTL). Selector mode only.
scopeNoOptional CSS selector to limit the `by`-axis search scope (disambiguation).
tabIdNoTab ID from browser_open. Omit to use the first page tab.
lensIdNoOptional perception lens ID. Guards (target.identityStable) are evaluated before clicking, and a perception envelope is attached to post.perception on success.
includeNoOptional response-shape opt-in. `['envelope']` returns the self-documenting envelope (`_version` / `data` / `as_of` / `confidence`). `['raw']` forces raw shape (overrides DESKTOP_TOUCH_ENVELOPE=1 server default). Default behaviour is raw shape (compat with existing clients).
narrateNoNarration level. "rich": include UIA diff in post.rich (appeared/disappeared/valueDeltas, and nameDeltas when an element's name changed, such as a calculator display) — usually removes the need for a verification screenshot. It is withheld, with post.rich.diffDegraded saying why, when the diff cannot be shown to describe the window that was acted on. On click_element and keyboard (and set_element_value where the server registers it), which resolve the target window before acting: another open window's title contains the text this call resolved to, whether you named the hwnd or the server did — "@active" and the dialog rescue both resolve one ("ambiguous_title"); or the target moved between the snapshot and the action ("target_changed"). On those and on mouse_click, retrying with a fixId also withholds it, because the stored fix names a window this cannot see ("fix_target_unknown") — browser tools keep their diff on a fixId retry, because theirs is a tab diff and does not depend on a window title. mouse_click and mouse_drag accept an hwnd and still take their snapshots by windowTitle, so nothing else is withheld for them: verify those with a screenshot. A window too large to read whole is withheld too ("tree_truncated"). The action itself is unaffected in every case; only the diff is. Default: "minimal".minimal
patternNoValue matched against the chosen `by` axis (required when `by` is set).
selectorNoCSS selector for the target element (e.g. '#submit', '.btn'). Provide EITHER selector OR by+pattern.
caseSensitiveNoCase-sensitive matching for by:'text'/'regex' (default false).
scrollIntoViewNoWhen true, if the target is outside the viewport, scroll it into view (centered) before clicking, instead of failing with ElementNotInViewport. Default false preserves the explicit scrollIntoView-then-retry workflow. Selector mode only (by-axis resolves only in-viewport actionable targets).

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed9 schema fields changedv2.3.1
    • addedInput schema / $schema
      Added value: +"http://json-schema.org/draft-07/schema#"
    • removedInput schema / additionalProperties
      Removed value: -false
    • changedInput schema / properties / by / description
      Previous value: -"Semantic axis to target by INSTEAD of a CSS selector: 'text' (visible text), 'regex', 'role' (ARIA/implicit role), 'ariaLabel'. Pair with pattern. Resolves to a SINGLE actionable element and STOPS with candidates when ambiguous."New value: +"Semantic axis to target by INSTEAD of a CSS selector: 'text' (visible text), 'regex', 'role' (ARIA/implicit role), 'ariaLabel'. Pair with `pattern`. The server resolves to a SINGLE actionable element — climbing to a clickable ancestor up to 3 levels — and STOPS with a candidate list (code:'BrowserAmbiguousTarget') if the match is ambiguous; it never guesses."
    • changedInput schema / properties / narrate / description
      Previous value: -"Narration level. rich includes UIA or browser state diff when supported, and is withheld with post.rich.diffDegraded when the diff cannot be shown to describe the window that was acted on."New value: +"Narration level. \"rich\": include UIA diff in post.rich (appeared/disappeared/valueDeltas, and nameDeltas when an element's name changed, such as a calculator display) — usually removes the need for a verification screenshot. It is withheld, with post.rich.diffDegraded saying why, when the diff cannot be shown to describe the window that was acted on. On click_element and keyboard (and set_element_value where the server registers it), which resolve the target window before acting: another open window's title contains the text this call resolved to, whether you named the hwnd or the server did — \"@active\" and the dialog rescue both resolve one (\"ambiguous_title\"); or the target moved between the snapshot and the action (\"target_changed\"). On those and on mouse_click, retrying with a fixId also withholds it, because the stored fix names a window this cannot see (\"fix_target_unknown\") — browser tools keep their diff on a fixId retry, because theirs is a tab diff and does not depend on a window title. mouse_click and mouse_drag accept an hwnd and still take their snapshots by windowTitle, so nothing else is withheld for them: verify those with a screenshot. A window too large to read whole is withheld too (\"tree_truncated\"). The action itself is unaffected in every case; only the diff is. Default: \"minimal\"."
    • changedInput schema / properties / pattern / description
      Previous value: -"Value matched against the chosen by axis (required when by is set)."New value: +"Value matched against the chosen `by` axis (required when `by` is set)."
    • addedInput schema / properties / pattern / minLength
      Added value: +1
    • changedInput schema / properties / port / description
      Previous value: -"Chrome/Edge CDP remote debugging port."New value: +"Chrome/Edge CDP remote debugging port (default 9222; configurable via desktop-touch-config.json)"
    • changedInput schema / properties / role / description
      Previous value: -"Optional ARIA/implicit-role filter AND-combined with by (e.g. by:'text', pattern:'Save', role:'button')."New value: +"Optional ARIA/implicit-role filter AND-combined with `by` (e.g. by:'text', pattern:'Save', role:'button')."
    • changedInput schema / properties / scope / description
      Previous value: -"Optional CSS selector to limit the by-axis search scope (disambiguation)."New value: +"Optional CSS selector to limit the `by`-axis search scope (disambiguation)."
  2. Changed1 schema field changedv2.0.0
    • changedInput schema / properties / narrate / description
      Previous value: -"Narration level. rich includes UIA or browser state diff when supported."New value: +"Narration level. rich includes UIA or browser state diff when supported, and is withheld with post.rich.diffDegraded when the diff cannot be shown to describe the window that was acted on."
  3. Addedv1.12.0
  4. Removedv1.10.4
  5. Addedv1.9.2
  6. Removedv1.8.0
  7. Addedv1.6.0
  8. Removedv1.5.1
  9. Addedv1.5.0
  10. Removedv1.4.3
  11. Addedv1.4.2
  12. Removedv1.4.0
  13. Changed1 schema field changedv1.2.1
    • addedInput schema / properties / include
      Added value: +{
      +  "description": "Optional response-shape opt-in. `['envelope']` returns the self-documenting envelope (`_version` / `data` / `as_of` / `confidence`). `['raw']` forces raw shape (overrides DESKTOP_TOUCH_ENVELOPE=1 server default). Default behaviour is raw shape (compat with existing clients).",
      +  "items": {
      +    "type": "string"
      +  },
      +  "type": "array"
      +}
  14. Addedv1.0.3

TDQS

A4.5/5.0
Behavior5/5

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

No annotations are provided, so the description carries the full burden and it does so richly: it discloses the ambiguity/no-actionable-target/modal-blocking stop codes, the ancestor-climb depth and occlusion hit-testing, the auto-guard behavior for tabId+port, and the precise verifyDelivery semantics including why activeElementChanged is deliberately not a delivery signal. This is far beyond what any annotation could convey.

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?

The purpose and targeting modes are correctly front-loaded, and the error-code content earns its place, but the description is heavily overloaded — the BrowserClickNotDelivered reserved-note, the CDP '2 values only' aside, and cross-tool hwnd/UIA commentary add length without helping an agent call this tool. Several clauses duplicate schema text verbatim.

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

Completeness5/5

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

With no output schema, the description assumes responsibility for return-shape disclosure and does it thoroughly: post.perception.status, hints.verifyDelivery with its status enum and reason values, and the observedSignals fields. For a 13-parameter mutation tool with zero annotations, nothing an agent needs to invoke it correctly or interpret the result is missing.

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

Parameters3/5

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

Schema description coverage is 100%, so the schema already documents all 13 parameters, and much of the description's parameter content (by-axis behavior, ancestor climb) merely restates the schema text. It adds some value by tying parameters together (role as an AND-filter, scope as narrowing, the one-of selector/by constraint) but does not introduce syntax or formats the schema lacks. Baseline 3 is appropriate.

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

Purpose5/5

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

States a specific verb+resource ('Click a DOM element in Chrome/Edge') and immediately disambiguates against siblings by naming browser_locate and mouse_click and explaining how selector mode combines them. An agent can distinguish this from click_element, mouse_click, and browser_locate without opening any schema.

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

Usage Guidelines5/5

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

Spells out the two targeting modes and when each applies ('stable across repaints' vs 'dynamic-class SPAs'), the mutual-exclusion rule ('Provide EITHER selector OR by+pattern (not both)'), the modal-blocking fallback (dismiss then retry), and the out-of-viewport workaround via browser_eval. These are explicit when/when-not conditions with named alternatives.

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