Skip to main content
Glama

browser_search

Search page elements by text, regex, role, aria-label, or CSS selector. Returns results sorted by confidence for precise targeting and interaction.

Instructions

Grep-like element search across the current page. by: 'text' (literal substring), 'regex', 'role', 'ariaLabel', 'selector' (CSS). Returns results[] sorted by confidence descending — pass results[0].selector to browser_click. Pagination via offset/maxResults. Caveats: Use browser_overview for broad discovery; use browser_search when you know specific text or role to target.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
byYesSearch axis: text/regex/role/ariaLabel/selector
patternYesPattern to match against the chosen axis.
scopeNoCSS selector to limit the search scope.
maxResultsNoMax results returned (default 50).
offsetNoOffset into the result set (default 0).
visibleOnlyNoOnly visible elements (default true). Set false to include hidden ones with confidence penalty.
inViewportOnlyNoOnly currently-in-viewport elements (default false).
caseSensitiveNoCase-sensitive matching for text/regex (default false).
tabIdNoTab ID from browser_open. Omit to use the first page tab.
portNoChrome/Edge CDP remote debugging port.
includeNoOptional response-shape opt-in. `['envelope']` returns the self-documenting envelope (`_version` / `data` / `as_of` / `confidence`). `['raw']` forces raw shape (overrides DESKTOP_TOUCH_ENVELOPE=1 server default). Default behaviour is raw shape (compat with existing clients).
Behavior3/5

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

No annotations are provided, so the description must fully disclose behavior. It mentions results sorted by confidence and pagination, but lacks details on performance implications, permissions, side effects, or return value structure beyond a brief mention. More depth would be beneficial.

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 extremely concise: two sentences plus a caveat, front-loaded with the key analogy 'Grep-like element search'. No redundant words, every sentence adds value.

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 complexity (11 parameters, no output schema, no annotations), the description covers search axes, pagination, and chaining, but omits details about the result object structure beyond 'results[]' and does not explain advanced options like scope, visibleOnly, or inViewportOnly. Near-complete but with minor gaps.

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 coverage is 100%, so baseline is 3. The description adds some context (e.g., 'pass results[0].selector to browser_click') but largely duplicates schema parameter descriptions. It does not significantly enhance parameter understanding beyond the schema.

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 'Grep-like element search across the current page' and lists various search axes (text, regex, role, ariaLabel, selector). It distinguishes itself from sibling tools like browser_overview and browser_click, making its purpose unambiguous.

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 explicitly advises using browser_overview for broad discovery and browser_search when targeting specific text or role, and suggests passing results[0].selector to browser_click. This provides clear when-to-use and how-to-chain guidance.

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/Harusame64/desktop-touch-mcp'

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