Skip to main content
Glama

Long-press

long_press

Simulates a sustained press at screen coordinates or on a UI element identified by text, content description, or resource ID, with configurable hold duration.

Instructions

Long-press x, y in physical pixels, or the center of the node whose text or contentDesc (iOS: label or value) equals text, or whose resource id (iOS: identifier) matches id. An iPhone needs install_runner once.

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": "long_press"
  }
}

Input Schema

NameRequiredDescriptionDefault
xNo
yNo
idNoResource id, full or the part after :id/ (iOS: identifier).
textNoExact text or contentDesc (iOS: label or value), case-sensitive.
deviceNoId or name.
timeoutNoWith text or id: ms to keep reading the tree until the node appears; the call can run up to 6 s longer.
durationNoHold time in ms. Default 1000.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.3.0

TDQS

A3.8/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=false, destructiveHint=false and openWorldHint=false, so the safety profile is covered; the description adds genuinely new behavior: coordinates are in physical pixels, the press is centered on the resolved node, and iOS requires a prior install_runner call. It omits what happens when the node is never found (the schema hints at a ~6 s extension but the description does not say whether it errors or is a no-op).

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 filler. Primary targeting modes come first, with the platform caveat and installer prerequisite trailing where it belongs.

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 7-parameter gesture tool with no output schema and no description of return values or failure behavior, gaps remain: nothing says what is returned, what happens on a node-not-found or timeout, or how the targeting modes interact. Adequate to invoke correctly in the happy path, but thin on edge-case behavior.

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 71%, and crucially x and y carry no schema description at all — the description supplies the physical-pixel unit, which is the single most error-prone detail for this tool. It restates the text/id match semantics that the schema already documents, so the marginal value is concentrated in the coordinate explanation.

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?

States a specific verb (long-press) plus the three mutually exclusive target-resolution modes (x/y coordinates, text/contentDesc match, resource id/identifier match), which an agent can act on directly. It never names tap or double_tap as alternatives, so differentiation from siblings is left to the reader even though the action itself 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 Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Usage is implied by the description of the targeting modes, and it adds one useful prerequisite ("An iPhone needs install_runner once"). There is no explicit when-to-use/when-not guidance, no statement of precedence if both x/y and text/id are supplied, and no pointer to tap/double_tap for shorter gestures.

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