Skip to main content
Glama

browser_screenshot

Capture a browser tab's viewport, full page, or specific element as a PNG for visual verification, debugging, or documentation.

Instructions

Capture viewport, full_page or one ref/selector element as PNG with image-to-viewport CSS mapping. Element/full_page are exclusive. Full-page points may need scrolling before input. If background rendering stalls, explicitly activate or use AX/text.

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": {
      "tab_handle": "<tab_handle>"
    },
    "name": "browser_screenshot"
  }
}

Input Schema

NameRequiredDescriptionDefault
nthNoZero-based match index.
refNo
nameNoExact AX name; role only.
frameNoChild frame; see shared locator rules.
frame_idNoSelector frame; default main.
selectorNoLocator query.
full_pageNo
tab_handleYes
selector_typeNoDefault css.
include_indicatorsNoInclude transient click feedback.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed5 schema fields changedv0.34.0
    • changedInput schema / properties / frame / description
      Previous value: -"Child frame: at least one of url/title/path. url/title exact; path=unique nested CSS iframe steps (e.g. [\"#frame\"]); exclusive with frame_id."New value: +"Child frame; see shared locator rules."
    • changedInput schema / properties / name / description
      Previous value: -"role only: exact AX name; empty allowed."New value: +"Exact AX name; role only."
    • changedInput schema / properties / nth / description
      Previous value: -"Selector only: zero-based DOM index, AX tree order for role."New value: +"Zero-based match index."
    • changedInput schema / properties / selector / description
      Previous value: -"Query by selector_type; role example: selector=\"link\", name=\"Claim\"."New value: +"Locator query."
    • changedInput schema / properties / selector_type / description
      Previous value: -"Default css. label: exact associated HTML label, whitespace normalized. placeholder: exact attribute."New value: +"Default css."
  2. Changed6 schema fields changedv0.24.2
    • changedInput schema / properties / frame / description
      Previous value: -"Exact child-frame URL/title or CSS iframe path (e.g. [\"#content_iframe\"]); alternative to frame_id. Each path entry uniquely selects an iframe in the preceding document."New value: +"Child frame: at least one of url/title/path. url/title exact; path=unique nested CSS iframe steps (e.g. [\"#frame\"]); exclusive with frame_id."
    • changedInput schema / properties / frame_id / description
      Previous value: -"Selector scope; defaults to main frame."New value: +"Selector frame; default main."
    • changedInput schema / properties / name / description
      Previous value: -"role only: exact accessible name; may be empty."New value: +"role only: exact AX name; empty allowed."
    • changedInput schema / properties / nth / description
      Previous value: -"Zero-based match index: DOM order, or AX tree order for role."New value: +"Selector only: zero-based DOM index, AX tree order for role."
    • changedInput schema / properties / selector / description
      Previous value: -"CSS/XPath query, HTML label text, exact placeholder or AX role (e.g. selector=\"link\", name=\"Claim\"), according to selector_type."New value: +"Query by selector_type; role example: selector=\"link\", name=\"Claim\"."
    • changedInput schema / properties / selector_type / description
      Previous value: -"Default css. label matches associated HTML labels with whitespace normalized; role uses browser AX semantics."New value: +"Default css. label: exact associated HTML label, whitespace normalized. placeholder: exact attribute."
  3. Changed1 schema field changedv0.24.1
    • changedInput schema / properties / selector / description
      Previous value: -"CSS/XPath query, HTML label text, exact placeholder or AX role, according to selector_type."New value: +"CSS/XPath query, HTML label text, exact placeholder or AX role (e.g. selector=\"link\", name=\"Claim\"), according to selector_type."
  4. First observedv0.24.0

TDQS

A4/5.0
Behavior4/5

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

No annotations are supplied, so the description carries the burden, and it does disclose meaningful behavior: the output is a PNG, there is an image-to-viewport CSS coordinate mapping, the two target modes are mutually exclusive, and stalled background rendering has a workaround. It never says how the image is returned (inline data vs written file) or whether the tab must be foregrounded, which are the remaining behavioral gaps.

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 capability and mode list, then the constraints as short clauses; no wasted sentences. Some phrasing is telegraphic ('Full-page points may need scrolling before input', 'image-to-viewport CSS mapping') and costs a little immediate comprehension.

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

Completeness3/5

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

For a 10-parameter tool with a nested frame object, no output schema and no annotations, the description covers the main capture modes but omits the single most important return detail: what the agent gets back (image payload vs file path) and how the CSS mapping should be applied. Adequate to invoke, insufficient to interpret the result.

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 70%, so the baseline is 3. The description clarifies the semantics of full_page and ref/selector (mutually exclusive, one element vs whole page) but adds nothing about nth, name, frame, frame_id, selector_type, include_indicators or tab_handle, leaving those to the schema.

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 concrete verb and resource ('Capture ... as PNG') and enumerates the three capture modes (viewport, full_page, one ref/selector element). The fallback clause ('use AX/text') implicitly distinguishes it from the text/snapshot siblings, so an agent can tell the visual-capture tool apart from the reading tools.

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 real decision rules: 'Element/full_page are exclusive', full-page targets may need scrolling first, and if background rendering stalls you should activate the tab or fall back to AX/text. It lacks an explicit 'use X instead when Y' against browser_snapshot, but the fallback guidance is concrete and actionable.

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