Skip to main content
Glama

tool_find_elements

Find UI elements by role or name substring to get action-ready refs, allowing interaction with non-hit-testable elements. Filter by role, title, or name to avoid tree dumps.

Instructions

Find UI elements by role and/or name substring and return refs that can be acted on with element_action. This is how you reach an element that cannot be hit-tested — the point of naming it is that you no longer need a pixel. role is the lowercase role from skyshot (button, edit, document, list_item, ...). At least one filter is required: an unfiltered call would be a tree dump, so use skyshot for that. Read-only.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
hwndNo
roleNo
titleNo
max_resultsNo
automation_idNo
name_containsNo
include_offscreenNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.3.1

TDQS

A4.4/5.0
Behavior4/5

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

No annotations are provided, so the description carries the behavioral burden. It discloses read-only behavior, the need for at least one filter, and the consequence of an unfiltered call (tree dump). It does not mention edge cases like no matches or offscreen behavior, but the core safety and boundary characteristics are clearly stated.

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 compact and well-structured: it front-loads the primary action and output, then gives usage rationale, role semantics, filter requirement, and safety note. Every sentence contributes meaningful guidance with no filler.

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 tool with no annotations, the description covers the core intent, the key role semantics, the mandatory filter condition, and the read-only nature. An output schema exists, so return-value details are not required. The main omission is fuller parameter-level guidance, but the description is sufficient for competent selection and basic correct invocation.

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%, so the description must compensate. It explains the 'role' parameter (lowercase role from skyshot, with examples) and implies 'name_contains' means substring matching. However, it leaves hwnd, title, automation_id, max_results, and include_offscreen essentially unexplained, so the compensation is only partial.

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 and resource ('Find UI elements'), states the matching criteria ('by role and/or name substring'), and explains the output ('return refs that can be acted on with element_action'). It also distinguishes itself from pixel/hit-test based tools, so an agent can separate it from siblings like element_at_point and skyshot.

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?

Explicitly says when to use this tool: to reach an element that cannot be hit-tested, because naming it removes the need for a pixel. It also gives an exclusion: an unfiltered call would be a tree dump, so use skyshot for that. The 'at least one filter is required' rule further guides correct invocation.

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