Skip to main content
Glama

glass_a11y_snapshot

Capture the active window's accessibility tree as compact text with element IDs for addressing and interacting with UI elements.

Instructions

Capture the active window's accessibility tree (semantic elements: role, name, description, window-relative bounds) as compact text — deterministic, low-token element addressing alongside screenshots. Each line is #<id> <Role> "<name>" desc="<description>" (x,y wxh) [states]. desc carries a second label the platform exposes apart from the name, and appears only where one exists and differs from the name; it is display-only, since glass_wait_for_element and glass_scroll_to_element select on name, not description. Pass an #id to glass_click_element. Errors if the backend or app exposes no accessibility tree (e.g. a canvas/black-box app) — fall back to glass_screenshot then. Optional max_nodes: raise the element cap, or 0 to remove the element-count limit (default caps protect the token budget).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
max_nodesNoMaximum number of elements to include. Omit for the default cap (protects the token budget). Pass a larger number to raise it, or `0` for the full tree (no limit). A snapshot renumbers ids, so re-read them after changing this.
Behavior5/5

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

Fully discloses output line format, that desc is display-only, that element selection uses name, error conditions when no tree is exposed, the fallback behavior, and the semantics of max_nodes including id renumbering. With no annotations provided, this description carries the entire burden and does so thoroughly.

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?

The description is dense but well-organized: purpose, output format, desc semantics, error handling, and parameter usage. Every sentence contributes essential information, with no redundancy or fluff.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given no output schema and no annotations, the description completely specifies the return format, error conditions, fallback, integration with sibling tools, and parameter behavior. It leaves no significant gaps for an agent to understand selection and invocation.

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?

The schema already covers max_nodes with 100% description coverage, including default cap, 0 meaning no limit, and id renumbering. The description's parameter sentence repeats this without adding new meaning, so it stays at the baseline for high schema coverage.

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?

The description explicitly states it captures the active window's accessibility tree as compact text, with deterministic low-token addressing. It clearly distinguishes itself from visual screenshots and element interaction tools, even naming the fallback to glass_screenshot.

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

Usage Guidelines5/5

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

Provides explicit integration context: use alongside screenshots, pass returned #id to glass_click_element, and if the tool errors due to no accessible tree, fall back to glass_screenshot. Names specific sibling tools and explains that glass_wait_for_element and glass_scroll_to_element select on name, not description.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/fixed-width/glass'

If you have feedback or need assistance with the MCP directory API, please join our Discord server