Skip to main content
Glama

type_text

Simulate text input on connected Android devices via the espresso-mcp server. Ensures accurate handling of spaces and characters for reliable automation.

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' MCP tool. It uses ADB to input the provided text on the connected Android device, replacing spaces with '%s' to handle them correctly.
    @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