Skip to main content
Glama
scrape-mcp
by guanyuyan

web_screenshot

Capture screenshots of web pages using a real browser, including logged-in or JavaScript-rendered content, and save as PNG/PDF with a local file path.

Instructions

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

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

Args: url: 目标网页完整 URL。 path: 保存路径(可为相对或绝对路径,父目录自动创建);不传则存到 DATA_DIR/screenshots/ 下,文件名按 URL 与参数派生。 full_page: True 时截整页(含滚动区域),默认只截当前视口。 width: 视口宽度(像素);不传时取 device 预设(desktop 1280 / mobile 390)。 height: 视口高度(像素);不传时取 device 预设(desktop 800 / mobile 844)。 wait_ms: 页面加载后额外等待的毫秒数,给动画/懒加载留时间。 selector: 截图前等待该 CSS 选择器出现,命中时按元素包围盒裁剪; 未命中或元素不可见时回退整页并在 notes 中说明。 hide: 截图前隐藏的元素选择器(如固定导航/弹窗);单个失败只写入 notes。 device: 设备预设 desktop / mobile;mobile 使用 390x844 视口、移动 UA 与触屏。 pdf: True 时导出整页 PDF(需 Chromium 内核),此时忽略元素裁剪与 full_page。 actions: 截图前按顺序执行的浏览器动作链(click/type/press/select/wait/scroll), 适合先展开菜单/搜索再截图;单个动作失败只写入 notes,不影响截图。 session: 登录态会话名(默认 default);需与 login 时使用的会话名一致。 deadline_ms: 整次调用的总预算(毫秒),不传表示不限。 proxy: 本次渲染使用的代理;不传则按代理池分配,未配池时沿用全局配置。

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "url": "<url>"
    },
    "name": "web_screenshot"
  }
}

Input Schema

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

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed9 schema fields changedv0.25.0
    • addedInput schema / properties / device
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "string"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "title": "Device"
      +}
    • addedInput schema / properties / height / anyOf
      Added value: +[
      +  {
      +    "type": "integer"
      +  },
      +  {
      +    "type": "null"
      +  }
      +]
    • changedInput schema / properties / height / default
      Previous value: -800New value: +null
    • removedInput schema / properties / height / type
      Removed value: -"integer"
    • addedInput schema / properties / hide
      Added value: +{
      +  "anyOf": [
      +    {
      +      "items": {
      +        "type": "string"
      +      },
      +      "type": "array"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "title": "Hide"
      +}
    • addedInput schema / properties / pdf
      Added value: +{
      +  "default": false,
      +  "title": "Pdf",
      +  "type": "boolean"
      +}
    • addedInput schema / properties / width / anyOf
      Added value: +[
      +  {
      +    "type": "integer"
      +  },
      +  {
      +    "type": "null"
      +  }
      +]
    • changedInput schema / properties / width / default
      Previous value: -1280New value: +null
    • removedInput schema / properties / width / type
      Removed value: -"integer"
  2. Addedv0.21.0

TDQS

A4.5/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 delivers: it discloses the return value (local file path), session continuity, per-action and per-selector failure modes that degrade gracefully into `notes`, and the pdf-mode caveat that element cropping and full_page are ignored. Budget and proxy-pool behavior are also spelled out, leaving little an agent would only learn by failing a call.

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 a one-sentence purpose plus a short positioning paragraph, then a scannable Args block. It is long, but with 14 parameters almost every line earns its place; only the motivational aside about letting the model see the page is slightly redundant.

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?

An output schema exists, so return-value detail is partly optional, yet the description still names the returned artifact. For a 14-parameter, multi-modal tool it covers defaults, side effects, and graceful-degradation paths; the chief residual gap is the undocumented schema of individual `actions` entries.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Could not be stronger given constraints: every one of the 14 parameters is explained with defaults and interaction rules (width/height fall back to device presets with the actual 1280x800 / 390x844 values, path defaults to DATA_DIR/screenshots/, selector miss falls back to full page, session must match the login session name). The only weakness is that the `actions` array's item shape is described only by example verbs (click/type/press/select/wait/scroll) rather than a formal structure.

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?

States a specific verb and resource — render a page in a real browser and screenshot it to PNG/PDF, returning a local file path. It also positions the tool relative to siblings by noting the shared browser pool and login state with web_fetch, so an agent can distinguish it from text-extraction tools without opening the schema.

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?

Gives a clear use case ("给模型看一眼页面长什么样") and explains that pages requiring login or JS rendering will reuse a saved session, which effectively signals when this tool beats plain fetching. It stops short of explicit exclusions — it never says to use web_fetch/web_extract instead when only text is needed.

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