Skip to main content
Glama

glass_a11y_snapshot

Read-only

Capture the active window's accessibility tree as deterministic, low-token text, listing each element's role, name, description, and bounds with stable IDs for targeted interaction.

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?

Annotations already mark readOnlyHint=true, and the description goes beyond by disclosing determinism, low-token output, the exact line format, that 'desc' is display-only and not used for selection, error conditions, and the renumbering of ids when max_nodes changes. No contradictions with annotations.

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?

The description is dense but well-organized: it front-loads the purpose and format, then explains nuances (desc display-only, error fallback, max_nodes) and integration notes. Every sentence contributes, though it could be tightened slightly for readability.

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?

For a tool with one optional parameter and no output schema, the description is remarkably complete: it defines the output format precisely, covers error handling and the fallback, explains how ids are used downstream, and details max_nodes behavior. An agent has everything needed to call it correctly.

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 single parameter max_nodes is fully documented in the schema (100% coverage), including the default cap, passing 0 for no limit, and the renumbering side effect. The description repeats 'raise the element cap' and 'default caps protect the token budget' without adding new semantics, 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 clearly states the specific action ('Capture the active window's accessibility tree') and the resource, including the exact output format. It distinguishes itself from glass_screenshot (image vs. text tree) and other element-related tools by spelling out the addressing mechanism and its integration role.

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?

It explicitly tells the agent when to fall back to glass_screenshot (when the app exposes no accessibility tree), names sibling tools (glass_wait_for_element, glass_scroll_to_element, glass_click_element) and explains how to use the snapshot's output with them, and signals when it complements screenshots. This is clear conditional usage guidance.

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