Skip to main content
Glama

tap

Tap a button, link or choice by ref. Returns the new screen, or only the lines that changed when the screen stayed the same one. The result starts with 'Change: none | content changed | new screen | scrolled'. Work that starts on a tap (paying, saving, loading) can finish after this returns, so the screen may show 'Paying...' or a spinner. Do not report that as the result: pass wait_for with the text you expect (and gone: true for the spinner), or settle: true, before you read the outcome or do anything else. To tap a known path in one call, pass then with the next things to tap, by visible name or ref.

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": {
      "session": "<session>",
      "ref": "<ref>"
    },
    "name": "tap"
  }
}

Input Schema

NameRequiredDescriptionDefault
refYesElement ref from the screen, e.g. e42. After a restart refs can carry a prefix, such as f1e42; use them exactly as the screen shows them.
thenNoMore taps to make after this one, in order: each is the visible name of the element to tap on the screen that follows (for example ["Settings", "Dark theme"]) or a ref. The path stops at the first step that is not on the screen.
settleNoWait until the screen stops changing (two equal reads 100 ms apart), up to timeout_ms. Use after any action that starts work. A slow result can still follow a pause, so prefer wait_for when you know the expected text.
compactNoWhen the change is 'content changed', the result lists only the lines that changed (+ added, - removed, ~ changed), with refs as on the full screen. This is the default. Pass false to get the whole screen.
sessionYesSession from open_app
approvedNoOnly after a tap answered approval_needed and the person said yes in chat: true repeats the tap with their approval. Never set it on your own.
wait_forNoUse after any action that starts work. Wait until this appears (a ref, a text, or role+name), or disappears with gone: true. The result says Waited: matched or timed out.
timeout_msNoHow long wait_for and settle may take, in ms (default 2000)

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • addedInput schema / properties / approved
      Added value: +{
      +  "description": "Only after a tap answered approval_needed and the person said yes in chat: true repeats the tap with their approval. Never set it on your own.",
      +  "type": "boolean"
      +}
  2. Changed2 schema fields changed
    • changedInput schema / properties / compact / description
      Previous value: -"When the change is 'content changed', return only the added/removed lines, not the whole screen"New value: +"When the change is 'content changed', the result lists only the lines that changed (+ added, - removed, ~ changed), with refs as on the full screen. This is the default. Pass false to get the whole screen."
    • addedInput schema / properties / then
      Added value: +{
      +  "description": "More taps to make after this one, in order: each is the visible name of the element to tap on the screen that follows (for example [\"Settings\", \"Dark theme\"]) or a ref. The path stops at the first step that is not on the screen.",
      +  "items": {
      +    "minLength": 1,
      +    "type": "string"
      +  },
      +  "maxItems": 8,
      +  "type": "array"
      +}
  3. Changed3 schema fields changed
    • changedInput schema / properties / ref / description
      Previous value: -"Element ref from the screen, e.g. e42"New value: +"Element ref from the screen, e.g. e42. After a restart refs can carry a prefix, such as f1e42; use them exactly as the screen shows them."
    • changedInput schema / properties / ref / pattern
      Previous value: -"^e\\d+$"New value: +"^(?:p\\d+|f\\d+)?e\\d+$"
    • changedInput schema / properties / wait_for / properties / ref / pattern
      Previous value: -"^e\\d+$"New value: +"^(?:p\\d+|f\\d+)?e\\d+$"
  4. Changed4 schema fields changed
    • addedInput schema / properties / compact
      Added value: +{
      +  "description": "When the change is 'content changed', return only the added/removed lines, not the whole screen",
      +  "type": "boolean"
      +}
    • addedInput schema / properties / settle
      Added value: +{
      +  "description": "Wait until the screen stops changing (two equal reads 100 ms apart), up to timeout_ms. Use after any action that starts work. A slow result can still follow a pause, so prefer wait_for when you know the expected text.",
      +  "type": "boolean"
      +}
    • addedInput schema / properties / timeout_ms
      Added value: +{
      +  "description": "How long wait_for and settle may take, in ms (default 2000)",
      +  "maximum": 30000,
      +  "minimum": 0,
      +  "type": "integer"
      +}
    • addedInput schema / properties / wait_for
      Added value: +{
      +  "additionalProperties": false,
      +  "description": "Use after any action that starts work. Wait until this appears (a ref, a text, or role+name), or disappears with gone: true. The result says Waited: matched or timed out.",
      +  "properties": {
      +    "gone": {
      +      "type": "boolean"
      +    },
      +    "name": {
      +      "type": "string"
      +    },
      +    "ref": {
      +      "pattern": "^e\\d+$",
      +      "type": "string"
      +    },
      +    "role": {
      +      "type": "string"
      +    },
      +    "text": {
      +      "type": "string"
      +    }
      +  },
      +  "type": "object"
      +}
  5. First observed

TDQS

A4.6/5.0
Behavior5/5

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

The annotations only declare readOnlyHint=false and destructiveHint=false, and the description adds substantially more: asynchronous side effects that continue after return, spinner states that must not be reported as final results, the change-type prefix format, the 'Waited: matched or timed out' convention, and the human-approval gate for `approved`. These are behavioral facts the annotations cannot express.

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?

The description is front-loaded with the action and result format, then the async hazard, then the batching option, so the order matches reading priority. It is slightly dense and repeats the 'use after any action that starts work' idea already carried by the `settle` and `wait_for` schema descriptions, costing a little tightness.

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?

With 8 parameters, a nested `wait_for` object, no output schema and only generic safety annotations, the description carries the burden well: it describes the return shape, the change-detection semantics, the timing model, and the approval flow. Nothing essential for a correct first call is missing.

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 description coverage is 100%, so every parameter is already documented, including `settle`, `compact`, `wait_for`, `approved` and `then`. The description restates much of that (the ref-by-name alternative for `then`, the default of `compact`, the wait_for-over-settle preference), adding little that the schema does not already say. The baseline 3 is appropriate here.

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 opens with a specific verb and resource: 'Tap a button, link or choice by ref.' It immediately states what the result looks like ('Change: none | content changed | new screen | scrolled') and adds a batching mode via `then`, so an agent knows exactly what the tool does and what it returns.

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?

It states which situations require extra steps: 'Work that starts on a tap (paying, saving, loading) can finish after this returns' and the rule to pass wait_for or settle before reading the outcome. It also compares the alternatives ('prefer wait_for when you know the expected text'), gives a clearance rule for `approved` ('Never set it on your own'), and explains when to use `then` versus single taps.

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.