Skip to main content
Glama

Robot Actions — Remote Device Control

iOS page source

ios_page_source
Read-onlyIdempotent

Get the UI hierarchy (page source) of an iOS device — THE single source of truth for element coordinates (physical screen points). Default format is "description": a compact list of visible named elements as Type: "name" @ (cx,cy) WxH, where (cx,cy) is the element CENTER and the exact tap point; when the visible text differs from the name (an app that sets accessibility identifiers) it is appended as label="…", and the element holding focus is flagged [focused] — on an Apple TV that is the element tvos_select/tvos_focus acts on. Prefer acting on these labels via ios_tap_by_label rather than tapping raw coordinates. Elements with 0-width/height bounds (e.g. bottom-tab labels) are flagged [zero-area] — they cannot be tapped by coordinate; use ios_tap_by_label instead. FINDING THINGS IN LONG LISTS: pass search to grep the WHOLE hierarchy (including elements scrolled off-screen) — matches below the fold are flagged [off-screen]; bring them into view with ios_scroll_to_element, don't swipe blindly. To disambiguate duplicate labels, filter by type or use ios_find_element (strategy "accessibility id"). Use format "xml" to JUDGE FROM THE TREE instead of trusting a coordinate: with label it returns the COMPLETE SUBTREE of that element (a sign-in dialog is ~15 lines, where the whole tree is ~185k characters and will not fit in a response), and without it the tree comes back with anonymous layout containers pruned — nothing findable is ever hidden behind a pruned ancestor. Reach for the subtree whenever you need attributes the compact format omits: value, placeholderValue, focused, enabled. Requires an active iOS automation session (auto-starts if needed).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
typeNoFilter (description format): only this element type, prefix optional e.g. "Button" or "XCUIElementTypeButton".
udidYesiOS device UDID
labelNoFilter: only return elements matching this label/name
formatNoOutput format: "description" (default, compact readable summary) or "xml" (full hierarchy)
searchNoCase-insensitive substring searched across the WHOLE hierarchy — type AND label — INCLUDING elements scrolled off-screen. Use this to locate an item in a long list (e.g. "Safari" in Settings) without swiping; off-screen hits are flagged [off-screen] so you can ios_scroll_to_element to them. Overrides visibleOnly.
visibleOnlyNoFilter: exclude elements outside the current viewport (default: true; ignored when search is set)
tappableOnlyNoFilter (description format): only interactive control types (Button, Cell, Link, TextField, Switch, Tab, etc). Default false.

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?

Annotations already cover the safety profile (readOnly, idempotent, non-destructive), and the description goes well beyond them: default output format, exact coordinate semantics (center point), [focused]/[zero-area]/[off-screen] flagging, xml pruning of anonymous containers, subtree return when label is set, and that a session auto-starts if needed. This is rich operational context.

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?

Front-loaded with purpose and format defaults, and nearly every clause carries information an agent needs. It is dense and long, with some over-explanation (repeated emphasis on zero-area and off-screen handling), but waste is minimal.

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?

No output schema exists, so the description carries the burden of explaining return values — and it does so thoroughly for both formats, including size caveats (185k chars) and which attributes the compact format omits. Nothing needed to invoke or interpret the tool correctly 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 coverage is 100%, so baseline is 3, but the description adds real meaning beyond the schema — e.g. that `search` greps the WHOLE hierarchy including off-screen hits and overrides visibleOnly, and that `label` with format 'xml' returns the complete subtree. These clarify interaction effects between parameters.

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 ('Get the UI hierarchy (page source) of an iOS device') and immediately distinguishes itself as 'THE single source of truth for element coordinates', positioning it against coordinate-tapping siblings. An agent can differentiate it from ios_safari_get_dom, device_page_source, and ios_find_element from the text alone.

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?

Explicit routing: prefer ios_tap_by_label over raw coordinates, use ios_scroll_to_element instead of blind swiping for off-screen matches, use ios_find_element (strategy accessibility id) to disambiguate duplicates, and choose format 'xml' to judge from the tree. Each alternative is paired with the condition that selects it.

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