Skip to main content
Glama

java_set_text

Destructive

Set text in Java text fields, text areas, or editable combo boxes, replacing existing content and confirming the new value before returning.

Instructions

Type into a text field, text area or editable combo box.

This sets the text rather than appending to it, and it waits for the field to report the new value before returning, so a following read sees what was typed. By default it goes through the accessibility action; simulate=True types real keystrokes instead, which is the fallback when the action is refused.

Use java_fill_form instead when several fields need values: it is one round trip and it reports each field separately.

The element is verified before anything is typed, exactly as java_click describes.

Args: session_id: From java_attach_window. handle: The field to type into. value: The text to set. simulate: Type real keystrokes instead of using the accessibility action.

Returns: What was set, and a reminder to re-read the field to confirm.

Errors: is_error for an unknown handle, an element that changed, or a field that refused the text — the message says to try simulate=True when that is the likely answer.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "session_id": "<session_id>",
      "handle": "<handle>",
      "value": "<value>"
    },
    "name": "java_set_text"
  }
}

Input Schema

NameRequiredDescriptionDefault
valueYes
handleYes
simulateNo
session_idYes

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.8/5.0
Behavior5/5

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

Annotations only declare openWorldHint and destructiveHint; the description adds the substance behind that: existing text is overwritten (consistent with destructiveHint=true), the call blocks until the field reports the new value, the element is verified before typing, and error cases (unknown handle, changed element, refused text) are enumerated with the suggested remedy. No contradiction 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?

Front-loaded with purpose and semantics, then routing, then args/errors — good ordering and little filler. Minor waste: the Returns section restates a return contract that an output schema already covers, and the java_click cross-reference defers behavior elsewhere instead of stating it.

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?

Covers purpose, all four parameters, the fallback path, and error semantics for a 4-param mutation tool — an agent has enough to call it correctly. The one gap is that element verification is delegated ("exactly as java_click describes") rather than described, so the preconditions must be looked up in a sibling definition.

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

Parameters5/5

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

Schema coverage is 0%, so the description carries the full burden and does: session_id is tied to java_attach_window, handle is identified as the target field, value as the text to set, and simulate as the keystroke-vs-accessibility-action switch. This is meaning an agent cannot get from the bare schema.

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 concrete verb and resource ("Type into a text field, text area or editable combo box") and immediately clarifies the semantics that matter: it sets rather than appends. It also names the sibling it is not (java_fill_form), so an agent can distinguish it without opening either schema.

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?

Explicit routing: use java_fill_form when several fields need values (one round trip, per-field reporting), and use `simulate=True` as the fallback when the accessibility action is refused. Both the when-to-use and the alternative path are stated, not implied.

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