Skip to main content
Glama

query_text

Find page elements by their visible text, even when CSS selectors are unreliable. Returns the actionable element for clicking.

Instructions

Find elements by visible text content. Returns the smallest/deepest element whose textContent matches the needle, with chrome (header/nav/footer/aside) skipped. Anchor-promotion: a span/strong/etc. inside an resolves to the anchor (so click() targets the actionable element). Right tool when CSS selectors are unstable (React-rendered pages with hashed class names) but the visible label is reliable — e.g. find a 'Sign in' button without knowing its class.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
exactNoIf true, exact match instead of substring (default false)
limitNoMax matches to return (default 20)
selectorNoOptional CSS selector to limit search scope (default: whole document body)
textYesSubstring to match (or exact string if exact=true)
Behavior4/5

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

No annotations provided, so description carries full burden. It explains default substring matching, exact match option, skipping of chrome elements, and anchor promotion. Does not mention error handling or edge cases, but sufficiently covers key behaviors.

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 four sentences, front-loaded with the main purpose, and each sentence adds essential information. No wasted words, and the structure is clear and easy to parse.

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 no output schema and four parameters, the description covers the key behavioral aspects: matching logic, element depth, chrome skipping, and anchor promotion. It lacks details on error states or no-match scenarios, but overall it is comprehensive enough for an agent to understand the tool's capabilities.

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 100% with parameter descriptions, so baseline is 3. The description adds context: it clarifies that text parameter is the substring or exact string, implies default behavior, and mentions the selector parameter as scope limiter. This extra context justifies a 4.

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 the tool finds elements by visible text, details behavior like returning the deepest match, skipping chrome elements, and anchor promotion. It distinguishes from siblings by recommending use when CSS selectors are unstable but visible labels are reliable, as shown in the example.

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 states when to use this tool versus alternatives: when CSS selectors are unstable and visible labels are reliable. Provides a concrete example ('find a Sign in button') and explains anchor-promotion for actionable targets.

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/protostatis/unbrowser'

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