Skip to main content
Glama

query_text

Find elements by visible text content, bypassing unstable CSS selectors. Returns the deepest matching element, skipping headers/nav, and promotes anchors for clickability.

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 are provided, so the description carries full burden. It discloses that chrome elements (header, nav, footer, aside) are skipped, anchor-promotion is performed, and it returns the deepest match. It also mentions default parameter values. Missing are potential side effects (none expected) and response format, but overall is quite transparent.

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 compact yet comprehensive. Every sentence adds value, starting with the core purpose, followed by behavioral details, and ending with a use case. No redundancy or fluff.

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 4 parameters, no output schema, and no annotations, the description covers purpose, behavior, defaults, and typical usage. It does not explain the return value structure, but for a simple tool the description is largely complete.

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%, so each parameter is described in schema. The description adds default values (exact=false, limit=20, selector=document body) and clarifies behavior (e.g., text is substring by default). This goes beyond the schema, providing valuable context.

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 content, specifies it returns the smallest/deepest element, skips chrome elements, and promotes anchor elements. This specific verb+resource description distinguishes it from sibling tools like find_text and query.

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 explicitly says it's the right tool when CSS selectors are unstable but visible labels are reliable, with an example (find 'Sign in' button). It lacks explicit when-not-to-use or alternative tool names but provides clear context for use.

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