Skip to main content
Glama

gesture-pinch

Simulate a two-finger pinch-to-zoom gesture on iOS Simulators or Android Emulators to zoom maps, images, or other zoomable views by moving fingers toward or away from a center point.

Instructions

Execute a pinch-to-zoom gesture by moving two fingers toward or away from a center point to change the scale of on-screen content. Positions and distances are fractions of the screen (0.0–1.0, not pixels), as in gesture-tap. startDistance > endDistance = pinch in (zoom out). startDistance < endDistance = pinch out (zoom in). Typical values: startDistance 0.2, endDistance 0.6 for a zoom-in pinch at screen center. Use when you need to zoom in or out on a map, image, or zoomable view. Returns { pinched: true, timestampMs }. On physical iOS, reactivated: true = app was re-fronted; re-describe. Fails if the simulator-server / emulator backend is not reachable for the given device, or on a physical iPhone when the app is not drawn in portrait.

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": {
      "udid": "<udid>",
      "centerX": "<centerX>",
      "centerY": "<centerY>",
      "startDistance": "<startDistance>",
      "endDistance": "<endDistance>"
    },
    "name": "gesture-pinch"
  }
}

Input Schema

NameRequiredDescriptionDefault
udidYesTarget device id from `list-devices` (iOS UDID or Android serial).
angleNoAngle in degrees of the axis the fingers lie on: 0 = horizontal (default), 90 = vertical.
centerXYesCenter of the pinch, horizontal.
centerYYesCenter of the pinch, vertical.
durationMsNoTotal gesture duration in milliseconds (default 300)
endCenterXNoFinal horizontal center of the pinch. When set, the centroid drifts linearly from centerX to endCenterX over the gesture (e.g. to keep expanding fingers on-screen near an edge). Omit for a fixed center.
endCenterYNoFinal vertical center of the pinch; drifts from centerY like endCenterX. Omit for a fixed center.
endDistanceYesFinal distance between the two fingers.
startDistanceYesInitial distance between the two fingers.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed7 schema fields changed
    • changedInput schema / properties / angle / description
      Previous value: -"Axis angle in degrees along which the fingers are placed (default 0 = horizontal)."New value: +"Angle in degrees of the axis the fingers lie on: 0 = horizontal (default), 90 = vertical."
    • changedInput schema / properties / centerX / description
      Previous value: -"Center of pinch, horizontal: normalized 0.0–1.0 (fraction of screen width, not pixels)"New value: +"Center of the pinch, horizontal."
    • changedInput schema / properties / centerY / description
      Previous value: -"Center of pinch, vertical: normalized 0.0–1.0 (fraction of screen height, not pixels)"New value: +"Center of the pinch, vertical."
    • changedInput schema / properties / endCenterX / description
      Previous value: -"Final horizontal center of the pinch: normalized 0.0–1.0. When set, the centroid drifts linearly from centerX to endCenterX over the gesture (e.g. to keep expanding fingers on-screen near an edge). Omit for a fixed center."New value: +"Final horizontal center of the pinch. When set, the centroid drifts linearly from centerX to endCenterX over the gesture (e.g. to keep expanding fingers on-screen near an edge). Omit for a fixed center."
    • changedInput schema / properties / endCenterY / description
      Previous value: -"Final vertical center of the pinch: normalized 0.0–1.0. When set, the centroid drifts linearly from centerY to endCenterY over the gesture. Omit for a fixed center."New value: +"Final vertical center of the pinch; drifts from centerY like endCenterX. Omit for a fixed center."
    • changedInput schema / properties / endDistance / description
      Previous value: -"Final distance between the two fingers: normalized 0.0–1.0 (fraction of screen, not pixels). E.g. 0.6 = fingers 60% of screen apart. Use a larger endDistance than startDistance to pinch out (zoom in)."New value: +"Final distance between the two fingers."
    • changedInput schema / properties / startDistance / description
      Previous value: -"Initial distance between the two fingers: normalized 0.0–1.0 (fraction of screen, not pixels). E.g. 0.2 = fingers 20% of screen apart. Use a larger startDistance than endDistance to pinch in (zoom out)."New value: +"Initial distance between the two fingers."
  2. Changed2 schema fields changedv0.17.0
    • addedInput schema / properties / endCenterX
      Added value: +{
      +  "description": "Final horizontal center of the pinch: normalized 0.0–1.0. When set, the centroid drifts linearly from centerX to endCenterX over the gesture (e.g. to keep expanding fingers on-screen near an edge). Omit for a fixed center.",
      +  "type": "number"
      +}
    • addedInput schema / properties / endCenterY
      Added value: +{
      +  "description": "Final vertical center of the pinch: normalized 0.0–1.0. When set, the centroid drifts linearly from centerY to endCenterY over the gesture. Omit for a fixed center.",
      +  "type": "number"
      +}
  3. First observedv0.15.0

TDQS

A4.7/5.0
Behavior5/5

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

No annotations are provided, so the description carries the full burden. It discloses the return value { pinched: true, timestampMs }, physical iOS reactivation behavior requiring re-describe, and failure conditions when the backend is unreachable or the physical iPhone app is not in portrait.

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?

It is front-loaded with the gesture action and coordinate convention, then gives direction semantics, typical values, usage context, and return/failure caveats. Every sentence carries operationally relevant information without filler.

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?

For a 9-parameter gesture tool with no annotations and no output schema, the description covers the core geometry convention, zoom direction, return value, failure modes, and physical-device caveat. The remaining parameter details are well covered by the 100%-covered input schema.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/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 adds meaning beyond the schema by stating that positions and distances are screen fractions from 0.0–1.0 rather than pixels, mapping startDistance versus endDistance to pinch-in versus pinch-out zoom direction, and giving typical values of 0.2 and 0.6.

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?

The description states a specific verb and resource: execute a pinch-to-zoom gesture by moving two fingers. It clearly distinguishes this from sibling gestures by describing the two-finger pinch motion and scale change on on-screen content.

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?

It gives clear usage context: use when zooming in or out on a map, image, or zoomable view. It does not explicitly name when to use gesture-custom or other alternatives instead, so it stops short of full when/when-not guidance.

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