get_app_state
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
| Name | Required | Description | Default |
|---|---|---|---|
| app | Yes | App 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 | |
| scope | No | macOS 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. | |
| disableDiff | No | ||
| waitForText | No | Wait 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. | |
| waitTimeoutMs | No | Polling deadline for waitForText; defaults to 5000 ms. Native call timeouts remain separate. | |
| includeScreenshot | No | Default false. Use true for visual content or coordinate input; omit for indexed controls, menus, dialogs and text editing. |