Skip to main content
Glama

ui_click

ui_click

Click a specific webpage element by CSS selector or captured page-state selector, with options for right/middle clicks, double-clicks, modifier keys, offsets, and forcing clicks through overlays.

Instructions

Click the single element matching the given selector. The selector may be a CSS selector or the selector value from ui_get_page_state, passed unchanged. Selectors containing "nth=" are positional: call ui_get_page_state again after the page changes before reusing them. Optional: button (right/middle), clickCount 2 for a double-click, modifiers for Shift/Control-click, position for an offset inside the element, force to click through an element covering it. If the click opens a native alert/confirm/prompt, the reply says the browser is waiting: answer it with ui_dialog.

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": "ui_click"
  }
}

Input Schema

NameRequiredDescriptionDefault
forceNoSkip the check that nothing covers the element (e.g. a transparent overlay); the click lands on whatever is on top
buttonNoMouse button (default left); right fires contextmenu
positionNoClick this offset from the element's top-left corner, in CSS pixels (default: its centre)
selectorYesCSS selector, or the `selector` value of an element from ui_get_page_state
modifiersNoKeys held during the click, e.g. ["Shift"] for a range select
clickCountNo2 = double-click, 3 = triple-click (default 1)
session_idNoWhich open session to act on, as returned by ui_start_session. Optional with one open session; required when several are open.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.1/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 a solid job: it explains that `force` skips the covering-element check and that the click lands on whatever is topmost, and it discloses the blocking-alert behavior and the required follow-up (ui_dialog). It omits failure behavior — what happens when no element matches, whether it auto-scrolls into view, or whether it waits for the element to become actionable.

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-loads the action and selector provenance before the optional parameters and the dialog caveat, and every sentence carries information. It is a single dense run-on paragraph, though, which makes the positional-selector caveat and the dialog handoff easy to skim past.

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 7-parameter interaction tool with 100% schema coverage and no output schema, this covers the essentials: selector sourcing, positional-selector invalidation, force/overlay semantics, and the alert-blocking reply. The main gap is error/failure behavior when the selector matches nothing or matches multiple elements, given the description asserts a single match.

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 every parameter is already documented in the schema, and the description's notes on button/clickCount/modifiers/position/force largely restate those descriptions. The one genuinely additive item is the rule that selectors containing "nth=" are positional and must be refreshed after page changes, which is semantics the schema does not convey. Baseline 3 is appropriate with marginal extra value.

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 and resource ("Click the single element matching the given selector") and pins down the singleton-matching semantics, which distinguishes it from ui_click_outside and the state-mutating siblings. It also tells the agent where a valid selector value comes from (ui_get_page_state), so the resource is unambiguous.

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 real routing guidance: reuse the `selector` value from ui_get_page_state unchanged, re-fetch state before reusing positional (nth=) selectors, and hand off to ui_dialog when a native dialog blocks the browser. It does not explicitly state when to prefer ui_click_outside or ui_hover over this tool, so it stops short of full when/when-not coverage.

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