Skip to main content
Glama

clear_text_field

Remove text from Android device input fields by sending delete key commands. This tool helps clear text boxes during UI testing and development workflows.

Instructions

Clear text in current field by sending delete keys

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
lengthNo
device_serialNo

Implementation Reference

  • The clear_text_field tool handler: moves cursor to end of field and sends multiple delete keyevents to clear up to the specified number of characters. Registered via @mcp.tool() decorator.
    @mcp.tool() def clear_text_field(length: int = 50, device_serial: str | None = None) -> str: """Clear text in current field by sending delete keys""" # Move to end and delete backwards run_adb(["shell", "input", "keyevent", "KEYCODE_MOVE_END"], device_serial) for _ in range(length): run_adb(["shell", "input", "keyevent", "KEYCODE_DEL"], device_serial) return f"Cleared up to {length} characters"

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/rahulkr/r_adb_mcp_server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server