Skip to main content
Glama

get_window_state

Read-only

Capture an indexed Accessibility UI tree from any macOS window or app in the background, including window-relative coordinates, state diffs, and optional isolated screenshots for UI automation.

Instructions

Capture the indexed Accessibility (AX) UI tree ([1], [2], ...) of any macOS window or application in the background with 1:1 window-relative @(x,y WxH) coordinates, smart diffing, and optional isolated window screenshot.

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": "get_window_state"
  }
}

Input Schema

NameRequiredDescriptionDefault
appNoApplication name or bundle ID (auto-launches in background if auto_launch=true).
window_idNoTarget window ID from list_windows / get_state.
auto_launchNoAuto-launch app in background if not running (default true).
disable_diffNoForce returning the full AX tree instead of a diff against previous state.
window_titleNoOptional substring match on window title.
include_cursorNoWhen capturing a screenshot, composite the live virtual cursor and highlight overlay into the image (default false so screenshots stay clean).
screenshot_onlyNoReturn only the screenshot (resets AX diff baseline for next state call).
include_screenshotNoInclude isolated 1:1 point JPEG screenshot of the window (default false).

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv3.0.0

TDQS

A3.5/5.0
Behavior3/5

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

Annotations already declare readOnlyHint=true, so the safety profile is covered. The description adds genuinely useful behavior beyond that — background capture, 1:1 window-relative @(x,y WxH) coordinates, and diffing against previous state — but omits operational preconditions such as required Accessibility permissions (a sibling 'permissions' tool exists) and what happens when the window or app is missing.

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?

A single front-loaded sentence that leads with the verb and resource before piling on qualifiers; no filler. It is dense to the point of being a run-on, but every clause conveys real capability information.

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 an 8-parameter tool with no output schema, the description does the important work of characterizing the return value: an indexed AX tree with bracketed element references, window-relative coordinates usable for later actions, and diff semantics. What it lacks — permission prerequisites and failure behavior — are secondary but non-trivial for a macOS Accessibility tool.

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 every parameter already carries its own documentation and the baseline is 3. The description restates the diff and screenshot concepts that the schema already explains, adding only the coordinate format, so it does not meaningfully deepen parameter understanding.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a concrete verb and resource: capture the indexed AX UI tree of a macOS window or application, with the coordinate convention and optional screenshot called out. It is specific enough to distinguish from a generic state read, but it never names the sibling get_state or browser_tab_state to disambiguate which state tool an agent should pick.

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

Usage Guidelines3/5

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

The phrase 'in the background' implicitly describes the situation this fits (inspecting a window without foregrounding it), and 'smart diffing' implies repeated polling. There is no explicit when-to-use, when-not-to-use, or named alternative, so the routing decision is left to inference.

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