Skip to main content
Glama

mac_ax_state

Read a foreground macOS app's accessibility tree to get element indexes, roles, titles, values, and frames for click or drag actions; optionally set app name and depth.

Instructions

Read the foreground app's accessibility tree (element index/role/title/value/frame; indexes feed mac_click/mac_drag for 30s); menu bar pruned by default (use mac_menu_command); optional app name and depth (default 3, clamped 1-10). Returns ax_empty if the app has no AX-visible window (not frontmost / another Space).

Input Schema

NameRequiredDescriptionDefault
appNo
depthNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.2

TDQS

A4.1/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 well: 30-second index validity, default menu-bar pruning, depth clamping, and the ax_empty failure mode with its likely causes (not frontmost / another Space). It omits macOS Accessibility permission prerequisites and output volume/size considerations.

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?

One dense, front-loaded paragraph with parenthetical detail rather than wasted sentences. It is slightly over-packed — the return-field list, TTL, pruning rule, and error case all compete in a single run-on — but nothing is filler.

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?

Covers return fields, default behavior, parameter bounds, downstream consumers, and the empty-result case, which is strong for a 2-param read tool with no output schema. The unresolved app-parameter semantics and missing permission note keep it from being fully complete.

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 coverage is 0%, so the description must compensate. It fully documents depth (default 3, clamped 1-10), but the app parameter is only called "optional app name" without explaining whether it targets a non-foreground app, which contradicts the "foreground app" framing in the opening clause.

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?

Opens with a specific verb+resource ("Read the foreground app's accessibility tree") and immediately enumerates the returned fields, so an agent knows exactly what it gets. It also distinguishes itself from mac_screenshot and browser_snapshot by being the AX-tree reader and clarifies its role as the index source for mac_click/mac_drag.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

States the menu-bar exception explicitly and routes it to mac_menu_command, and the "indexes feed mac_click/mac_drag for 30s" clause implies the read-then-act workflow. It lacks an explicit "call this first when you don't know element indexes" statement, but the context is clear.

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