Skip to main content
Glama

Tap on text

tap_on_text

Finds a UI element by its visible text or content-description and taps its center, so you can press a labelled button or row without computing coordinates yourself.

Instructions

Find an element by its visible text or content-description and tap its center — the one-shot way to press a labelled button/row without computing coordinates yourself. Runs describe_ui internally and prefers a clickable match. Matching folds typographic punctuation to ASCII, so a typed "Don't allow" finds the system dialog's "Don’t allow" (U+2019) and an en/em dash matches a hyphen. Use exact match (partial=false) to avoid hitting the wrong item when labels overlap. 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": {
      "text": "<text>"
    },
    "name": "tap_on_text"
  }
}

Input Schema

NameRequiredDescriptionDefault
textYesText or content-description to find.
serialNoTarget device serial (adb -s). Optional when exactly one device is attached.
partialNoSubstring match instead of exact. Default true.
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.6/5.0
Behavior5/5

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

Goes well beyond the sparse annotations (only destructiveHint=false, openWorldHint=false): it discloses that describe_ui runs internally, that a clickable match is preferred, that punctuation is folded, and that via_accessibility requires a one-time bridge install and is EXPERIMENTAL. The setup prerequisite and the silent-failure fallback path are exactly the behavioral context annotations do not carry.

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, then ordered by escalation: matching semantics, then exact-match advice, then the experimental fallback. Dense with no filler, though the closing EXPERIMENTAL parenthetical partially restates the parameter description.

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 five-parameter tap tool with no output schema and thin annotations, the description covers matching behavior, fallback strategy, prerequisites, and verification options. The only minor omission is what happens on a no-match (error vs. silent), which the caller could infer but would benefit from knowing.

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 the baseline is 3, but the description adds genuine meaning beyond the schema: the Unicode punctuation folding rule (U+2019 to ASCII apostrophe, en/em dash to hyphen) is invisible in the schema, and the partial=false recommendation is given with a rationale. The via_accessibility pointer mostly duplicates its parameter description rather than extending it.

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 its visible text or content-description and tap its center') and positions itself against coordinate taps. The phrase 'without computing coordinates yourself' plus the internal describe_ui mention distinguishes it from the raw tap/swipe siblings.

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?

Gives concrete when-to-use conditions: prefer this over coordinate taps, use partial=false when labels overlap, use via_accessibility=true when a coordinate tap lands but nothing happens on Compose/RN NativeTabs bars. It never names the near-identical sibling tap_element or tap explicitly, so an agent must infer the boundary from the description alone.

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