Skip to main content
Glama

browser_click

Clicks a page element by CSS or text selector, scrolling it into view and sending real mouse events that work on React, Angular and CSP-strict sites.

Instructions

Click an element on the page. Supports CSS selectors AND text-based selectors. Auto-scrolls element into view. Uses real mouse events (works on Angular/React SPAs and CSP-strict sites like Google, Stripe). A text selector looks inside an open modal dialog first (a opened with showModal, or a visible element with aria-modal="true"), exact text before partial. If the mouse would not reach the target at its center - another element lies in front of it (an overlay, a dialog's backdrop), the target does not take clicks there (pointer-events, visibility, clipping), or a different control inside it would get the click (a delete button on a card; for a container that is not clickable itself, its own plain link with a real address (a hash route with a path, such as #/orders, counts; a fragment with no target on the page does not) does not count, nor does a web component's own button that covers it, nor a box with a checkbox, switch or radio role right next to a hidden field and the only one in the nearest label around it, a label of that field (a box inside a closed shadow root cannot be seen and is not counted), which counts as that field) - the answer is ok:false with error "covered" and covered_by. Found before the mouse is sent, nothing is sent; if it comes in front afterwards, the rest of the presses and clicks are stopped (a release the page moves elsewhere is let through), and the answer also has maybe_landed: true, because the page may already have reacted. If the click opens a JavaScript dialog (alert, confirm, prompt or "Leave site?"), Chrome freezes the page until it is answered, so whether the target got the click cannot be read: the answer is maybe_landed: true. While the dialog is still waiting it also carries dialog_open with its type and message - answer it with browser_handle_dialog, then check the state. If it was already closed or answered again before the reply was written, there is no dialog_open and the note says it is gone: do not answer it again. Examples: "button:text(Get started)", "text=Submit", "#my-button", "a.btn-primary"

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": {
      "selector": "<selector>"
    },
    "name": "browser_click"
  }
}

Input Schema

NameRequiredDescriptionDefault
selectorYesCSS selector or text selector. Text formats: "text=Click me" (any element), "button:text(Submit)" (specific tag)
partitionNoRun this call in a partition from browser_partition (an id like "p1"). Leave it out for the default partition. An unknown or closed id is an error; the call is never sent to the default partition instead.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv1.33.0
    • addedInput schema / properties / partition
      Added value: +{
      +  "description": "Run this call in a partition from browser_partition (an id like \"p1\"). Leave it out for the default partition. An unknown or closed id is an error; the call is never sent to the default partition instead.",
      +  "type": "string"
      +}
  2. First observedv1.0.0

TDQS

A3.5/5.0
Behavior4/5

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

With no annotations, the description carries the full burden and does so extensively: auto-scroll, real mouse events for SPA/CSP sites, covered-target detection with error "covered" and covered_by, maybe_landed semantics including mid-gesture interruption, and the JavaScript dialog freeze with dialog_open payload. The only shortfall is density — the coverage rules are delivered as one sprawling parenthetical, so the key behavioral guarantees are hard to extract on a first read.

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

Conciseness2/5

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

The opening clauses are well front-loaded, but the middle section is a single multi-hundred-word sentence with four levels of nested parentheses, so the critical "covered" rule cannot be parsed linearly. Specific facts are buried in a digression about checkboxes, web components, and closed shadow roots that belongs in a separate structured field.

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 click tool with no output schema, the failure modes are unusually complete: the covered/covered_by shape, maybe_landed, and dialog_open are all defined. What is missing is the shape of a clean success response — an agent cannot tell what a normal return looks like, only what the exceptional ones carry.

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 coverage is 100%, so both parameters are already documented; this places the baseline at 3. The description does add value with concrete selector examples ("button:text(Get started)", "text=Submit", "#my-button", "a.btn-primary") and the rule that a text selector searches an open modal dialog first, exact text before partial, which the schema does not state.

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?

"Click an element on the page" plus the qualifier that it supports CSS and text selectors, auto-scrolls, and dispatches real mouse events makes the action unambiguous. It implicitly separates itself from a coordinate-based or synthetic-event click, but never names a sibling such as browser_click_xy or browser_double_click, so disambiguation is left to inference.

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

Usage Guidelines3/5

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

It gives one genuinely useful routing rule: if dialog_open is returned, answer with browser_handle_dialog and then re-check state, and it warns not to answer a dialog that is already gone. However, there is no guidance on choosing this over browser_click_xy, browser_double_click, browser_right_click, or when a text selector is preferable to CSS beyond the modal-dialog note.

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