Skip to main content
Glama

browser_locator

Generates stable CSS selectors from existing selectors or visible text targets, and validates selector stability with match counts and risk scoring.

Instructions

选择器定位工具(v1.9.5 起合并 browser_locator_suggest/validate)。通过 mode 参数区分子模式:suggest(默认,基于已有 selector 命中元素或 target 文本生成稳定推荐选择器)/ validate(验证选择器稳定性,统计匹配数量并输出评分和风险)。

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
modeNo定位模式:suggest(默认,生成推荐选择器)/ validate(验证选择器稳定性)suggest
targetNo无 selector 时按可见文本查找目标元素(mode=suggest 时使用)
selectorNo已有选择器。mode=suggest 时基于命中元素属性生成推荐;mode=validate 时为必填,要验证的选择器
sessionNameNo浏览器会话名称(所有模式通用)
Behavior3/5

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

With no annotations provided, the description carries the full burden. It discloses the two behavioral modes and mentions output for validate (score and risk), but does not describe side effects, destructiveness, permissions, or error handling. It adds some value beyond the schema but lacks comprehensive behavioral disclosure.

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 concise (two sentences), front-loads the purpose and merge history, and efficiently presents the mode distinction. It wastes no words, though it could be slightly more structured (e.g., bullet points for modes).

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 tool's moderate complexity (two modes, no output schema), the description covers the main behaviors and explains the merge of two sibling tools. It lacks return value details for suggest mode and error handling, but for a selector tool with well-documented schema, it is nearly complete.

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 context by explaining the two modes and that suggest can use target text, but it largely restates the schema's parameter descriptions. It provides overall integration but no additional semantics per parameter beyond what the schema already offers.

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 is a 'selector positioning tool' combining suggest and validate modes. It specifies the verb (定位/position) and resource (selector), and distinguishes from sibling tools like browser_locator_suggest and browser_locator_validate by noting the merge.

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?

The description explicitly explains when to use suggest mode (default, for generating stable selectors from existing selector or target text) versus validate mode (for verifying selector stability with match counts and risk scores). It does not explicitly mention when not to use or alternatives, but the context is clear.

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/validpilot/ai-verify-mcp'

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