Skip to main content
Glama

Read accessibility tree

get_app_state
Read-onlyIdempotent

Read an app's accessibility tree as an indented outline with interactive element ids to target clicks, typing, and scrolls. Use it before interacting and again after UI changes to keep ids valid.

Instructions

Read an app's accessibility tree as an indented outline in which interactive elements carry ids like [e12] that click, type_text, set_value, scroll, hover and select_text accept. Use it instead of screenshot whenever you intend to act: it is far cheaper in tokens and gives exact targets. Call it before interacting and again after the UI changes, because ids are per-snapshot and a stale id fails. Read-only; it describes the app's visible windows and does not change focus.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
appYesApp name, bundle id, or pid exactly as reported by list_apps
queryNoOnly list elements whose role, label or value contains this text (case-insensitive). Ids stay valid. Use it instead of raising max_elements when you know what you are looking for.
max_depthNoMaximum nesting depth to descend (default 18). Lower it for a quick overview of a large window.
max_elementsNoMaximum elements to emit before the outline is truncated (default 800). Prefer `query` over raising this.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed3 schema fields changedv0.3.1
    • changedInput schema / properties / app / description
      Previous value: -"App name, bundle id, or pid"New value: +"App name, bundle id, or pid exactly as reported by list_apps"
    • changedInput schema / properties / max_depth / description
      Previous value: -"Max tree depth (default 18)"New value: +"Maximum nesting depth to descend (default 18). Lower it for a quick overview of a large window."
    • changedInput schema / properties / max_elements / description
      Previous value: -"Max elements to emit (default 800)"New value: +"Maximum elements to emit before the outline is truncated (default 800). Prefer `query` over raising this."
  2. First observedv0.3.0

TDQS

A4.7/5.0
Behavior5/5

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

Annotations already declare readOnlyHint and idempotentHint, and the description reinforces this by stating it is read-only and does not change focus. It adds valuable behavior beyond annotations: ids are per-snapshot and become stale, the cost benefit versus screenshot, and the output shape as an indented outline with bracketed ids.

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 compact and front-loaded, leading with the core action and output format before explaining when to use it. Every sentence carries useful information: id format, cost/benefit, freshness, and read-only behavior, with no filler.

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 there is no output schema, the description compensates by explaining the returned format, id syntax, and lifetime of ids. It covers cost, timing, and safety in enough detail that an agent can call this tool correctly and interpret the result without further documentation.

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 input schema already covers all 4 parameters with 100% descriptive coverage, so the baseline is 3. The description adds context about id semantics and the trade-off between query and max_elements, but does not substantially extend what the schema already conveys.

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 a specific verb and resource: 'Read an app's accessibility tree' as an indented outline, and explains the id format. It clearly differentiates from screenshot and from act-tools by noting that the ids are the inputs for click/type_text/etc.

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 guidance is given: use it instead of screenshot when intending to act, call before interacting and again after UI changes, and use query instead of raising max_elements. It also warns that stale ids fail, which directly informs when not to reuse a previous snapshot.

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