Skip to main content
Glama

browser_click

Find and click a DOM element using a CSS selector. Combines element location and click in one step for stable interaction in Chrome. Requires the element to be visible in the viewport.

Instructions

Find a DOM element by CSS selector and click it (combines browser_locate + mouse_click in one step). Prefer over mouse_click for Chrome — selector-based clicking is stable across repaints. 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: Fails if the element is outside the visible viewport — scroll it into view with browser_eval("document.querySelector('sel').scrollIntoView()") first.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
selectorYesCSS selector for the target element (e.g. '#submit', '.btn', 'button[type=submit]').
narrateNoNarration level. rich includes UIA or browser state diff when supported.minimal
tabIdNoTab ID from browser_open. Omit to use the first page tab.
portNoChrome/Edge CDP remote debugging port.
lensIdNoOptional perception lens ID. Guards (target.identityStable) are evaluated before clicking, and a perception envelope is attached to post.perception on success.
fixIdNoApprove a pending suggestedFix (one-shot, 15s TTL).
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).
Behavior4/5

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

With no annotations provided, the description carries full burden. It discloses the auto-guarding mechanism (verifies tab readyState and identity), return of post.perception.status, and optional lensId for advanced workflows. It also explains the behavior of the include parameter for response shaping. However, it does not detail error handling when the element is not found, which is a minor gap.

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?

The description is composed of 5 sentences that efficiently communicate the core action, preference, parameter roles, and a crucial caveat. It is front-loaded with the main purpose and then elaborates on details. While concise, it could slightly condense the caveat explanation, but overall it earns its space.

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?

Given the tool's complexity (7 parameters, 1 required, no output schema), the description covers the main behavior, auto-guarding, return status, and parameter nuances. It lacks explicit statements on error handling for invalid selectors or element not found, but the caveat about viewport visibility is a key completeness element. Overall, it provides sufficient context for an agent to use the tool effectively.

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

Parameters5/5

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

Schema description coverage is 100%, but the description adds significant value beyond schema: it explains why tabId and port are passed together for auto-guarding, provides context for lensId as 'advanced pinned-tab workflows', describes fixId for approving fixes, and clarifies the include parameter's effect on response shape. This enriches the agent's understanding of parameter usage.

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?

The description clearly states it finds a DOM element by CSS selector and clicks it, combining browser_locate and mouse_click. It distinguishes itself from sibling tools like mouse_click and browser_locate by explicitly mentioning it as a combined step, and advises preference over mouse_click for Chrome.

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?

The description explicitly prefers this tool over mouse_click for Chrome due to stability across repaints. It also provides a caveat about elements outside the viewport and suggests using browser_eval to scroll into view, offering clear guidance on when and how to use the tool.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Harusame64/desktop-touch-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server