Skip to main content
Glama

findElementsByText

Search page elements by visible text and retrieve stable selectors for automation. Optionally click, type, hover, or style matches directly, removing the need for custom scripts.

Instructions

Find elements by visible text content and get their selectors. Use this INSTEAD of executeScript when you need to find elements. Returns working selectors that can be used with click/type tools. Can optionally perform actions directly.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
textYesSearch text
exactNoExact match (default: false)
actionNoOptional action on first match
caseSensitiveNoCase sensitive (default: false)
Behavior3/5

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

No annotations are present, so the description carries the burden. It discloses that the tool can 'optionally perform actions directly', implying non-read-only behavior, but does not elaborate on side effects (e.g., clicking may navigate) or state that the default is read-only. This is a partial disclosure.

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?

The description is four sentences, front-loads the core purpose, and provides useful guidance. Minor redundancy exists between 'get their selectors' and 'Returns working selectors', but no fluff is present and the structure is logical.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The tool has a nested action object and no output schema. The description covers the main use case and the alternative to executeScript, but it does not explain the return format (e.g., array of selectors) or that actions apply to the first match (only mentioned in the schema). Some operational details are missing.

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 the baseline is 3. The description adds semantic value by specifying 'visible text content' for the text parameter, but it does not clarify exact, caseSensitive, or action semantics beyond the schema's brief descriptions.

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 uses a specific verb ('Find') and resource ('elements by visible text content'), and states the output ('get their selectors'). It explicitly distinguishes from executeScript by saying 'Use this INSTEAD of executeScript', which clarifies its unique role.

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?

The description provides explicit when-to-use guidance: 'when you need to find elements', and names an alternative: 'INSTEAD of executeScript'. It also states that returned selectors work with click/type tools, giving downstream usage context.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/docentovich/chrometools-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server