Skip to main content
Glama

Robot Actions — Remote Device Control

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. 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?

With no annotations provided, the description carries the full burden of behavioral disclosure. It reveals that the tool returns after the tap is dispatched, includes an extra ~150ms focus-settle wait when the target is an EditText, and warns about the critical race condition if called in parallel with device_type. It also exposes ranking behavior among matches, covering side effects and sequencing requirements.

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?

The description is dense but every sentence earns its place: it front-loads the core action, then gives a clear exclusion case with an alternative, then explains disambiguation and device_type sequencing. There is no repetition or filler, and the critical warning is placed at the end where it stands out.

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?

The description covers purpose, usage boundaries, selection behavior, timing, and parallelism pitfalls. However, it does not explicitly state what the tool returns on success/failure or what happens when no matching element is found after scrolling. Since there is no output schema, a brief mention of return semantics would make it fully complete for an agent to handle errors gracefully.

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?

The schema description coverage is 100%, so the baseline is 3ressive. The tool description adds meaning beyond the schema by explaining that the `text` parameter also matches content-desc, that `resourceId` pins a specific element, and that candidate ranking favors interactive widgets. This extra context helps an agent choose and combine parameters correctly.

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?

The description states a specific verb and resource: 'Find a UI element by text, content-description, or resource-id and tap it.' It also distinguishes itself from siblings like device_tap and device_page_source by naming them explicitly and explaining the boundary, so an agent can pick the right tool without needing to inspect 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?

The description gives explicit when-to-use and when-not-to-use guidance: when an element lacks stable identifiers (image-only, Canvas, dynamic labels), it directs the agent to use `device_tap(x, y)` with bounds from `device_page_source`. It also explains how to disambiguate multiple matches using resourceId and ranks interactive widgets over passive labels, giving clear selection criteria.

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