Skip to main content
Glama

Robot Actions — Remote Device Control

Device tap by text

device_tap_by_text

Find a UI element by text, content-description, or resource-id and tap it. NOT always usable — for elements without stable text/contentDesc/resourceId (image-only icons, custom Canvas widgets, dynamic/localized labels), use device_tap(x, y) with bounds from device_page_source instead. Both tools are first-class. When multiple nodes share the same text, this tool ranks candidates so an interactive widget (EditText, Button) wins over a passive label (TextView) — pass resourceId to pin a specific element. Returns after the tap is dispatched; an additional ~150ms focus-settle wait is included when the matched element is an EditText so a following device_type lands in the right field. When nothing in the accessibility tree matches text/contentDesc (and no resourceId is given), it falls back to reading the screen with OCR and taps the matching on-screen text; the reply says when OCR was used. CRITICAL: call this BEFORE device_type sequentially — do NOT issue both in parallel, or the type may race the focus change and write into the previously-focused field.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
textNoVisible text of the element (matches text or content-desc)
udidYesDevice serial number (UDID)
maxScrollNoMax auto-scroll attempts before giving up (default: 3)
autoScrollNoIf not found on-screen, scroll to look for it before failing (default: true)
resourceIdNoResource ID (e.g. com.android.chrome:id/url_bar)
contentDescNoContent description / accessibility label
scrollDirectionNoAuto-scroll direction (default: down)

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.8/5.0
Behavior5/5

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

Annotations only declare the safety profile (non-readonly, non-idempotent, non-destructive); the description adds the OCR fallback, the candidate-ranking heuristic favoring interactive widgets, the ~150ms EditText focus-settle wait, and the exact return timing. That is rich behavior beyond what annotations convey.

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 is front-loaded and every sentence carries operational content (fallback, ranking, timing, sequencing). It is dense and long, and 'Both tools are first-class' is slightly editorial, but nothing is wasted filler.

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 7-param tap tool with no output schema, the description covers matching strategy, fallbacks, return timing, and interaction with the sibling type tool. An agent has everything needed to invoke it correctly and sequence it safely.

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 adds real semantics: how text/contentDesc/resourceId interact, that resourceId pins a specific element, and why text is preferred. It doesn't cover maxScroll/autoScroll/scrollDirection beyond the schema, keeping it just short of a 5.

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+resource ('Find a UI element ... and tap it') and immediately scopes the resource types (text, content-description, resource-id). It clearly differentiates itself from device_tap and device_type by name, so an agent can route without opening schemas.

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?

Explicitly names when NOT to use it (image-only icons, Canvas widgets, dynamic/localized labels) and the alternative (device_tap with bounds from device_page_source). It also states the critical sequencing rule relative to device_type (call before, do not parallelize) and the resourceId pinning escape hatch.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources