Skip to main content
Glama

glass_set_value

Set a value on any editable UI element by its snapshot id. Handles typing, clearing, and read-back confirmation, with clear errors when the write fails or needs a re-snapshot.

Instructions

Set an editable element's value — pick the element's #id from glass_a11y_snapshot. Where the platform can write the value directly this is instant and takes no keystrokes; where it has to be typed, glass taps the element, clears it and types, then reads the element back to confirm — up to three accessibility reads, since a field may commit a frame or two later. Errors if the element isn't editable, if it changed since the snapshot (re-snapshot), if the element does not hold the requested value afterwards, or if the app exposes no accessibility tree. That does-not-hold error names both what you asked for and what the element holds, and which one it is decides your next move: your text in another form means the element transformed it and writing again will not help; part of your text means a keystroke was dropped, so write again; what it held before means the write took no effect, and the error then closes with what this backend knows about that. A separate error says the text WAS typed but the write could not be confirmed — the read-back failed, or could not tell which element now holds it. Do NOT write again on that one: the keystrokes already went out, and re-snapshotting is how you see where they landed. Optional return: "snapshot" settles the UI then folds a fresh a11y tree into the result (and refreshes the snapshot cache); "settle" waits for the UI to stop changing (text-only); omit or "none" for no observe (default).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYesThe element `#id` from `glass_a11y_snapshot`.
textYesThe value to set. For a text field, the text. For a spin/slider, a number. For a switch/checkbox/toggle, a boolean (`"true"`/`"false"`/`"on"`/`"off"`/ `"1"`/`"0"`) — idempotent. For a dropdown/combo box, an option label (case-insensitive); glass opens it and picks that option.
returnNoOptional observe folded into the result: "snapshot" (wait for the UI to settle, then fold a fresh a11y tree, also refreshing the snapshot cache), "settle" (wait for the UI to stop changing, text-only), or "none" (default).
Behavior5/5

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

Annotations only state it's not read-only and not destructive. The description far exceeds that by detailing the write strategies, the up-to-three accessibility reads for confirmation, the exact error conditions and their implications (transformed text, dropped keystrokes, no effect), and explicit retry prohibitions. This gives the agent deep insight into the tool's runtime behavior with no contradictions.

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 long but well-organized: purpose first, then mechanics, error conditions, and finally the optional parameter. Every sentence carries substantive detail, and the error-handling guidance is wrapped into the behavioral description. It could be slightly tightened without losing value, but the complexity justifies the length and structure.

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?

With no output schema, the description covers all needed runtime information: the input requirements, the optional return value behavior (including what 'snapshot' returns), error conditions with remediation steps, and what not to retry. An agent has everything it needs to invoke this tool correctly and recover from failures, making it highly complete for its complexity.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, but the description adds crucial nuance beyond the schema: it explains that `id` must come from `glass_a11y_snapshot`, that `text` has type-specific interpretations (spin/slider, switch/checkbox, dropdown), and it clarifies the `return` parameter's three modes (snapshot, settle, none) beyond the schema's wording. This meaningfully enhances the schema, though a baseline of 3 is already met.

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 opens with a specific verb-resource pair: 'Set an editable element's value', and immediately ties it to 'pick the element's #id from glass_a11y_snapshot'. This clearly differentiates it from sibling tools like glass_click or glass_type by naming the exact action and the required input source.

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?

The description explains the two execution modes (direct write vs typed fallback) and provides explicit error-handling rules, including when NOT to retry (the 'already typed' error). It implicitly positions the tool as the way to set values on editable elements, but it never explicitly names alternative tools like glass_type or glass_click for comparison, so usage guidance is clear but not contrastive.

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