Skip to main content
Glama

type_text

Type text on Android devices to automate input tasks. Handles spaces correctly for reliable text entry.

Instructions

Type text on the connected Android device. Handles spaces correctly.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
textYes

Implementation Reference

  • The handler function for the 'type_text' tool. It types text on an Android device using ADB by replacing spaces with %s and executing 'adb shell input text'.
    @mcp.tool() def type_text(text: str) -> str: """Type text on the connected Android device. Handles spaces correctly.""" # Replace spaces with %s for adb input adb_text = text.replace(" ", "%s") result = subprocess.run( ["adb", "shell", "input", "text", adb_text], capture_output=True, text=True, ) if result.returncode != 0: raise RuntimeError(f"Error typing text '{text}': {result.stderr}") return f"Text '{text}' has been typed successfully."

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/vs4vijay/espresso-mcp'

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