Skip to main content
Glama

ui_elements

Lists labelled native elements and their positions, including system popups, alerts, dialogs, and ads; use screenshots for game-drawn UI that does not appear here.

Instructions

List the labelled native elements on screen with their positions: system popups (permission requests, alerts), native dialogs and ads. A game that draws its own UI shows nothing here: use screenshot for it.

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": {
      "device": "<device>"
    },
    "name": "ui_elements"
  }
}

Input Schema

NameRequiredDescriptionDefault
appNoApp id: Android package, Apple bundle identifier; on "mac" the bundle identifier or app name (required there)
deviceYesDevice id (or exact name) from the devices tool

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.2

TDQS

A4.4/5.0
Behavior4/5

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

With no annotations, the description carries the burden and does disclose the key behavioral trait: it only sees native labelled elements, so canvas-rendered UI yields an empty result. It also states that positions are returned. It stops short of noting it is a non-mutating read or that results reflect only the current foreground screen, which would have closed the gap fully.

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?

Two short sentences, front-loaded with the capability and followed immediately by the exclusion rule. Every clause earns its place, including the concrete examples of what counts as native.

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?

For a two-parameter read tool with no output schema, the description covers what is returned (elements plus positions) and the main failure mode (nothing for self-drawn UI). The remaining ambiguity — whether app restricts to one app's windows or the whole screen — is minor but real.

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 both app and device are already fully documented in the schema. The description adds no parameter-level meaning — no note on whether app scopes the query or whether device must be foregrounded — so baseline 3 applies.

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 — list the labelled native elements with their positions — and enumerates the concrete categories it covers (system popups, permission requests, alerts, native dialogs, ads). It also draws a sharp boundary against screenshot-based inspection, so an agent can tell it apart from siblings without opening the schema.

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?

Gives both sides of the routing decision: native/labelled overlays belong here, while self-drawn game UI returns nothing and should go to screenshot instead. The negative case is stated explicitly along with the named alternative, leaving nothing to inference.

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