Skip to main content
Glama

glass_click_element

Click any UI element by its snapshot ID, using native accessibility actions when available and falling back to pointer clicks for occluded or off-screen targets.

Instructions

Click an element by its #id from glass_a11y_snapshot (actuates via the platform's native accessibility action when the element exposes one — works even when it's occluded or scrolled off-screen — else falls back to a synthetic pointer click at the center of its bounds; the result's method field says which path ran, native_fallback says why when the pointer path was used, and actuated_id names the element actually clicked when a control's label is a separate element from the control itself). If the element actually renders in a popover owned by a different window than the active one (e.g. an open dropdown's option row), the click is automatically routed into that popover window and the previously-active window is restored afterward. Ids are only valid within the latest snapshot — re-run glass_a11y_snapshot if the UI changed. Optional return: "snapshot" settles the UI then folds a fresh a11y tree into the result (and refreshes the snapshot cache); "settle" waits for the UI to stop changing (text-only); omit or "none" for no observe (default). If at least two next actions or waits are known, use glass_do instead of separate calls.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYesElement `#id` from the latest `glass_a11y_snapshot`. Re-snapshot after UI changes. Popover-owned targets route to their window and restore the prior active window. The role-appropriate native accessibility operation handles occluded or off-screen targets and separate labels through their enclosing control. Unavailable native operations fall back to a pointer click at the target center. Text editors may receive focus without activation. `method:"native-action"` labels any native path. `native_fallback` explains pointer fallback. `actuated_id` identifies a substituted enclosing control.
returnNoTerminal observation: "snapshot" settles and refreshes/folds a11y, "settle" waits for visual stability and returns text-only metadata, and "none" skips observation (default).

Schema Changelog

Changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. Changed2 schema fields changedv1.5.1
    • changedInput schema / properties / id / description
      Previous value: -"The element `#id` from `glass_a11y_snapshot`. Valid only within the latest\nsnapshot — re-snapshot if the UI changed. If the element actually renders in a\npopover owned by a different window than the active one (e.g. an open\ndropdown's option row), the click is automatically routed into that popover\nwindow and the previously-active window is restored afterward — no extra step\nneeded.\n\nClicks via the platform's native accessibility action when the element exposes\none (works even when the element is occluded or scrolled off-screen), falling\nback to a synthetic pointer click at the element's center; the result's\n`method` field says which path ran, and `native_fallback` says why when the\npointer path was used. Where a control's label is a separate element from the\ncontrol itself, the native action fires on the enclosing control and the\nresult carries `actuated_id` — the element actually clicked."New value: +"Element `#id` from the latest `glass_a11y_snapshot`.\nRe-snapshot after UI changes.\nPopover-owned targets route to their window and restore the prior active window.\nThe role-appropriate native accessibility operation handles occluded or off-screen targets\nand separate labels through their enclosing control.\nUnavailable native operations fall back to a pointer click at the target center.\nText editors may receive focus without activation.\n`method:\"native-action\"` labels any native path.\n`native_fallback` explains pointer fallback.\n`actuated_id` identifies a substituted enclosing control."
    • changedInput schema / properties / return / description
      Previous value: -"Optional observe folded into the result: \"snapshot\" (wait for the UI to settle, then\nfold a fresh a11y tree, also refreshing the snapshot cache), \"settle\" (wait for the UI\nto stop changing, text-only), or \"none\" (default)."New value: +"Terminal observation: \"snapshot\" settles and refreshes/folds a11y, \"settle\" waits for\nvisual stability and returns text-only metadata, and \"none\" skips observation (default)."
  2. Changed2 schema fields changedv1.2.0
    • changedInput schema / properties / id / description
      Previous value: -"The element `#id` from `glass_a11y_snapshot`. Valid only within the latest\nsnapshot — re-snapshot if the UI changed. If the element actually renders in a\npopover owned by a different window than the active one (e.g. an open\ndropdown's option row), the click is automatically routed into that popover\nwindow and the previously-active window is restored afterward — no extra step\nneeded."New value: +"The element `#id` from `glass_a11y_snapshot`. Valid only within the latest\nsnapshot — re-snapshot if the UI changed. If the element actually renders in a\npopover owned by a different window than the active one (e.g. an open\ndropdown's option row), the click is automatically routed into that popover\nwindow and the previously-active window is restored afterward — no extra step\nneeded.\n\nClicks via the platform's native accessibility action when the element exposes\none (works even when the element is occluded or scrolled off-screen), falling\nback to a synthetic pointer click at the element's center; the result's\n`method` field says which path ran, and `native_fallback` says why when the\npointer path was used. Where a control's label is a separate element from the\ncontrol itself, the native action fires on the enclosing control and the\nresult carries `actuated_id` — the element actually clicked."
    • removedInput schema / title
      Removed value: -"ClickElementArgs"
  3. Addedv1.0.3

TDQS

A4.8/5.0
Behavior5/5

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

Beyond annotations (readOnlyHint=false, destructiveHint=false), the description richly discloses fallback behavior (native action vs. pointer click), result fields that reveal which path ran ('method', 'native_fallback', 'actuated_id'), popover routing with window restoration, and default observation behavior ('none'). It also warns about snapshot invalidation and text editors focus behavior. This is substantial behavioral context far beyond the annotations.

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 long but every clause carries operational weight, and the most important behavioral facts (native-action-first, fallback, result fields) are front-loaded. It is not wastefully wordy, but it is a dense single paragraph that could be slightly more scannable with sentence breaks or bullets.

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 2-parameter tool with no output schema, the description is complete: it explains why the tool exists, what happens when native actions are unavailable, how popover routing works, when to re-snapshot, what the optional return parameter does, and when to prefer glass_do. Nothing needed to invoke it correctly is missing.

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 description coverage is 100%, so the schema already documents both parameters well. The main description adds only modest extra value by naming the optional return values and their effects ('snapshot', 'settle', 'none'), but it does clarify the default. Since the schema is already strong, this is a solid 4, losing a point because the description itself doesn't add much beyond what the schema already says.

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 names a specific verb ('Click'), a precise resource ('an element by its #id from glass_a11y_snapshot'), and immediately distinguishes the primary native accessibility action from the synthetic pointer fallback. This clearly separates it from sibling tools like glass_click (generic click) and glass_click_element is scoped to a11y snapshot ids.

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 tells the agent when to use it (element from latest snapshot, even occluded/off-screen), when to re-run glass_a11y_snapshot, and when to prefer glass_do instead ('If at least two next actions or waits are known'). It also discloses automatic routing for popover-owned targets, which prevents misuse.

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

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/fixed-width/glass'

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