Skip to main content
Glama

describe_element

Inspect every attribute and state flag of elements a selector matches, including exact bounds and candidate indexes for writing reliable UI test assertions.

Instructions

Read-only: dump EVERY attribute of the element(s) a selector matches — the state flags observe_ui hides (checkable, checked, selected, focused, enabled, password, scrollable), the full resource-id and class, and exact bounds. Returns one block per match with the index: a flow selector would use, so an ambiguous selector shows all its candidates instead of silently picking the first. Accepts the same enabled/checked/focused/selected qualifiers a flow selector does, so the index it reports is the index that selector will get. Use it while authoring to answer 'does this control expose its state at all?' before writing an assertion around it. For a single match with fewer attributes, find_element is the smaller answer.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idNoBare resource-id (Compose testTag), regex full-match
textNoVisible text or content-desc, regex full-match
checkedNoOnly match nodes with this checked state
enabledNoOnly match nodes with this enabled state
focusedNoOnly match nodes with this focused state
selectedNoOnly match nodes with this selected state
device_idNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv3.8.0

TDQS

A4.6/5.0
Behavior4/5

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

No annotations are present, so the description carries the disclosure burden. It clearly declares 'Read-only' upfront, explains that it returns one block per match including the flow-selector `index`, and how ambiguity is handled (shows all candidates instead of picking the first). It also notes the link to flow selector qualifiers. Minor omissions like behavior on no match or the exact output format are the only gaps.

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 front-loaded with the core purpose ('Read-only: dump EVERY attribute...') and then proceeds logically: return format, qualifiers, use case, and alternative. Every sentence adds value, and the length is justified given the tool's complexity. There is no wasted text or repetition of schema content.

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 the absence of an output schema and annotations, the description covers most essential details: what is returned, how ambiguity is handled, the relationship to flow selectors, and a usage example. It doesn't specify the output format for `bounds` or the behavior when no elements match, which would be helpful for an agent to interpret results correctly. Overall, it is nearly complete but has small gaps.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 86%, so most parameters already have semantic descriptions. The description adds meaningful context beyond the schema: it explains that the qualifiers (enabled/checked/focused/selected) are the same as a flow selector's, and that the reported index corresponds to the one that selector will use. This clarifies how the parameters interact and what the output will be. It doesn't describe each parameter individually, but the schema already does that, so the added value is sufficient.

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 clearly states a specific action (dump every attribute) on a specific resource (matched elements), enumerating exactly what is returned (state flags, resource-id, class, bounds). It also distinguishes itself from find_element by noting it is the larger, more exhaustive alternative for ambiguous selectors, making it easy for an agent to tell apart from siblings without opening schemas.

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 specifies when to use: 'Use it while authoring to answer

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