Skip to main content
Glama

多视口矩阵

browser_viewport_matrix
Idempotent

Capture a page across multiple viewport sizes and DPI scales in one call to review responsive layouts, with PNG pixel sizes and horizontal overflow reported.

Instructions

Capture the same page at multiple viewport sizes and DPI scales in one call — use it for responsive-design review. Uses CDP device-metrics emulation, so it can render real 320/480/768px viewports and 2x high-DPI even though the BrowserWindow itself has a 960×640 minimum; the override is always cleared afterwards. Each entry reports actual PNG pixels and horizontal overflow. preset defaults to all; pass viewports to define exact sizes. Screenshots are saved under ~/.aabrowser/screenshots/.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "browser_viewport_matrix"
  }
}

Input Schema

NameRequiredDescriptionDefault
tabIdNoTab id (default: active tab)
presetNoViewport preset (default all)
viewportsNoExplicit viewport list; overrides preset. Max 12 entries.
includeImagesNoAttach up to 4 screenshots as image blocks in the result (default false)

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.15.0

TDQS

A4.4/5.0
Behavior5/5

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

Annotations only declare idempotent/non-destructive; the description adds substantial behavior: CDP device-metrics emulation that bypasses the 960x640 window minimum, guaranteed clearing of the override afterwards, and the fact that entries report real PNG pixels and horizontal overflow. It also discloses the file output location, which is exactly the kind of side effect an agent needs for a non-readOnly tool.

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?

Purpose and use case are front-loaded, then implementation caveats, then output and file location. Dense but each clause carries information; the emulation caveat sentence is slightly long but justified by the non-obvious minimum-size workaround.

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?

With no output schema, the description correctly fills that gap by describing per-entry results (PNG pixel dimensions, horizontal overflow) and where screenshots land on disk. For a multi-viewport capture tool with default-all behavior, nothing essential is missing.

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 four parameters and nested viewport fields are already documented. The description only restates the preset default and the viewports override, adding no new syntax or constraint information beyond the schema; baseline 3 applies.

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 ('Capture the same page at multiple viewport sizes and DPI scales in one call') and immediately names its use case (responsive-design review), which distinguishes it from siblings like browser_pdf or browser_evidence that also produce images.

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 clear context for when to reach for it (responsive-design review) and explains the preset-vs-viewports choice. It stops short of naming an alternative tool or stating when not to use it, so it is strong context without explicit exclusions.

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