Skip to main content
Glama

page.pinch

Simulates a two-finger pinch and twist gesture to zoom or rotate maps, image viewers, and canvases; enable touch emulation first so the page responds as a touch device.

Instructions

Two-finger touch gesture: pinch to zoom (scale over 1 spreads the fingers, under 1 pinches them together) and/or twist (rotate_deg). For maps, image viewers, canvases and anything reading multi-touch. Turn on touch emulation first (device.preset) so the page treats it as a touch device.

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": "page.pinch"
  }
}

Input Schema

NameRequiredDescriptionDefault
xNoWith y: centre of the gesture. Default the element centre, else the viewport centre.
yNo
nthNoZero-based index when the locator matches several elements.
refNoSnapshot ref (eNN) from page.snapshot.
seedNoSeed for the human randomness, to repeat a gesture exactly. Every call reports the seed it used.
textNoVisible text of the element.
humanNoDefault true: curved path, slow-fast-slow speed, hand jitter, short pauses. false: straight, even, no pauses.
inputNoDefault auto: touch when touch emulation is on for the tab (device.preset), else mouse.
scaleNoFinal finger spread / starting spread. 2 = zoom in, 0.5 = zoom out.
xpathNoXPath expression.
verifyNoWatch for DOM mutations after the gesture. Default true.
frame_idNoFrame to search within; see page.list_frames.
selectorNoCSS selector; pierces shadow DOM.
angle_degNoStarting angle of the line between the fingers. Default 0 (side by side).
jitter_pxNoHand wobble mid-path in CSS px. Default 1.5; 0 for a steady hand. Ends are always exact.
modifiersNoKeys held throughout, e.g. ["Shift"] or ["Alt"].
target_idNoTarget handle (tgt_*). Omit for the active page.
verify_msNoHow long to watch. Default 300.
browser_idNoBrowser handle (br_*). Omit to use the only running browser, or auto-launch one.
rotate_degNoTwist the fingers by this many degrees, clockwise positive.
duration_msNoDefault 450.
start_distanceNoStarting gap between the fingers in CSS px. Default 120.
backend_node_idNoCDP backendNodeId, e.g. from inspector.pick.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.2/5.0
Behavior4/5

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

Annotations only declare readOnlyHint=false and openWorldHint=true, leaving the operational context to the description. The description contributes the non-obvious dependency on device.preset and touch emulation, which materially changes how the call behaves. It does not restate verification, seeding or human-jitter behavior, which the schema already covers.

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?

Two sentences, no waste. The gesture definition and the scale direction come first, followed by the use case and the emulation prerequisite, so the reader hits the disambiguating content immediately.

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?

For a 23-parameter, fully-optional gesture tool with no output schema, the description covers purpose, physical semantics, target contexts and the emulation prerequisite. What remains (element targeting, seeds, verification windows) is well handled by the 96%-covered schema, so nothing critical is left ambiguous.

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 96%, so parameter documentation is already thorough. The description restates the scale direction ('over 1 spreads the fingers, under 1 pinches them together'), which reinforces but does not extend the schema's 'Final finger spread / starting spread'. Nothing is added about how scale and rotate_deg combine in one gesture or about duration/start_distance interaction.

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?

Names a specific verb and resource ('Two-finger touch gesture: pinch to zoom ... and/or twist') and defines the two physical components (scale, rotate_deg). It is immediately distinguishable from siblings like page.drag, page.pointer, page.long_press and page.scroll, which are all single-pointer or non-gesture operations.

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 positive usage contexts ('maps, image viewers, canvases and anything reading multi-touch') and a hard prerequisite: 'Turn on touch emulation first (device.preset) so the page treats it as a touch device.' A naming-based reader can call it correctly. It stops short of stating when to prefer page.drag or page.pointer instead for single-pointer interactions.

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

Deploy Server

Other Tools