Skip to main content
Glama

page.long_press

Press and hold an element or point to trigger long-press menus, hold-to-confirm, or hold-to-record. Releases after a set duration or when a selector or text appears.

Instructions

Press and hold on an element or point: long-press menus, "press and hold" buttons, hold-to-confirm, hold-to-record. Holds for duration_ms, or until until_selector/until_text appears (or disappears with until_gone) and then lets go. Mouse holds creep by a pixel now and then as a resting hand does. release:false keeps holding so page.drag or page.pointer can continue.

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

Input Schema

NameRequiredDescriptionDefault
xNoWith y and no locator: press this viewport point (CSS px).
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.
xpathNoXPath expression.
buttonNo
verifyNoWatch for DOM mutations after the gesture. Default true.
releaseNoDefault true. false: keep holding after duration_ms.
frame_idNoFrame to search within; see page.list_frames.
selectorNoCSS selector; pierces shadow DOM.
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.
until_goneNoInvert until_*: release once it is gone.
until_textNoRelease as soon as this text is on the page.
duration_msNoHow long to hold. Default 800; with until_* it is the most it will wait (default 15000, max 120000).
until_selectorNoRelease as soon as this CSS selector matches.
backend_node_idNoCDP backendNodeId, e.g. from inspector.pick.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.1/5.0
Behavior4/5

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

Annotations only say readOnlyHint=false and openWorldHint=true; the description goes well beyond by disclosing the hold loop (duration_ms, or wait until a selector/text appears, invertible with until_gone), the release:false continuation behavior, and the human jitter that occurs during mouse holds. It does not state what happens if the until_* condition never appears (timeout/error behavior) or any side effects of triggering context menus.

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 comes first, followed by the hold/release mechanics — well front-loaded and dense. A few phrases are slightly indirect ("until until_selector/until_text appears", "as a resting hand does"), but no sentence is filler.

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 24-parameter, no-output-schema gesture tool, the description covers the core control flow an agent needs: target, hold duration versus condition-based release, inversion, and holding past return. Only edge behavior (timeout outcome, interaction with verify) is left entirely to the schema and annotations.

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 coverage is 92%, so the schema already documents nearly every parameter and the baseline of 3 applies. The description does add real meaning for a few: the duration_ms default shift to 15000/max 120000 under until_*, the inversion semantics of until_gone, and why jitter exists mid-hold. That is useful but limited against 24 parameters.

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 ("Press and hold on an element or point") and immediately grounds it in concrete use cases: long-press menus, press-and-hold buttons, hold-to-confirm, hold-to-record. The final clause separates it from page.drag and page.pointer by explaining that release:false hands the gesture off to those tools, so an agent can tell which tool owns which part of a gesture.

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?

The enumerated scenarios (menus, hold-to-confirm, hold-to-record) give clear positive guidance on when this tool applies, and the release:false clause signals the handoff point to page.drag/page.pointer. It stops short of explicit exclusions — nothing says when to prefer page.press or page.click instead of a hold.

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