Skip to main content
Glama

iphone_ui_tree

Read-onlyIdempotent

Lists visible UI elements on the current iPhone screen as text with labels, values, and center coordinates, helping agents find buttons, fields, and text or read values without a screenshot.

Instructions

List the visible UI elements of the current screen as text, one per line: [Type] "label" value=… @(center x,center y) width×height, indented by nesting, all in iOS points.

Prefer this over iphone_screenshot to find buttons, fields and text and to read values: it is cheaper
and positions are exact. Pass the center point to iphone_tap, or use iphone_tap_text with the label.
Reads only; adds a note if the phone is locked.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "iphone_ui_tree"
  }
}

Input Schema

NameRequiredDescriptionDefault
max_linesNoMaximum number of elements to return (10–1000); the rest is cut off with a count.

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed3 schema fields changedv0.2.0
    • addedInput schema / properties / max_lines / description
      Added value: +"Maximum number of elements to return (10–1000); the rest is cut off with a count."
    • addedInput schema / properties / max_lines / maximum
      Added value: +1000
    • addedInput schema / properties / max_lines / minimum
      Added value: +10
  2. First observedv0.1.0

TDQS

A4.5/5.0
Behavior4/5

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

Adds useful behavioral detail beyond annotations: output line format, nesting indentation, iOS points, and a note if the phone is locked. 'Reads only' repeats readOnlyHint, but the locked-device note and format description provide extra context.

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?

Front-loads the output format and follows with routing guidance in two short, dense blocks. No sentence feels redundant or out of place.

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?

Given the presence of an output schema and full parameter documentation, the description covers what the tool returns, how to use results, and a relevant edge case (locked phone). Nothing an agent needs to invoke it correctly 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?

The sole parameter, max_lines, is fully documented in the schema, including range and truncation behavior. The description does not add meaning beyond the schema, 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 visible UI elements of the current screen as text". It distinguishes itself from iphone_screenshot by saying to prefer it for finding buttons, fields, text, and values.

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 the alternative (iphone_screenshot) and the condition that selects this tool: cheaper and exact positions. It also tells the agent what to do with results by passing center points to iphone_tap or using iphone_tap_text with labels.

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