Skip to main content
Glama

Select text

select_text
Idempotent

Select a character range inside a text element through the accessibility API to copy or replace part of a value. Changes only the selection, not the text.

Instructions

Select a character range inside a text element through the accessibility API, for example to copy part of a value or to replace just that part with type_text. Defaults to selecting from start to the end of the value. Use set_value to replace the whole value instead. Only the selection changes; the text is not modified.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
startNoZero-based character offset to start the selection at (default 0)
lengthNoNumber of characters to select (default: through the end of the value)
element_idYesText element to select in, 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. Changed3 schema fields changedv0.3.1
    • addedInput schema / properties / element_id / description
      Added value: +"Text element to select in, from get_app_state"
    • changedInput schema / properties / length / description
      Previous value: -"Characters to select (default: to end)"New value: +"Number of characters to select (default: through the end of the value)"
    • changedInput schema / properties / start / description
      Previous value: -"Start offset (default 0)"New value: +"Zero-based character offset to start the selection at (default 0)"
  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 declare idempotentHint=true and destructiveHint=false, so safety is partly covered, but readOnlyHint=false is potentially confusing; the description resolves this well by clarifying 'Only the selection changes; the text is not modified.' It also documents the default selection range. It does not mention focus/in-view requirements or whether the target must already be focused, which is a real behavioral gap for a UI selection tool.

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 tight sentences: purpose first, then usage/alternative, then the non-mutation guarantee. No filler or repetition, 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?

For a 5-parameter mutation-adjacent UI tool with no output schema, the description covers what the action does, its non-destructive effect, and its alternative. The main omission is focus/visibility prerequisites and what happens if element_id is stale, but nothing critical to invoking it correctly is missing.

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 start, length, element_id, state_query and return_state are already fully documented. The description's default note ('from start to the end of the value') merely restates what the schema says for those params. Baseline 3 is appropriate when the schema carries the parameter burden.

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+resource+scope: 'Select a character range inside a text element through the accessibility API.' It also explicitly distinguishes itself from set_value and type_text, so an agent can route correctly without opening sibling 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 concrete use cases ('to copy part of a value or to replace just that part with type_text') and names the alternative with its selection condition ('Use set_value to replace the whole value instead'). When-to-use and when-to-use-something-else are both explicit.

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