Skip to main content
Glama

Click element

click

Triggers a real browser mouse press and release on an element found by CSS selector, interaction-tree ID, or visible text.

Instructions

Click one element, located by selector, numeric id, or visible text.

Pass exactly one of selector or text. The click is a real mouse event (move, press, release at the element's centre, scrolled into view), so the page sees exactly what a user's click produces. Numeric ids come from get_interaction_tree and are the most reliable route on complex pages; an id stays valid while its element exists and expires on navigation. Fails with element_obscured, naming what is on top, when another element covers the target; pass force=true to click anyway. Returns the target, its tag, and its numeric id when matched by text.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "click"
  }
}

Input Schema

NameRequiredDescriptionDefault
tabNoTab id from list_tabs or new_tab to act on, instead of the active tab. The active tab does not change. Omit to use the active tab. Example: 'tab_2'
textNoVisible text of the element to click, matched as a best match across light and shadow DOM. Used only when selector is omitted. Example: 'Add to cart'
forceNoClick at the element's position even when something else covers it (an overlay, a banner). Off by default, so a covered element is reported instead of clicking the wrong thing. Example: false
selectorNoCSS selector, or a numeric id from get_interaction_tree passed as a string. Example: '#submit' or '42'

Output Schema

NameRequiredDescriptionDefault
idNoInteraction-tree id of the element acted on; reusable while it exists.
tagNoTag name of the element acted on.
targetYesThe selector, id or text the call acted on.
summaryYesOne line saying what happened.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.5.0

TDQS

A4.3/5.0
Behavior3/5

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

Adds substantial context beyond the annotations: the click is a real mouse event with move/press/release at the element centre after scrolling, ids remain valid while the element exists and expire on navigation, and a covered target yields an element_obscured failure naming the occluding element. That said, the annotations already declare openWorldHint=true and destructiveHint=false, and the description never discusses the side effects of a live click on page state or whether an accidental double click is a risk; with annotations carrying the safety profile this lands at a solid 3. Return details are also deferred to the output schema, which is appropriate.

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

Conciseness5/5

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

Front-loads the verb, resource, and locator modes, then layers selection rules, mechanics, id lifetime, and failure behavior in short self-contained sentences. No filler; each sentence carries a distinct decision-relevant fact.

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 click tool with four optional parameters and full schema coverage, the description covers locator choice, exclusivity, mouse-event semantics, id lifecycle, failure mode, and the force escape hatch. Return values are covered by the output schema, so their brief mention here is a bonus rather than a gap.

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 baseline is 3 and the schema already documents each parameter. The description earns an increment by stating the cross-parameter constraint ('pass exactly one of selector or text') and by ranking locator reliability ('numeric ids ... are the most reliable route on complex pages'), which the schema does not say. The tab parameter is left 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+resource ('Click one element') and immediately enumerates the three locator modes (selector, numeric id, visible text). It also names get_interaction_tree as the source of ids, which orients the agent within the sibling set without ambiguity about what this tool does.

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 concrete operating rules: pass exactly one of selector or text, prefer numeric ids on complex pages, and use force=true when an element is obscured. It does not compare against adjacent tools (press_key, execute_javascript, batch) for cases like keyboard activation or scripted clicks, so the when-not guidance is partial.

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