Skip to main content
Glama

Tap element

tap_element

Taps an Android UI element by resource_id, including unlabeled elements with no visible text, and optionally verifies that the tap changed the UI.

Instructions

Find an element by resource_id and tap its center — the id-addressed sibling of tap_on_text, for elements with no visible label. Runs describe_ui internally (filter=all, so even unlabeled wrapper nodes are findable) and re-resolves the element right before tapping, narrowing the window where a stale coordinate lands on an overlay (e.g. an Expo dev-menu bubble) the a11y tree never reported. Use exact match (partial=false) to avoid hitting the wrong item when ids overlap; verify_change reports whether the tap had any visible effect. If a coordinate tap lands but nothing happens (e.g. a Compose/RN NativeTabs bar), pass via_accessibility=true to dispatch a real accessibility click instead (EXPERIMENTAL — see that param's description).

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": {
      "resource_id": "<resource_id>"
    },
    "name": "tap_element"
  }
}

Input Schema

NameRequiredDescriptionDefault
serialNoTarget device serial (adb -s). Optional when exactly one device is attached.
partialNoSubstring match instead of exact. Default true.
resource_idYesResource id to find and tap, e.g. "com.example.app:id/submit_button" or just "submit_button" (matches by substring by default).
verify_changeNoAlso report whether the UI hierarchy changed after the tap (ui_changed: true/false). Costs two extra hierarchy reads (~2-3s); use when a tap silently doing nothing would send you down the wrong path.
via_accessibilityNoEXPERIMENTAL. Dispatch a real accessibility click (AccessibilityNodeInfo.performAction(ACTION_CLICK)) through the adb-mcp accessibility bridge instead of a coordinate tap — reaches native views (Compose/RN NativeTabs bars, some overlays) that ignore input tap entirely. Requires the bridge installed once per device: run "adb-mcp bridge install" on the host first, or this returns a clear error telling you to. Default false (coordinate tap).

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

A4.4/5.0
Behavior3/5

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

Annotations are minimal (destructiveHint=false, openWorldHint=false) and do not declare readOnly, so the description usefully adds that it runs describe_ui internally with filter=all, re-resolves right before tapping to shrink the stale-coordinate window, and can dispatch a real accessibility click requiring a one-time bridge install. That is meaningful behavior beyond the structured fields. It stops short of saying what the tool returns on failure to find the element or how a missing id is reported, which keeps it from the top band.

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?

Front-loaded with the core action and sibling relationship, then layered guidance in descending priority. Dense with parentheticals and slightly long for a single tool, but nearly every clause carries decision-relevant information rather than restating the name.

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 one-required-param tap tool with no output schema, it covers the failure modes an agent will actually hit: stale coordinates over overlays, silent no-op taps, unmatched ids, and the missing-bridge error. Nothing needed to invoke or recover is absent.

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 baseline is 3, but the description goes further by explaining the tradeoff behind partial vs exact matching and the cost/benefit of verify_change ('two extra hierarchy reads' is in the schema, but the guidance to set partial=false on overlapping ids is not). The via_accessibility sentence adds the recovery scenario, though it defers detail to the param description.

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 ('Find an element by resource_id and tap its center') and immediately differentiates it from the sibling tap_on_text by framing itself as the 'id-addressed sibling ... for elements with no visible label.' An agent can route between tap, tap_on_text, and tap_element without opening any schema.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

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

Gives explicit when-to-use conditions: exact match (partial=false) when ids overlap, verify_change when a silent no-op would derail the agent, and via_accessibility for Compose/RN NativeTabs bars that swallow coordinate taps. It also names the alternative (tap_on_text) and the situation that selects it.

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