Skip to main content
Glama

glass_find_elements

Read-only

Find ranked accessibility elements from a single fresh read when the target text is approximate, duplicated, or unknown. Filter by role, state, and semantic scope, then act on the returned IDs.

Instructions

Find ranked accessibility candidates from one fresh read when the target is approximate, duplicated, or not yet identified. Query matches name, description and non-secure value; within must match one semantic scope. max_results defaults to 10, capped at 20; timeout_ms optionally waits. Returns actionable IDs, compact context and explicit truncation in an untrusted match array. Total text is capped at 8 KiB.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
roleNoNormalized target role.
queryNoApproximate case-insensitive semantic text. Optional when role or states are supplied.
statesNoTarget state predicates combined with AND.
withinNoOptional unique semantic scope resolved in the same fresh tree.
max_nodesNoExisting accessibility walk limit semantics; 0 removes the node-count limit.
timeout_msNoOptional wait for at least one match; default 0 performs one fresh read.
max_resultsNoMaximum ranked matches before the byte budget; default 10, range 1 through 20.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv1.5.1

TDQS

A4.1/5.0
Behavior5/5

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

Beyond the readOnly/openWorld annotations, the description discloses matching fields, default and cap for max_results, timeout behavior, the return shape ('actionable IDs, compact context and explicit truncation'), the 'untrusted' nature of matches, and the 8 KiB total-text cap. This is rich behavioral context that annotations alone do not provide.

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 three dense sentences with no filler: purpose and trigger come first, then matching semantics and parameter limits, then return behavior. Every sentence earns its place, and key operational constraints are packed efficiently.

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?

Given there is no output schema, the description does a good job of describing what the caller gets back: ranked IDs, compact context, explicit truncation, and a bounded result set. It could be clearer about what 'ranked' means and the exact structure of the returned matches, but it is sufficient for selecting and invoking the tool.

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 baseline is 3; the input schema already documents query matching, within's semantic scope, max_results range, and timeout semantics. The description largely restates these facts ('max_results defaults to 10, capped at 20') and adds only minor gloss such as 'within must match one semantic scope.'

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description names a specific resource ('accessibility candidates') with a concrete verb ('Find') and ties it to a clear triggering condition: 'when the target is approximate, duplicated, or not yet identified.' It does not explicitly name or contrast sibling tools such as glass_wait_for_element or glass_a11y_snapshot, so it stops short of full sibling differentiation.

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?

The description gives a clear use context: this is the one-shot ranked search for ambiguous or unknown targets, and it clarifies the single-read timing model. It does not state exclusions or explicitly point to alternatives, but the 'one fresh read' phrase distinguishes it from wait/snapshot-style tools without naming them.

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