Skip to main content
Glama
Playwright MCP Server

Playwright MCP Server

Official
by microsoft

browser_take_screenshot

Read-only

Captures the current page or a specified element as an image file, enabling visual inspection and coordinate-based interaction with elements not exposed in the accessibility snapshot.

Instructions

Take a screenshot of the current page. Use browser_snapshot for actions by default. With the vision capability enabled, use screenshot coordinates with the coordinate-based mouse tools for elements not exposed in the accessibility snapshot.

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": {
      "scale": "<scale>"
    },
    "name": "browser_take_screenshot"
  }
}

Input Schema

NameRequiredDescriptionDefault
typeNoImage format for the screenshot. If unset, inferred from the filename extension, otherwise png.
scaleYesImage resolution scale. "css" produces a screenshot sized in CSS pixels (smaller, consistent across devices). "device" produces a high-resolution screenshot using device pixels (larger, accounts for the device pixel ratio). Default is css.css
targetNoExact target element reference from the page snapshot, or a unique element selector
elementNoHuman-readable element description used to obtain permission to interact with the element
filenameNoFile name to save the screenshot to. Relative file names are resolved against the workspace root. If not specified, the screenshot is saved into the output directory as `page-{timestamp}.{png|jpeg|webp}`.
fullPageNoWhen true, takes a screenshot of the full scrollable page, instead of the currently visible viewport. Cannot be used with element screenshots.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv0.0.81
    • changedInput schema / properties / filename / description
      Previous value: -"File name to save the screenshot to. Defaults to `page-{timestamp}.{png|jpeg|webp}` if not specified. Prefer relative file names to stay within the output directory."New value: +"File name to save the screenshot to. Relative file names are resolved against the workspace root. If not specified, the screenshot is saved into the output directory as `page-{timestamp}.{png|jpeg|webp}`."
  2. Changed5 schema fields changedv0.0.79
    • changedInput schema / properties / filename / description
      Previous value: -"File name to save the screenshot to. Defaults to `page-{timestamp}.{png|jpeg}` if not specified. Prefer relative file names to stay within the output directory."New value: +"File name to save the screenshot to. Defaults to `page-{timestamp}.{png|jpeg|webp}` if not specified. Prefer relative file names to stay within the output directory."
    • removedInput schema / properties / type / default
      Removed value: -"png"
    • changedInput schema / properties / type / description
      Previous value: -"Image format for the screenshot. Default is png."New value: +"Image format for the screenshot. If unset, inferred from the filename extension, otherwise png."
    • changedInput schema / properties / type / enum
      Previous value: -[
      -  "png",
      -  "jpeg"
      -]New value: +[
      +  "png",
      +  "jpeg",
      +  "webp"
      +]
    • changedInput schema / required
      Previous value: -[
      -  "type",
      -  "scale"
      -]New value: +[
      +  "scale"
      +]
  3. Changed2 schema fields changedv0.0.78
    • addedInput schema / properties / scale
      Added value: +{
      +  "default": "css",
      +  "description": "Image resolution scale. \"css\" produces a screenshot sized in CSS pixels (smaller, consistent across devices). \"device\" produces a high-resolution screenshot using device pixels (larger, accounts for the device pixel ratio). Default is css.",
      +  "enum": [
      +    "css",
      +    "device"
      +  ],
      +  "type": "string"
      +}
    • changedInput schema / required
      Previous value: -[
      -  "type"
      -]New value: +[
      +  "type",
      +  "scale"
      +]
  4. Changed5 schema fields changedv0.0.72
    • changedInput schema / $schema
      Previous value: -"http://json-schema.org/draft-07/schema#"New value: +"https://json-schema.org/draft/2020-12/schema"
    • changedInput schema / properties / element / description
      Previous value: -"Human-readable element description used to obtain permission to screenshot the element. If not provided, the screenshot will be taken of viewport. If element is provided, ref must be provided too."New value: +"Human-readable element description used to obtain permission to interact with the element"
    • removedInput schema / properties / ref
      Removed value: -{
      -  "description": "Exact target element reference from the page snapshot. If not provided, the screenshot will be taken of viewport. If ref is provided, element must be provided too.",
      -  "type": "string"
      -}
    • addedInput schema / properties / target
      Added value: +{
      +  "description": "Exact target element reference from the page snapshot, or a unique element selector",
      +  "type": "string"
      +}
    • addedInput schema / required
      Added value: +[
      +  "type"
      +]
  5. Changed1 schema field changedv1.0.1
    • changedInput schema / properties / filename / description
      Previous value: -"File name to save the screenshot to. Defaults to `page-{timestamp}.{png|jpeg}` if not specified."New value: +"File name to save the screenshot to. Defaults to `page-{timestamp}.{png|jpeg}` if not specified. Prefer relative file names to stay within the output directory."
  6. First observedv1.0.0

TDQS

A3.6/5.0
Behavior3/5

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

Annotations already declare readOnlyHint=true, destructiveHint=false, openWorldHint=true, so the safety profile is supplied. The description adds the vision/coordinate workflow context but never mentions that this writes an image file to disk (output directory or filename), nor that the element permission flow applies — both are real behavioral traits beyond the annotations.

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?

Three short sentences, front-loaded with the action and then the routing advice; nothing is redundant. The phrase "Use browser_snapshot for actions by default" is slightly oblique about what "actions" means, but overall it is tight.

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?

With no output schema, the description should say what the caller gets back — inline image versus a saved file path — and it does not, despite the filename/output-directory behavior being central to using the tool. For a six-parameter tool the usage framing is otherwise adequate.

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 description coverage is 100%, so all six parameters (type, scale, target, element, filename, fullPage) are already documented in detail, including enum meanings and defaults. The description adds no parameter-level meaning, which is acceptable at full coverage but earns only the baseline.

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?

"Take a screenshot of the current page" gives a specific verb and resource, and the definition immediately contrasts itself with browser_snapshot. It stops short of stating the element/full-page scope in prose, but the core action is unambiguous.

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?

Explicit routing: browser_snapshot is the default for actions, and screenshots are for vision-enabled coordinate work on elements not exposed in the accessibility snapshot. That is a concrete when-to-use condition plus a named alternative. It lacks a when-not-to-use clause (e.g. don't screenshot for reading content).

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