Skip to main content
Glama

browser_search

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

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. Typed errors: code:'BrowserSearchNoResults' (broaden the by:'text' substring or relax the by:'regex' pattern; switch to browser_overview to enumerate selectors), code:'BrowserSearchTimeout' (reduce maxResults / narrow scope), code:'ScopeNotFound' (the scope CSS selector did not match — verify the selector or omit scope), code:'BrowserNotConnected' (call browser_open first, or browser_open({launch:{}}) to auto-spawn).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
byYesSearch axis: text/regex/role/ariaLabel/selector
portNoChrome/Edge CDP remote debugging port.
scopeNoCSS selector to limit the search scope.
tabIdNoTab ID from browser_open. Omit to use the first page tab.
offsetNoOffset into the result set (default 0).
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).
patternYesPattern to match against the chosen axis.
maxResultsNoMax results returned (default 50).
visibleOnlyNoOnly visible elements (default true). Set false to include hidden ones with confidence penalty.
caseSensitiveNoCase-sensitive matching for text/regex (default false).
inViewportOnlyNoOnly currently-in-viewport elements (default false).
Behavior4/5

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

With no annotations, the description is transparent about result sorting ('confidence descending'), pagination, and options like visibleOnly and inViewportOnly with behavior notes. It mentions error codes and conditions. Lacks an explicit statement of non-destructiveness but implies it.

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?

Compact and well-structured: purpose, axes, result usage, pagination, caveats, then error codes. Every sentence serves a purpose with no redundancy.

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?

For a complex tool with 11 parameters and no output schema, the description covers core functionality, error handling, and usage context. Could include a sample result structure but sufficient given the chaining hint.

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%, baseline 3. Description adds value beyond schema by explaining search axes with examples (literal substring, CSS), result chaining, and parameter adjustments implied in error codes (e.g., 'broaden the by:text substring').

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 this is a 'Grep-like element search' with specific axes (text, regex, role, ariaLabel, selector) and explains result usage ('pass results[0].selector to browser_click'). It distinguishes from sibling browser_overview for broad discovery.

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 advises when to use this tool ('when you know specific text or role to target') vs browser_overview for broad discovery. Also provides detailed error code remedies, guiding the agent on corrective actions (e.g., broaden substring, reduce maxResults).

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