Skip to main content
Glama
Eswarr11
by Eswarr11

scan_page

Scan any open browser page to extract all element locators (XPath, CSS, testId) via CDP or Playwright WebSocket.

Instructions

Scan an open browser page and extract all element locators. Supports two connection modes: (1) cdpEndpoint — Chrome DevTools Protocol HTTP URL (e.g. http://localhost:9222). Requires Chrome launched with --remote-debugging-port=9222. Use this when @playwright/mcp is also connected to the same external Chrome. (2) wsEndpoint — Playwright WebSocket URL (e.g. ws://127.0.0.1:PORT/...). Use this if you have the browser WS endpoint from a Playwright browser server. Exactly one of cdpEndpoint or wsEndpoint must be provided. scanName determines the registry file: registry/{scanName}.json. scanMode: interactive (default), testId, or full.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
cdpEndpointNoCDP HTTP endpoint, e.g. http://localhost:9222. Use when Chrome was started with --remote-debugging-port.
wsEndpointNoPlaywright WS endpoint, e.g. ws://127.0.0.1:PORT/GUID. Use when connecting via Playwright browser server.
pageUrlNoURL substring to target a specific tab. Omit to use the first active page.
scanNameYesRegistry filename without .json, e.g. goal-side-panel-locators.
scanModeNoElement discovery mode: interactive (default), testId, or full.
Behavior4/5

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

No annotations provided, so description carries full burden. It explains connection modes and registry file naming, but doesn't mention side effects or safety. Since it's a read-like operation, it's acceptable but could note if it alters the page.

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?

Description is well-structured with numbered modes, but slightly verbose; could be trimmed without losing clarity.

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?

Given no output schema and sibling tools, the description fully explains operation, parameters, and usage context, leaving no key gaps.

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 description coverage is 100%, but the description adds value by clarifying mutual exclusivity of cdpEndpoint/wsEndpoint and specifying scanName usage, going beyond schema info.

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 scans an open browser page to extract element locators, with two specific connection modes, making the purpose unambiguous and distinct from siblings.

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 describes when to use each connection mode (cdpEndpoint vs wsEndpoint) with examples, and states exactly one must be provided, providing clear guidance over alternatives.

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/Eswarr11/locator-mcp'

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