Skip to main content
Glama

get_app_state

Read-onlyIdempotent

Retrieve a target app's or window's screenshot, accessibility tree, and UI hints before running actions to locate elements by index or coordinates.

Instructions

Get a target app/window screenshot, accessibility tree, and uiHints. Call this before action tools, then use element_index or screenshot/window-relative coordinates. uiHints separates AT-SPI menu entries from tab/ribbon/toolbar controls; do not substitute a same-named menu for a requested tab.

Input Schema

NameRequiredDescriptionDefault
appYesApp name, Hyprland class/title, pid, or address:0x... selector.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.4.0

TDQS

A4.2/5.0
Behavior4/5

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

Annotations already cover the safety profile (readOnly, idempotent, non-destructive), and the description adds real value on top: it discloses the three return components and warns about uiHints semantics ('separates AT-SPI menu entries from tab/ribbon/toolbar controls; do not substitute a same-named menu'). It stops short of describing coordinate conventions or pagination/size behavior.

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?

Three tight sentences, front-loaded with the return contents followed by sequencing and the uiHints caveat. Every clause carries actionable information with no 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 no output schema, the description correctly compensates by naming what is returned and how element_index/coordinates are consumed downstream, and it flags the menu-vs-tab pitfall. The one missing piece is disambiguation from the similarly named read_app_state sibling.

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?

One parameter with 100% schema description coverage; the schema already documents the app selector formats (name, class/title, pid, address:0x...). The description adds no selector syntax or matching behavior beyond that, so the baseline of 3 is appropriate.

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?

Names a specific verb and resource and enumerates exactly what the state bundle contains: screenshot, accessibility tree, and uiHints. An agent knows this is a state-acquisition tool distinct from the primitive siblings like screenshot or click without opening the schema.

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?

Explicitly states sequencing ('Call this before action tools') and the follow-up usage ('then use element_index or screenshot/window-relative coordinates'). It does not, however, differentiate itself from the near-identically named sibling read_app_state, which is the most likely routing ambiguity here.

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