Skip to main content
Glama

Ui Get Element

ui_get_element
Read-only

Re-resolves a previously returned element_ref (its bounds/state may have changed). Returns role, label, bounds, focused, value, and enabled ONLY when the app publishes AXEnabled — that attribute is optional, so many perfectly usable controls omit it (TextEdit's text area does). When it is missing you get enabled_unknown: true instead; that is 'unknown', NOT disabled, and ui_click will click it. stale_element if the handle is unknown or the element no longer exists.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
element_refYesReference returned by an earlier UI call. Re-resolving it picks up bounds and state that may have changed since.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • addedInput schema / properties / element_ref / description
      Added value: +"Reference returned by an earlier UI call. Re-resolving it picks up bounds and state that may have changed since."
  2. Changed1 schema field changed
    • removedInput schema / properties / element_ref / description
      Removed value: -"Reference returned by an earlier UI call. Re-resolving it picks up bounds and state that may have changed since."
  3. Changed1 schema field changed
    • addedInput schema / properties / element_ref / description
      Added value: +"Reference returned by an earlier UI call. Re-resolving it picks up bounds and state that may have changed since."
  4. Added

TDQS

A4.5/5.0
Behavior5/5

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

Annotations only say readOnlyHint=true, so the description carries the burden and delivers: it warns that `enabled` is optional, defines `enabled_unknown: true` as distinct from disabled, confirms ui_click will still click such elements, and documents the stale_element outcome. This is exactly the behavioral nuance an agent needs.

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?

Every sentence earns its place: primary behavior, return fields, the optional-enabled caveat with a concrete example, the unknown-vs-disabled distinction, and the stale handle case. It is dense but not padded.

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?

With no output schema, the description compensates by naming expected return fields and all important edge states (enabled missing, stale_element). An agent can predict the tool's output and follow-up behavior without extra lookup.

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 the schema already documents element_ref well. The description repeats the re-resolution semantics but adds no new parameter-level detail; baseline 3 is appropriate.

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 operation—re-resolving a previously returned element_ref—and distinguishes it from a fresh lookup by emphasizing the handle is already known. It also enumerates the returned fields, making the tool's job unambiguous among the ui_* siblings.

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 clearly implies when to use the tool: after another UI call returned an element_ref and the agent needs refreshed bounds/state. It doesn't explicitly name ui_find_element as the alternative, so it lacks an explicit exclusion, but the context is clear enough.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources