Skip to main content
Glama
guanyuyan
by guanyuyan

web_screenshot

Render a page in a real browser with saved login and JavaScript support, then save a PNG screenshot to a local path for visual inspection.

Instructions

用真实浏览器渲染页面并截图,保存为 PNG 并返回本地文件路径。

与 web_fetch 共用浏览器池与登录态:需要登录/JS 渲染的页面会先带上已保存的 session,再按需等待某个元素出现后截图,适合"给模型看一眼页面长什么样"。

Args: url: 目标网页完整 URL。 path: 保存路径(可为相对或绝对路径,父目录自动创建);不传则存到 DATA_DIR/screenshots/ 下,文件名按 URL 与参数派生。 full_page: True 时截整页(含滚动区域),默认只截当前视口。 width: 视口宽度(像素),默认 1280。 height: 视口高度(像素),默认 800。 wait_ms: 页面加载后额外等待的毫秒数,给动画/懒加载留时间。 selector: 截图前等待该 CSS 选择器出现(不命中不致命,照常截图)。 actions: 截图前按顺序执行的浏览器动作链(click/type/press/select/wait/scroll), 适合先展开菜单/搜索再截图;单个动作失败只写入 notes,不影响截图。 session: 登录态会话名(默认 default);需与 login 时使用的会话名一致。 deadline_ms: 整次调用的总预算(毫秒),不传表示不限。 proxy: 本次渲染使用的代理;不传则按代理池分配,未配池时沿用全局配置。

Input Schema

NameRequiredDescriptionDefault
urlYes
pathNo
proxyNo
widthNo
heightNo
actionsNo
sessionNodefault
wait_msNo
selectorNo
full_pageNo
deadline_msNo

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.21.0

TDQS

A4.3/5.0
Behavior5/5

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

With no annotations, the description carries the full burden and does so: it discloses session/login-state reuse, automatic parent-directory creation, a derived default filename under DATA_DIR/screenshots/, non-fatal selector misses, action-chain failures that only write notes rather than aborting, a total deadline budget, and proxy-pool allocation. These are exactly the operational traits an agent needs before calling.

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?

Front-loaded with the one-line purpose and return value before the Args block, so an agent can stop reading early. The Args list is long but each entry earns its place with a default or behavioral note; the only minor cost is a docstring-style layout that is denser than prose would need to be.

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 an 11-parameter browser-automation tool with no annotations, the description covers invocation semantics, failure tolerance, and session prerequisites, and an output schema exists so return-value shape need not be re-explained (the path return is stated anyway). Nothing an agent needs to call this correctly appears missing.

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 0% and there are 11 parameters, so the description must compensate entirely — and it does, documenting every parameter with defaults and semantics (full_page vs viewport-only, wait_ms for animation/lazy-load, selector as a soft wait, the ordered action chain with click/type/press/select/wait/scroll, deadline_ms budget, proxy fallback order). This adds substantial meaning beyond bare typed fields.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a concrete verb+resource: render a page with a real browser and screenshot it to PNG, returning the local file path. It also relates itself to siblings by noting it shares the browser pool and login state with web_fetch and depends on the session name used with login. It stops short of an explicit contrast (e.g. 'use web_fetch when you only need text'), so sibling differentiation is implied rather than stated.

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

Usage Guidelines3/5

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

Usage is conveyed indirectly through '适合"给模型看一眼页面长什么样"' and the note that login/JS-rendered pages need a saved session matching the login session name. There is no explicit when-to-use-this-vs-web_fetch/web_extract guidance or when-not condition, leaving the agent to infer the choice from the framing.

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