Skip to main content
Glama

Screenshot an element or region

screenshot

Captures a browser tab as an image, letting AI agents inspect viewports, elements, or page regions with configurable format, quality, and width.

Instructions

Screenshot via CDP — defaults to JPEG (far smaller than PNG; pass format:'png' for lossless). Pass ref (from read_page/find, main-frame elements only) to capture just that element, or region [x, y, width, height] (page coordinates) for a rectangle; omit both for a viewport capture. maxWidth downscales the result. Returns an image.

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": {
      "tabId": "<tabId>"
    },
    "name": "screenshot"
  }
}

Input Schema

NameRequiredDescriptionDefault
refNoElement ref to clip to
tabIdYesTarget tab ID (must be in the MCP group)
formatNoImage format (default jpeg)
regionNo[x, y, width, height] in page coordinates (width/height 1-20000)
qualityNoJPEG quality 1-100 (default 80)
maxWidthNoDownscale so width ≤ this (keeps aspect ratio)

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.24.1

TDQS

A4/5.0
Behavior3/5

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

With no annotations supplied, the description carries the full burden and does disclose the meaningful defaults (JPEG for size, downscaling via maxWidth) and that the return is an image. It omits whether capture has side effects, permission or tab-group requirements beyond the schema's note, and any size or rate constraints on large regions.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

One dense paragraph with the default and the two explicit override paths front-loaded, then a short closing statement about the return type. Every clause conveys an actionable choice; nothing is redundant with the title.

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?

Six parameters with only tabId required, and the description covers each capture mode, the format tradeoff, downscaling, and the return type, which is sufficient given there is no output schema. It is slightly short on how refs are obtained beyond the tool names and on failure behavior for stale or cross-frame refs.

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 the baseline is 3. The description does add real meaning the schema lacks — that ref values come from read_page/find and work for main-frame elements only — but leaves quality and the region width/height limits to the schema, so it is a marginal improvement over the structured fields.

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 ('Screenshot via CDP') and immediately enumerates the three capture scopes (element via ref, region rectangle, viewport default), which lets an agent distinguish this from capture-adjacent siblings like screenshot_marked 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 explicit selection rules: pass ref from read_page/find for a single element, pass region for a rectangle, omit both for a viewport capture, and pass format:'png' when lossless output is needed. It does not compare itself to screenshot_marked or other capture tools, so the alternatives guidance is incomplete.

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