Skip to main content
Glama

browser_search

Search a web page for elements by text, regex, role, aria label, or CSS selector. Returns results sorted by confidence for browser 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. 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 carries the full burden. It discloses result ordering (confidence descending), pagination, error behaviors, and scope limitations. However, it does not explicitly state that the tool is read-only or describe side effects, though it is implied.

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 well-structured and front-loaded with the core purpose and axes. It includes caveats and error details, but is slightly verbose. Every sentence adds value, though a minor reduction in length could improve conciseness.

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 11 parameters, no output schema, and no annotations, the description covers behavior thoroughly including error handling, usage guidance, and parameter interaction. It could elaborate slightly on the 'include' parameter, but overall it is sufficiently complete for an agent to use the tool correctly.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100% with descriptions for all parameters. The description adds value beyond the schema by explaining how results[0].selector can be used with browser_click, pagination via offset/maxResults, and error codes. It also clarifies the 'by' axis options and the 'include' parameter's effect.

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 a 'Grep-like element search across the current page' and lists all search axes (text, regex, role, etc.), making the purpose unambiguous. It distinguishes itself from siblings like browser_overview and browser_click.

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?

Explicit guidance is given: 'Use browser_overview for broad discovery; use browser_search when you know specific text or role to target.' Additionally, error codes with actionable next steps are provided, helping the agent decide when and how to use the tool.

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

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