Skip to main content
Glama

adb_tap_element

Finds a UI element by text, resource-id, or content-description and taps its center, providing a reliable alternative to coordinate-based taps in dynamic Android layouts.

Instructions

Find a UI element by text, resource-id, or content-description, then tap its center. Combines UI hierarchy search with input tap in one atomic operation. More reliable than coordinate-based taps for dynamic layouts.

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

Input Schema

NameRequiredDescriptionDefault
textNoMatch elements containing this text (case-insensitive)
indexNoWhich match to tap if multiple found (0 = first match, default)
deviceNoDevice serial
resourceIdNoMatch elements with this resource-id (partial match)
contentDescNoMatch elements with this content-description (partial, case-insensitive)

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv1.1.6
    • changedInput schema / $schema
      Previous value: -"http://json-schema.org/draft-07/schema#"New value: +"https://json-schema.org/draft/2020-12/schema"
  2. Changed1 schema field changedv1.1.3
    • removedInput schema / additionalProperties
      Removed value: -false
  3. First observedv1.1.1

TDQS

A4/5.0
Behavior3/5

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

With no annotations, the description must carry the full behavioral burden. It usefully flags that the search and tap are one atomic operation, but omits critical behavior for a mutation: what happens when zero elements match, whether it waits/polls for the element (vs. adb_wait_element), and whether a tap can trigger state changes on the device.

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?

Three short sentences: what it does, how it is implemented, and why it beats the alternative. Front-loaded and free of 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 five-param atomic action with full schema coverage and no output schema, the definition covers purpose, mechanism, and rationale. The remaining gap is failure/no-match behavior and whether the call blocks, which matters for an input-mutating tool with no 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 100%, so all five parameters, including the match index and the default of 0, are already documented in the schema. The description only echoes the three match keys and adds no tie-breaking, precedence, or multi-field combination semantics.

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 ('Find ... then tap its center'), the resource (UI element), and the three matching keys (text, resource-id, content-description). The closing comparison to coordinate-based taps makes clear it is not the generic adb_input path.

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 line 'More reliable than coordinate-based taps for dynamic layouts' gives a concrete condition for choosing this over adb_input-style tools. It stops short of naming the alternative tool or saying when element matching is the wrong choice (e.g., elements without text/ids).

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