Skip to main content
Glama

clear_text

Clears the currently focused text field by deleting its contents, using field length when available and a fallback deletion limit otherwise.

Instructions

Clear the currently focused text field. On Android it reads the focused element's text length from the UI tree and deletes accordingly (move to end + backspaces).

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "clear_text"
  }
}

Input Schema

NameRequiredDescriptionDefault
observeNoCapture screen state after clearing. Default: none
platformNoTarget platform. Inferred if omitted.
device_idNoDevice ID. Omit for the connected device.
max_charsNoFallback number of deletions when the field length cannot be determined. Default: 100 (Android) / 50 (iOS)
observe_delay_msNoMs to wait before observing. Default: 500

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv2.0.1

TDQS

A3.6/5.0
Behavior4/5

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

Annotations only declare readOnlyHint=false and destructiveHint=false, so the description carries the burden of disclosing what actually happens: it deletes text via "move to end + backspaces" and reads the element length from the UI tree first. That mechanism plus the implied fallback path is real behavioral context beyond the annotations. It still omits what iOS does and what happens when nothing is focused.

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?

Two sentences, front-loaded with the action and then the platform caveat, with no filler. The second sentence is less efficient because it spends its length on Android only while leaving the parallel iOS path unstated.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a five-parameter, no-output-schema mutation tool, the description covers the main path adequately and the schema covers the rest. It falls short on failure semantics (empty field, no focus target, unreadable UI tree) and on the iOS implementation, which are the details an agent would need to interpret a failed clear.

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 every parameter is already documented and the baseline is 3. The description explains that the text length is read from the UI tree, which is the reason max_chars exists as a fallback, but it adds nothing about observe, observe_delay_ms, platform, or device_id.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

"Clear the currently focused text field" is a specific verb+resource, and it implicitly separates this tool from type_text/set_clipboard by naming the exact target (focused field). No sibling is named explicitly and the iOS branch of the behavior is never described, keeping it just short of a 5.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The phrase "currently focused text field" implies the precondition that a field must already have focus, but the description never states when to prefer this over alternatives like press_key or a select-all-then-delete sequence, and gives no exclusion conditions.

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