Skip to main content
Glama

Set field value

set_value
DestructiveIdempotent

Replace a text field's full contents through the accessibility API, avoiding keystrokes. Use for long values or pre-filled fields; fall back to click and type if rejected.

Instructions

Replace a text field's entire contents in one step through the accessibility API, without keystrokes. Prefer it over type_text for long values or when the field already holds text; fall back to click plus type_text if the field rejects it, which the result reports. The previous value is discarded.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
valueYesNew complete value for the field
element_idYesText field to set, from get_app_state
state_queryNoWith return_state, list only elements whose role, label or value contains this text, like get_app_state's query
return_stateNoAfter acting, wait briefly for the UI to settle and append a fresh get_app_state of the app you last read, so you can check the result and pick the next target in the same call. Its ids replace every earlier id.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changedv0.5.2
    • addedInput schema / properties / return_state
      Added value: +{
      +  "description": "After acting, wait briefly for the UI to settle and append a fresh get_app_state of the app you last read, so you can check the result and pick the next target in the same call. Its ids replace every earlier id.",
      +  "type": "boolean"
      +}
    • addedInput schema / properties / state_query
      Added value: +{
      +  "description": "With return_state, list only elements whose role, label or value contains this text, like get_app_state's query",
      +  "type": "string"
      +}
  2. Changed2 schema fields changedv0.3.1
    • addedInput schema / properties / element_id / description
      Added value: +"Text field to set, from get_app_state"
    • addedInput schema / properties / value / description
      Added value: +"New complete value for the field"
  3. First observedv0.3.0

TDQS

A4.4/5.0
Behavior4/5

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

Annotations already declare destructiveHint=true and idempotentHint=true, so the safety profile is partly covered. The description adds meaningful context beyond them: the previous value is discarded, rejection is reported in the result, and no keystrokes are synthesized. A small gap remains on whether this requires focus or specific element state.

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 dense sentences with zero waste: mechanism first, then preference/alternative routing, then the destructive consequence. Each sentence earns its place and the most decision-relevant information is front-loaded.

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?

No output schema, but the description notes that rejection is reported in the result and that return_state appends fresh state, which is enough for an agent to interpret outcomes. Minor gaps remain on prerequisites such as whether the field must be focused first.

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 schema already documents all four parameters, including the return_state behavior. The description adds nothing about parameter formats beyond what the schema provides, so the baseline 3 applies.

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?

States a specific verb (replace/Set) and resource (a text field's entire contents) plus the mechanism (accessibility API, no keystrokes). It explicitly distinguishes itself from the type_text sibling, so an agent can route correctly without opening schemas.

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?

Gives explicit when-to-use ('prefer over type_text for long values or when the field already holds text') and a when-not/fallback path ('fall back to click plus type_text if the field rejects it'). Both the preferred case and the failure case are named with alternatives.

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