Skip to main content
Glama

tap_element

Locate and tap a mobile UI element by text, resource ID, or type; optionally wait or scroll until it appears before tapping its center.

Instructions

Find a UI element by text, resource_id, or type and tap its center. Combines get_ui_tree + tap in one call. Optionally waits for the element, or scrolls to find it.

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

Input Schema

NameRequiredDescriptionDefault
indexNoIf multiple matches, tap the Nth one (0-based). Default: 0
observeNoCapture screen state after tapping. Default: none
platformNoTarget platform. Inferred if omitted.
wait_forNoIf true, poll until the element appears before tapping. Default: false
device_idNoDevice ID. Omit for the connected device.
text_exactNoTap element whose text matches exactly
timeout_msNoMax wait time when wait_for is true. Default: 10000
max_scrollsNoMaximum number of scrolls when scroll_to_find is true. Default: 5
resource_idNoTap element whose resource_id contains this substring (case-insensitive). Useful for icon buttons without visible text.
text_containsNoTap element whose text contains this substring (case-insensitive)
scroll_to_findNoIf true, scroll iteratively to find the element before tapping. Default: false
observe_delay_msNoMs to wait before observing. Default: 500
scroll_directionNoDirection to scroll the content when scroll_to_find is true. Default: down
observe_stabilizeNoIf true, wait for UI to stabilize after tap. Default: false

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv2.0.1

TDQS

A3.6/5.0
Behavior3/5

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

Annotations only say readOnlyHint=false and destructiveHint=false; the description adds genuinely useful behavior beyond that — it taps the element's center and internally combines a UI-tree read with a tap. It does not disclose what happens when no element matches (error vs. timeout), whether the tap fires at all in that case, or how observe interacts with the tap, which are the risky unknowns for a 14-parameter mutation tool.

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 front-loaded sentences with no wasted words: the primary action and matching strategy come first, the composite implementation and optional modes follow. Nothing is padded or repeated.

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 14-parameter tool with zero required parameters and full schema coverage, the description covers the core flow and both optional branches (wait, scroll). The remaining gap is failure semantics when nothing matches, and the unsupported 'type' selector, which is a small but real incompleteness.

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 the baseline is 3. The description adds conceptual framing ('tap its center', 'combines get_ui_tree + tap') but no syntax or format detail beyond the schema, and its 'by type' claim is not backed by any parameter.

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?

Names a specific verb (tap) and resource (UI element), plus the matching keys (text, resource_id) and the composite nature (get_ui_tree + tap). It is clearly distinguishable from the bare 'tap' and 'find_element' siblings. Minor flaw: it claims matching 'by type', but the input schema has no type parameter, so one advertised selector does not exist.

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?

The trailing sentence implies when the optional modes apply ('optionally waits for the element, or scrolls to find it'), which maps to wait_for and scroll_to_find. However, it gives no explicit when-to-use-this-vs-'find_element'/'tap'/'wait_for_element' guidance and no when-not conditions, leaving the agent to infer the choice.

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