Skip to main content
Glama

type_text

Enter text into Android device input fields using ADB automation to simulate keyboard input for testing or control purposes.

Instructions

Type text into the currently focused input field

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
textYesText to type
device_idNoDevice ID (optional if only one device)

Implementation Reference

  • The actual implementation of the type_text logic using `input text` via adb.
    async typeText(text: string, deviceId?: string): Promise<void> {
      const escaped = escapeShellText(text);
      await this.exec(["shell", "input", "text", escaped], deviceId);
    }
  • src/index.ts:291-302 (registration)
    MCP tool registration for "type_text" and the handler wrapper.
    server.tool(
      "type_text",
      "Type text into the currently focused input field",
      {
        text: z.string().describe("Text to type"),
        device_id: z.string().optional().describe("Device ID (optional if only one device)"),
      },
      async ({ text, device_id }) => {
        await adb.typeText(text, device_id);
        return { content: [{ type: "text", text: `Typed: "${text}"` }] };
      },
    );

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/martingeidobler/android-mcp-server'

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