Skip to main content
Glama

browser_visual_baseline

Capture a baseline PNG screenshot of a page or element for visual regression testing, with automatic masking of sensitive fields.

Instructions

Create a visual regression baseline PNG for the current page or a specific element. Defaults to full-page screenshot and auto-masks sensitive inputs (password, token, apiKey).

中文详情:

  • 用途:为当前页面或指定元素创建视觉回归基线 PNG,作为后续 visual_compare 的对比基准

  • 何时使用:首次建立视觉回归基线时;UI 升级后重置基线时;多 viewport 视觉测试前建立基准时;组件级视觉对比前创建基线时

  • 输出:{ ok: boolean, name: string, path: string, selector: string|null, fullPage: boolean, timestamp: string }

  • 参数:

    • name (string, 必填):基线名称,不含扩展名

    • selector (string, 可选):CSS 选择器;指定后只截取该元素

    • fullPage (boolean, 可选):是否全页截图,默认 true;selector 存在时忽略

    • maskSelectors (array, 可选):截图前额外遮挡/脱敏的 CSS 选择器列表

    • sessionName (string, 可选):浏览器会话名称,默认当前活跃会话

  • 错误:name 为空抛出 'Name is required';selector 无匹配抛出 'element not found';浏览器未启动抛出 'Browser not launched'

  • 示例:{"name":"login-page-baseline","fullPage":true,"maskSelectors":[".ad-banner"]}

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYes基线名称,不含扩展名
fullPageNo是否全页截图,默认 true;selector 存在时忽略
selectorNo可选 CSS 选择器;指定后只截取该元素
sessionNameNo浏览器会话名称,默认当前活跃会话
maskSelectorsNo截图前额外遮挡/脱敏的 CSS 选择器列表
Behavior4/5

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

The description covers default full-page screenshot, auto-masking of sensitive inputs, output object structure, and error cases. No annotations exist, so this is good, but explicit side-effect statements (e.g., file creation) are implied rather than stated.

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 English part is concise, and the Chinese section is well-structured with bullet points. The bilingual nature adds length, but it is still efficient and front-loaded with the purpose.

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?

Despite no output schema, the description provides a full output object, error scenarios, and usage guidelines. With 5 parameters and no annotations, it covers all needed context comprehensively.

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%, and the description adds extra context for each parameter (e.g., 'selector: CSS selector; if specified, only that element is captured') and provides an example invocation. This significantly enhances understanding.

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 states 'Create a visual regression baseline PNG for the current page or a specific element' with defaults and auto-masking. This clearly distinguishes it from siblings like browser_visual_compare and browser_visual_check.

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?

The Chinese section explicitly lists when to use: first-time baseline, reset after UI upgrade, multi-viewport testing, component-level comparison. This provides clear guidance on appropriate scenarios.

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