Skip to main content
Glama
Playwright MCP Server

Playwright MCP Server

Official
by microsoft

browser_find

Read-only

Searches the current page's accessibility snapshot by text or regex, returning matching nodes with nearby context and tree paths to locate elements and refs without capturing the full snapshot.

Instructions

Search the accessibility snapshot of the current page for text or a regular expression. Returns matching snapshot nodes with a few lines of surrounding context (like search snippets), each shown under its path from the root of the tree, which is cheaper than capturing the whole snapshot when you only need to locate an element and its ref.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "browser_find"
  }
}

Input Schema

NameRequiredDescriptionDefault
textNoPlain text to search for in the page snapshot (case-insensitive substring match). Provide either text or regex, not both.
regexNoRegular expression to search for in the page snapshot. Matching is case-sensitive by default; wrap the pattern in slashes to add flags, e.g. "/error/i" for case-insensitive. Provide either text or regex, not both.
filenameNoSave results to a file instead of returning them in the response. Relative file names are resolved against the workspace root.
maxResultsNoMaximum number of matching items to return. Defaults to returning all matches.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv0.0.84
    • addedInput schema / properties / maxResults
      Added value: +{
      +  "description": "Maximum number of matching items to return. Defaults to returning all matches.",
      +  "type": "number"
      +}
  2. Changed1 schema field changedv0.0.83
    • addedInput schema / properties / filename
      Added value: +{
      +  "description": "Save results to a file instead of returning them in the response. Relative file names are resolved against the workspace root.",
      +  "type": "string"
      +}
  3. Addedv0.0.78

TDQS

A4.3/5.0
Behavior4/5

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

Annotations already cover read-only, open-world, and non-destructive behavior. The description adds useful behavior beyond annotations by explaining that results are matching snapshot nodes with surrounding context, shown under their tree paths, and that this is cheaper than a full snapshot.

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 a single front-loaded sentence with no wasted preamble. Every clause earns its place by covering purpose, return shape, and the performance reason to prefer this over a full snapshot.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a simple read-only search tool with full schema coverage and annotations, the description supplies the remaining context an agent needs: scope, return snippet/path format, and the alternative to full snapshot capture. Although there is no output schema, the return behavior is explained well enough.

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 description coverage is 100%, so the schema fully documents text, regex, filename, and maxResults. The description only mentions text or regular expression and locating an element/ref, adding little meaning beyond the schema; baseline 3 is appropriate.

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?

States a specific verb and resource: search the accessibility snapshot of the current page for text or regex. It also distinguishes itself from browser_snapshot by framing the tool as a cheaper way to locate an element and its ref rather than capture the whole snapshot.

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?

Explains the key usage context: use this when you only need to locate an element and its ref, as it is cheaper than capturing the whole snapshot. It does not explicitly name browser_snapshot as the alternative or state exclusions, but the intended context is clear.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.