Skip to main content
Glama

tool_find_elements

Find UI elements by role, name substring, or automation ID and return refs you can act on, so you can reach controls that pixel hit-testing misses.

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. The result reports minimized — a minimized window does not always expose its full tree, so a zero here is not proof that nothing matches. 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.3/5.0
Behavior4/5

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

With no annotations, the description carries the full burden, and it does disclose useful behavior: 'Read-only', the minimum-one-filter constraint, that results are refs actionable via element_action, and the important caveat that a zero/minimized result is not proof of no match. It still omits behaviors such as what hwnd=0 means, how include_offscreen and max_results affect results, or ordering/truncation of output.

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?

Front-loads the purpose and constraint, then adds caveats; every clause is relevant. Slightly verbose in the middle ('the point of naming it is that you no longer need a pixel'), 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 7-param read tool with an output schema, the description covers purpose, precondition, alternative, and even one return field ('minimized'), which is a helpful bonus since output schemas don't explain semantics. The remaining gap is the undocumented non-filter parameters, which is a parameter-semantics issue more than a completeness one.

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% across 7 parameters, so the description must compensate — it explains role (lowercase skyshot roles, with examples) and effectively name_contains ('name substring'). However hwnd, title, max_results, automation_id, and include_offscreen receive no meaning beyond their names, 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?

States a specific verb+resource ('Find UI elements by role and/or name substring') and names the downstream consumer (element_action), which makes the tool's output role unambiguous. It also explicitly separates itself from tool_skyshot and explains the hit-testing use case, so an agent can distinguish it from siblings without opening the schema.

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?

Gives an explicit when-to-use ('reach an element that cannot be hit-tested'), an explicit when-not ('an unfiltered call would be a tree dump, so use skyshot for that'), and names the follow-up tool (element_action). It even states a hard precondition — at least one filter is required.

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