Skip to main content
Glama
zifanersuotang

Codex Android MCP

Android tap Text

android_tap_text
Destructive

Find and tap on-screen text via OCR for elements invisible to the view hierarchy, with optional expected-text confirmation.

Instructions

OCR the CURRENT screen and tap the center of the best text match — the same exact → case-insensitive-contains → candidate-list ambiguity rules as android_tap_element, for text the view hierarchy cannot see (Compose without semantics, Flutter, WebViews, game surfaces, badge counts, text baked into images). Prefer android_tap_element whenever the control HAS a resource-id or content-desc: identity beats pixels. On a real phone every tap has real consequences (posts, likes, purchases, messages): NEVER tap an unidentified control to find out what it does — if a control cannot be identified, STOP and report what you see. OCR boxes are image pixels and the tap is sent as center/screenshot-size, so no scale factor or rotation inverse is involved. After ~300 ms a fresh screenshot is captured with the same summary shape as android_interact. To CONFIRM the tap landed, pass expect_text (text that should appear) or expect_gone (text that should disappear) — the tool polls screen OCR and reports expected.matched in the SAME call. Do NOT screenshot-and-compare pixels to check whether a tap worked.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYesText to tap, e.g. "同意并继续" or "Continue". Case-sensitive exact match first, then case-insensitive substring; several distinct matches raise a candidate-list error.
serialNoTarget device serial from android_devices. Defaults to the currently streamed device, else the only connected one.
expect_goneNoOptional text that should DISAPPEAR after the tap. Mutually exclusive with expect_text; reported as expected.matched (true = the text is gone).
expect_textNoOptional text that should APPEAR after the tap. The tool polls screen OCR for up to ~4 s and reports expected.matched — one round trip instead of tap + screenshot + manual compare.
min_confidenceNoMinimum recognition confidence 0..1 for a match (default 0.3).
Behavior5/5

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

Annotations already mark destructiveHint=true, but the description adds crucial context: 'On a real phone every tap has real consequences (posts, likes, purchases, messages): NEVER tap an unidentified control to find out what it does.' It also explains the matching rules, the 300ms wait, the screenshot refresh, the polling behavior for expect_text/expect_gone, and the pixel-coordinate detail (no scale/rotation inverse). This goes well beyond the annotations by describing exactly what happens during execution, which is essential for a destructive action.

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 well-structured. It front-loads the core action, then layers matching rules, usage guidance, cautionary notes, technical pixel details, and confirmation method. Every sentence adds value; there is no redundancy or filler. Despite its length, it remains readable and purposeful.

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?

This is a complex tool (OCR, tapping, polling, ambiguity handling) with no output schema, so the description must carry the burden of explaining behavior and return values. It does: it mentions the fresh screenshot summary shape (same as android_interact), the expected.matched report, and the candidate-list error for ambiguous matches. It also covers the safety stop condition. For an agent to call this correctly, nothing essential is missing.

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 covers 100% of parameters with descriptions, so baseline is 3. The description adds meaningful semantics for the key parameters: it explains the query matching rules (exact → case-insensitive-contains → candidate-list ambiguity), and clarifies the purpose of expect_text/expect_gone as a single-round-trip confirmation mechanism. It doesn't repeat schema details but enriches them with usage context, justifying a score above baseline.

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 exactly what the tool does: OCR the current screen and tap the center of the best text match, with specific matching rules that mirror android_tap_element. It also clearly differentiates this tool from its sibling by specifying it works for text the view hierarchy cannot see, and explicitly says to prefer android_tap_element when resource-id or content-desc exists. This is a specific verb+resource+scope that leaves no ambiguity.

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 guidance on when to use this tool vs android_tap_element: 'Prefer android_tap_element whenever the control HAS a resource-id or content-desc: identity beats pixels.' It also warns against using this tool on unidentified controls and tells the agent to STOP and report instead. Additionally, it explicitly says not to screenshot-and-compare pixels to verify a tap, steering the agent to use expect_text/expect_gone instead. This is comprehensive usage direction.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/zifanersuotang/codex-android-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server