Skip to main content
Glama

glass_set_value

Set an editable UI element's value by its snapshot ID—text, number, boolean, or option. Verifies the write and gives actionable error details if it fails.

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). If at least two next actions or waits are known, use glass_do instead of separate calls.

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" (waits for visual stability and returns text-only metadata), or "none" (default).

Schema Changelog

Changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. Changed1 schema field changedv1.5.1
    • changedInput schema / properties / return / description
      Previous value: -"Optional observe folded into the result: \"snapshot\" (wait for the UI to settle, then\nfold a fresh a11y tree, also refreshing the snapshot cache), \"settle\" (wait for the UI\nto stop changing, text-only), or \"none\" (default)."New value: +"Optional observe folded into the result: \"snapshot\" (wait for the UI to settle, then\nfold a fresh a11y tree, also refreshing the snapshot cache), \"settle\" (waits for visual\nstability and returns text-only metadata), or \"none\" (default)."
  2. Addedv1.2.0
  3. Removedv1.1.0
  4. Addedv1.0.2

TDQS

A4.3/5.0
Behavior5/5

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

The description discloses the underlying mechanism: direct write where possible, otherwise tap-clear-type, up to three a11y reads, and confirmation. It explains error conditions and the meaning of each error variant, including the decision implication ('write again', 'do not write again'). This goes far beyond the annotations, which are all false and offer no behavioral signal.

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 very dense and front-loads the core operation well. All sentences carry meaningful information, especially the error-handling guidance. However, the long run-on paragraphs about error variants and next moves are harder to scan, and a bulleted structure would improve readability without losing content.

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?

For a tool with no output schema, the description is unusually complete: it covers prerequisities, performanc behavior, error conditions, recovery tactics, return modes, and relation to glass_do. It doesn't explicitly state what a successful result looks like when return is omitted, but the confirmation read-back and error semantics make successful invocatoin inferable. This is a small gap in an otherwise thorough definition.

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?

Schema description coverage is 100%, so the baseline is 3. The description reinforces that id comes from glass_a11y_snapshot and repeats return option semantics, but it does not add meaningfully new parameter-level detail beyond what the schema already documents. It adds selectively behavioral context, especially around errors, but not enough to raise the score above baseline.

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 states a specific verb and resource: 'Set an editable element's value' and anchors the target via '#id from glass_a11y_snapshot'. This clearly distinguishes it from sibling tools like glass_type, glass_click, and glass_do. It is not a tautology and names the batching alternary glass_do at the end.

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?

It tells the agent to pick the element's id from glass_a11y_snapshot, so the intended pre-recondition is clear. It explicitly says to use glass_do when two or more next actions/waits are known, which is useful routing guidance. It does not explicitly contrast with glass_type, but the semantic 'set value' versus raw typing is reasonably implied.

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

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