Skip to main content
Glama

click_element

Destructive

Click a UI element by its parsed ID instead of guessing coordinates. Use after parse_screen/find_elements; re-parse after navigation to avoid stale IDs.

Instructions

Click an element by id from that instance's most recent parse_screen/find_elements (no coordinate guessing).

Returns {"ok", "action", "instance", "detail", "element", "center", "hit"?, "warnings"?} ("hit"/"warnings": see click()). Fails (isError) with the fix named if the id is unknown — run parse_screen(instance) first. Ids from a vision parse are remembered pixels: they go stale when the screen changes, so re-parse after navigation. Ids from an accessibility source (parse "source": browser-dom | at-spi) are re-located just before the click: an element that moved is clicked where it is NOW ("moved_from"), one that is scrolled out of view is scrolled in first ("scrolled": true), and one that is gone fails with "stale": true and nothing clicked. modifiers/observe/settle_ms: see click().

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": {
      "id": "<id>"
    },
    "name": "click_element"
  }
}

Input Schema

NameRequiredDescriptionDefault
idYes
buttonNo
observeNonone
instanceNo
modifiersNo
settle_msNo
observe_regionNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changedv0.6.1
    • addedInput schema / properties / modifiers
      Added value: +{
      +  "default": "",
      +  "title": "Modifiers",
      +  "type": "string"
      +}
    • addedInput schema / properties / observe_region
      Added value: +{
      +  "default": "",
      +  "title": "Observe Region",
      +  "type": "string"
      +}
  2. First observedv0.1.0

TDQS

A4.3/5.0
Behavior5/5

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

Beyond the destructiveHint/openWorldHint annotations, the description discloses the full return shape, the failure mode (isError with the fix named), and — most valuably — the difference between vision-sourced ids (remembered pixels that go stale) and accessibility-sourced ids (re-located at click time, with 'moved_from', 'scrolled', and 'stale: true' outcomes). That is behavior an agent could not derive from annotations alone.

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 core rule is front-loaded in the first sentence, with return shape and edge cases layered after it in a logical order. It is dense and reads like reference shorthand, and the two 'see click()' deferrals shift work onto another tool's documentation, but no sentence is wasted.

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 destructive, open-world mutation tool with no output schema, the description covers a lot: return keys, failure semantics, stale-element handling per parse source, and the prerequisite parse workflow. The remaining gap is that several optional parameters and any focus/window-state prerequisites are left undocumented.

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 description coverage is 0% with 7 parameters, so the description has to compensate: it explains `id` semantics and staleness in depth and implies `instance` scoping via 'that instance'. However, button, observe_region are never mentioned, and modifiers/observe/settle_ms are punted to 'see click()' rather than defined here, leaving roughly half the parameters without meaning.

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 opening states a specific verb and resource ('Click an element by id'), names the source of the id ('that instance's most recent parse_screen/find_elements'), and explicitly disclaims the alternative approach ('no coordinate guessing'), which distinguishes it from coordinate-based siblings like click and move_mouse.

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?

It gives a clear prerequisite (ids must come from a recent parse_screen/find_elements on that instance) and a recovery path ('run parse_screen(instance) first' when the id is unknown). It stops short of explicitly contrasting with click or double_click, so the agent must infer that those are the alternatives for coordinate clicking and double-clicking.

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