Skip to main content
Glama

Find elements

find
Read-only

Locate page elements by visible text, CSS selector, XPath, or accessible role/name—even inside iframes and shadow DOM—and return references with role, name, and position.

Instructions

Finds elements by visible text, CSS selector, XPath, or accessible role/name (searches iframes and shadow DOM) and returns refs with role, name and position.

Input Schema

NameRequiredDescriptionDefault
nameNoAccessible name to match together with role.
roleNoAccessible role, e.g. "button", "link", "textbox".
textNoText to search for (case-insensitive substring).
limitNoMaximum results (default 20).
tabIdNoTab to act on. Defaults to the session target tab (see tab_select).
xpathNoXPath expression.
selectorNoCSS selector.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=true and openWorldHint=false, so the safety profile is covered. The description adds genuinely useful behavior beyond that: it traverses iframes and shadow DOM, and returns refs carrying role, name, and position — the latter is important since there is no output schema.

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?

A single dense sentence with the action, supported strategies, depth of traversal, and return value, all front-loaded. Nothing redundant or padded.

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?

With no output schema, the description compensates by describing the returned refs and their fields. What remains missing for a 7-optional-parameter tool is combination/precedence semantics and the no-match case, which an agent would want before calling.

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 100%, so each parameter (name, role, text, limit, tabId, xpath, selector) is already documented with defaults. The description adds no syntax or precedence guidance, such as whether strategies are ANDed or ORed when multiple are supplied — the one gap the schema does not fill.

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 ('Finds elements') plus the full set of matching strategies (visible text, CSS selector, XPath, accessible role/name) and the return shape (refs with role, name, position). An agent can distinguish this from siblings like page_snapshot or dom_inspect because the description names the match modes and the ref-based output.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Usage is only implied: 'finds elements' suggests you call it before acting on an element, but the description never says when to prefer it over page_snapshot, page_read, or dom_inspect, nor does it state exclusions or prerequisites (e.g., needing an active tab).

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