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."
Behavior2/5

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

With no annotations provided, the description carries full burden. It mentions 'Handles spaces correctly' as a behavioral trait, but lacks critical details: whether this requires device interaction permissions, if it simulates keyboard input or direct injection, error conditions, or response format. For a mutation tool with zero annotation coverage, this is insufficient.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two concise sentences with zero waste: first states core purpose, second adds key behavioral detail. Front-loaded with essential information, appropriately sized for the tool's complexity.

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

Completeness2/5

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

For a mutation tool with no annotations, no output schema, and low schema coverage, the description is incomplete. It misses critical context: prerequisites (connected device), side effects, error handling, and what 'success' looks like. The 'Handles spaces correctly' hint is useful but insufficient for safe invocation.

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 0%, with one parameter 'text' undocumented in schema. The description adds marginal value by implying the parameter is text to type, but doesn't specify constraints (e.g., length, special characters) or format. Baseline is 3 as it compensates slightly for the coverage gap.

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?

The description clearly states the action ('Type text') and target ('on the connected Android device'), with the added detail 'Handles spaces correctly' providing specific functionality. It distinguishes from sibling 'clear_and_type_text' by not mentioning clearing, but doesn't explicitly differentiate from 'replace_text' or other text-related tools.

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

Usage Guidelines2/5

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

No explicit guidance on when to use this tool versus alternatives like 'clear_and_type_text', 'replace_text', or 'tap'. The description implies usage for text input on Android devices but provides no context about prerequisites (e.g., device connectivity) or exclusions.

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

Install Server

Other Tools

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