Skip to main content
Glama

Click in browser

browser_click
Destructive

Clicks an element in a browser tab by snapshot index or page coordinates with real background mouse input, scrolling it into view and failing if covered.

Instructions

Click in one of the agent's tabs, either an element by its index from browser_snapshot (preferred) or a point given in page coordinates. Pass index or x and y, not both. Works on a background tab with real (trusted) mouse input, without selecting the tab or raising its window. An element out of view is scrolled into view first; when something else covers it (a banner, a dialog, another control) nothing is pressed and the call fails, naming what is in front. A checkbox, radio or switch reports what it is now. A tab the click opens (a target=_blank link or a popup) becomes one of the agent's tabs; find it with browser_list_tabs. Use click for native app windows. A click can submit forms or follow links, so snapshot first.

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

Input Schema

NameRequiredDescriptionDefault
xNoPage x coordinate in CSS pixels, used together with y when no index is given
yNoPage y coordinate in CSS pixels, used together with x when no index is given
indexNoElement index from the latest browser_snapshot of this tab. Preferred over coordinates.
tab_idYestab_id of one of the agent's tabs, from browser_open_tab or browser_list_tabs
session_idNoStable task or thread ID. Pass the same value on every browser call for this task. Different IDs isolate tabs and cleanup within one MCP process. Omit for the default process session.
return_stateNoAppend a current snapshot and readiness status after acting. Without wait_for_selector, only a short pause and bounded navigation wait are used; SPA readiness is not guaranteed. Snapshot indices replace earlier ones. A timeout does not mean the action failed: re-observe with browser_snapshot before repeating it.
wait_timeout_msNoBound for wait_for_selector in milliseconds (default 8000, maximum 10000; 0 checks once). Requires wait_for_selector. Timeout preserves action success and returns current state. Use browser_snapshot with the same wait to re-observe without repeating an action.
wait_for_selectorNoWait for any visible element matching this CSS selector in the page, including open shadow roots (web components); child frames are not searched, and a timeout says how many were visible. On actions requires return_state=true. Returns readiness met, timeout or error; only this condition is checked, not general app readiness. Prefer a selector specific to the expected new UI.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv0.11.2
    • changedInput schema / properties / wait_for_selector / description
      Previous value: -"Wait for any visible element matching this CSS selector in the top-level document (not frames or shadow roots). On actions requires return_state=true. Returns readiness met, timeout or error; only this condition is checked, not general app readiness. Prefer a selector specific to the expected new UI."New value: +"Wait for any visible element matching this CSS selector in the page, including open shadow roots (web components); child frames are not searched, and a timeout says how many were visible. On actions requires return_state=true. Returns readiness met, timeout or error; only this condition is checked, not general app readiness. Prefer a selector specific to the expected new UI."
  2. Changed3 schema fields changedv0.7.1
    • changedInput schema / properties / return_state / description
      Previous value: -"After acting, wait for the page to settle (and finish loading, if the action navigated) and append a fresh browser_snapshot of this tab, so you can pick the next index in the same call. Its indices replace earlier ones."New value: +"Append a current snapshot and readiness status after acting. Without wait_for_selector, only a short pause and bounded navigation wait are used; SPA readiness is not guaranteed. Snapshot indices replace earlier ones. A timeout does not mean the action failed: re-observe with browser_snapshot before repeating it."
    • addedInput schema / properties / wait_for_selector
      Added value: +{
      +  "description": "Wait for any visible element matching this CSS selector in the top-level document (not frames or shadow roots). On actions requires return_state=true. Returns readiness met, timeout or error; only this condition is checked, not general app readiness. Prefer a selector specific to the expected new UI.",
      +  "maxLength": 2000,
      +  "minLength": 1,
      +  "type": "string"
      +}
    • addedInput schema / properties / wait_timeout_ms
      Added value: +{
      +  "description": "Bound for wait_for_selector in milliseconds (default 8000, maximum 10000; 0 checks once). Requires wait_for_selector. Timeout preserves action success and returns current state. Use browser_snapshot with the same wait to re-observe without repeating an action.",
      +  "maximum": 10000,
      +  "minimum": 0,
      +  "type": "integer"
      +}
  3. Changed1 schema field changedv0.5.2
    • addedInput schema / properties / return_state
      Added value: +{
      +  "description": "After acting, wait for the page to settle (and finish loading, if the action navigated) and append a fresh browser_snapshot of this tab, so you can pick the next index in the same call. Its indices replace earlier ones.",
      +  "type": "boolean"
      +}
  4. Changed1 schema field changedv0.4.3
    • addedInput schema / properties / session_id
      Added value: +{
      +  "description": "Stable task or thread ID. Pass the same value on every browser call for this task. Different IDs isolate tabs and cleanup within one MCP process. Omit for the default process session.",
      +  "maxLength": 128,
      +  "minLength": 1,
      +  "type": "string"
      +}
  5. Changed4 schema fields changedv0.3.1
    • changedInput schema / properties / index / description
      Previous value: -"Element index from browser_snapshot"New value: +"Element index from the latest browser_snapshot of this tab. Preferred over coordinates."
    • addedInput schema / properties / tab_id / description
      Added value: +"tab_id of one of the agent's tabs, from browser_open_tab or browser_list_tabs"
    • addedInput schema / properties / x / description
      Added value: +"Page x coordinate in CSS pixels, used together with y when no index is given"
    • addedInput schema / properties / y / description
      Added value: +"Page y coordinate in CSS pixels, used together with x when no index is given"
  6. First observedv0.3.0

TDQS

A4.8/5.0
Behavior5/5

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

Annotations declare destructiveHint=true and openWorldHint=true; the description goes well beyond them by explaining that the click targets a background tab with real trusted mouse input without selecting or raising the window, that out-of-view elements are scrolled into view, and that occlusion causes a failure naming the covering element rather than a blind press. It further discloses that checkbox/radio/switch clicks report resulting state and that newly opened tabs must be found with browser_list_tabs.

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

Conciseness4/5

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

Front-loaded with the action and targeting options, then escalates to caveats and side effects; every sentence carries distinct information with no filler. It is a dense, single-paragraph block, and the popup/tab-discovery and native-window notes could be set apart for faster scanning, but nothing is redundant.

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?

For a destructive, open-world interaction tool with no output schema, the description covers the failure mode, the scrolling behavior, state-reporting behavior, and where popped-up tabs go. Combined with the fully documented schema for return_state and wait_for_selector, an agent has everything needed to invoke this correctly.

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 100%, so the schema already documents each parameter and the baseline is 3. The description adds a genuine constraint absent from the schema — that index and x/y are mutually exclusive and index is preferred — which is real semantic guidance rather than restatement. It does not, however, add format or behavior detail for tab_id, session_id, return_state, or wait_for_selector, leaving those entirely to the schema.

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?

Opens with a specific verb and resource ('Click in one of the agent's tabs') and immediately names the two accepted targeting modes: element index from browser_snapshot (preferred) or page coordinates. It also separates itself from the sibling 'click' tool by scoping that one to native app windows, so an agent can choose without opening either 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?

Gives explicit selection rules: prefer index over coordinates, pass index OR x and y (not both), and use 'click' for native app windows. It also states the prerequisite workflow ('snapshot first') and warns that a click can submit forms or follow links, which is exactly the when-to-use/when-to-be-careful guidance an agent needs.

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