Skip to main content
Glama

browser_visual_compare

Capture a current page screenshot, compare it with a stored visual baseline, and output a diff image with pixel difference metrics and pass/fail result.

Instructions

截取当前页面 actual PNG,与同名视觉基线对比并生成 diff PNG,返回 diffPixels、diffRatio、passed 和产物路径。

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYes要对比的基线名称,不含扩展名
fullPageNo是否全页截图,默认 true;selector 存在时忽略
selectorNo可选 CSS 选择器;需与基线截图范围一致
sessionNameNo浏览器会话名称,默认当前活跃会话
maskSelectorsNo截图前额外遮挡/脱敏的 CSS 选择器列表,用于忽略动态区域
maxDiffPixelRatioNo允许的最大差异像素比例,默认 0.01
Behavior3/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 the main actions (capture, compare, generate diff) and outputs. However, it does not mention side effects (e.g., saving diff PNG to disk), permissions needed, or error conditions (e.g., missing baseline). The description is adequate for a straightforward comparison tool but lacks depth.

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 a single sentence that efficiently captures the tool's main actions and outputs. It is front-loaded with the primary verb ('截取'). While structured, it could be split into clearer steps or bullet points for easier scanning, but it remains concise.

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

Completeness2/5

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

Given 6 parameters and no output schema, the description is incomplete. It lists return values but does not explain them (e.g., what diffPixels represents) or mention error scenarios (e.g., baseline not found, session invalid). The tool's complexity warrants more detail about expected behavior and edge cases.

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?

The input schema has 100% coverage with descriptions for each parameter. The tool description itself does not add additional meaning beyond the schema, so it meets the baseline of 3. It does not explain parameter interactions (e.g., when fullPage is ignored with selector) but the schema already does.

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's purpose: capture current page as PNG, compare with a visual baseline of the same name, generate a diff PNG, and return specific metrics (diffPixels, diffRatio, passed, product path). It distinguishes from siblings like browser_screenshot (capture only) and screenshot_diff (likely similar but name is generic) by specifying the exact workflow and outputs.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance is provided on when to use this tool versus alternatives such as browser_screenshot, browser_visual_baseline, or screenshot_diff. There is no mention of prerequisites (e.g., baseline must exist) or context for optimal use.

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