Skip to main content
Glama

get_app_state

Read-only

Reads an app's current UI state, launching it if needed, so agents can inspect menus, dialogs, controls, and text before acting; request a screenshot for visual content or coordinates.

Instructions

Start here: read the requested app by name or platform-specific identifier; it launches if needed. A locked Windows agent desktop can launch without OpenCU activating the window. Windows elevation-required launches return LAUNCH_FAILED with guidance for the person; OpenCU never elevates the program. Text normally suffices for menus, dialogs, indexed controls and text editing. Request an image for visual content or coordinates. For separately saved edits, create and verify the destination copy before editing because apps may autosave the source. Verify the saved result and any required source preservation before reporting completion; an action success only confirms input was sent.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "app": "<app>"
    },
    "name": "get_app_state"
  }
}

Input Schema

NameRequiredDescriptionDefault
appYesApp name or full app path; macOS bundle ID; macOS and Windows pid:<pid>; Windows process name, window title fragment, or Start-menu shortcut name; Linux desktop entry name, executable name or window title fragment
scopeNomacOS and Windows: element index from the latest returned state. Read only its retained subtree, renumbered from [1], including after actions. If it disappears, return the whole window with a notice. Linux returns INVALID_ARGUMENT.
disableDiffNo
waitForTextNoWait for exact, case-sensitive text in element lines only (within scope when supplied), excluding headers and window summaries, without UI actions. Use only a known expected label during a real load; omit on ordinary reads.
waitTimeoutMsNoPolling deadline for waitForText; defaults to 5000 ms. Native call timeouts remain separate.
includeScreenshotNoDefault false. Use true for visual content or coordinate input; omit for indexed controls, menus, dialogs and text editing.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.9.0

TDQS

A3.6/5.0
Behavior3/5

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

Adds substantial behavior beyond the annotations: launch-on-demand, locked Windows desktops, LAUNCH_FAILED on elevation with OpenCU never elevating, autosave risk, and the caveat that an action success only confirms input was sent. However, readOnlyHint=true sits uneasily with 'it launches if needed' — launching a process is a real side effect the annotation does not capture, and the description never reconciles that.

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 paragraph, front-loaded with the 'Start here' action and followed by the caveats an agent most needs. A few clauses (elevation guidance, autosave warning, verification rule) are stacked tightly and could be broken up, but none 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?

With six parameters, no output schema, and openWorldHint, the description covers launch semantics, failure signaling (LAUNCH_FAILED), read modes, and a completion-verification rule. What remains thin is how returned state is shaped (diff behavior, scope renumbering) — only partially hinted at even though the schema mentions it.

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 83%, so the schema already documents app, scope, waitForText, waitTimeoutMs and includeScreenshot. The description reinforces the includeScreenshot and waitForText decisions ('text normally suffices', 'omit on ordinary reads') but adds no new syntax or format detail for scope or app identifiers.

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?

"Start here: read the requested app by name or platform-specific identifier; it launches if needed" names a concrete verb and resource and signals it is the entry point of the sibling set (click, run_actions, list_apps, activate_app). It stops short of naming which sibling to use instead when the app is already familiar, so the differentiation from activate_app is only implied.

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?

Gives real routing rules: request an image only for visual content or coordinates, use waitForText only for a known expected label during a real load, and create the destination copy before editing when edits are saved separately. Missing an explicit statement of when to prefer activate_app or list_apps over this call.

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