Skip to main content
Glama

find_element

Locate a UI element by text, resource ID, or class name and retrieve its attributes and bounds. Returns the first match found for quick lookups.

Instructions

Find a UI element by text, resource ID, or class name and return its attributes and bounds. Returns the FIRST match with 8 of the node's attributes; describe_element returns every match with all 17 plus the index: a flow selector would use, and is the one to reach for when a selector may be ambiguous or when a state flag is in question.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
textNoVisible text or content-desc; regex full-match — use .* for partial, e.g. 'Sign.*'
device_idNoTarget device ID. If omitted, uses the default device.
class_nameNoIgnored in M1; reserved for a future class selector
resource_idNoBare resource-id, e.g. login_button; regex full-match

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv3.8.0

TDQS

A4.1/5.0
Behavior3/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It does disclose key behaviors: returns the first match, returns 8 attributes, and includes bounds. However, it does not specify what happens on no match (e.g., null, error), the exact return structure, or whether the operation is read-only (implied but not stated). These gaps leave some uncertainty for an agent.

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?

The description is two sentences with zero waste. The first sentence states the purpose and output, and the second immediately pivots to the sibling comparison and usage guidance. It is front-loaded and every clause earns its place.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The tool has no output schema, so the description must compensate by explaining the return value. It mentions 'attributes and bounds' and '8 attributes' but does not enumerate which attributes or describe the return format in detail. It also omits error behavior and the default device behavior (though schema covers device_id default). For a read-only find operation, this is adequate but not complete.

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?

The schema description coverage is 100%, so each parameter already has a meaningful description (e.g., text is visible text or content-desc with regex full-match). The tool description adds no extra parameter semantics beyond what the schema provides, so the baseline score of 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 states a specific verb ('find'), a resource ('UI element'), and the search methods ('text, resource ID, or class name') along with the output ('attributes and bounds'). It explicitly contrasts with describe_element by noting it returns the FIRST match with 8 attributes, clearly distinguishing the two tools.

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 names the alternative tool (describe_element) and the conditions that should trigger its use: when a selector may be ambiguous or when a state flag is in question. This gives the agent clear when-to-use and when-not-to-use guidance without ambiguity.

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