Skip to main content
Glama

type_text

Type text into focused elements on iOS simulators for automated testing and interaction workflows.

Instructions

Type text into the currently focused element on the simulator

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
textYesText to type
udidNoSimulator UDID (optional, defaults to booted simulator)

Implementation Reference

  • The handler implementation for the `type_text` tool, which executes the `idb ui text` command.
    private async typeText(text: string, udid?: string) {
      const target = await resolveUdid(udid);
      try {
        const safe = text.replace(/'/g, "'\\''");
        await execAsync(`idb ui text --udid ${target} '${safe}'`);
        return {
          content: [{ type: 'text', text: `Typed "${text}" on ${target}` }],
        };
      } catch (error: any) {
        throw new McpError(ErrorCode.InternalError, `Failed to type text: ${error.message}`);
      }
    }
  • src/index.ts:398-407 (registration)
    The tool definition and registration for `type_text` within the listTools handler.
    name: 'type_text',
    description: 'Type text into the currently focused element on the simulator',
    inputSchema: {
      type: 'object',
      properties: {
        text: { type: 'string', description: 'Text to type' },
        udid: { type: 'string', description: 'Simulator UDID (optional, defaults to booted simulator)' },
      },
      required: ['text'],
      additionalProperties: false,
  • The tool execution switch case that maps the `type_text` tool to the class method.
    case 'type_text':
      return this.typeText(args.text as string, args.udid);
    case 'swipe':
      return this.swipe(args.from_x, args.from_y, args.to_x, args.to_y, args.duration_ms, args.udid);
Behavior2/5

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

No annotations are provided, so the description carries the full burden. It mentions typing into a focused element but doesn't disclose behavioral traits like whether it simulates keystrokes, handles special characters, requires the simulator to be running, or what happens if no element is focused. This leaves significant gaps for an agent to understand the tool's behavior.

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?

The description is a single, direct sentence that efficiently conveys the core action without unnecessary words. It's front-loaded with the main purpose, making it easy to parse and understand quickly.

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?

Given the lack of annotations and output schema, the description is incomplete. It doesn't cover important aspects like error conditions, return values, or detailed behavioral context (e.g., interaction with simulator state). For a tool that interacts with a UI simulator, more guidance is needed to ensure proper usage.

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?

The schema description coverage is 100%, with clear descriptions for both parameters ('text' and 'udid'). The description doesn't add any meaning beyond the schema, such as examples or constraints, but the schema itself is sufficient. This meets the baseline for high schema coverage.

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 ('currently focused element on the simulator'), making the purpose immediately understandable. However, it doesn't explicitly differentiate from sibling tools like 'tap_text' or 'press_button', which might also involve text input in some contexts.

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?

The description provides minimal guidance, stating only that it types into the 'currently focused element'. It doesn't explain when to use this versus alternatives like 'tap_text' (which might tap text elements) or 'press_button' (which could simulate keyboard input), nor does it mention prerequisites such as needing a focused element or simulator state.

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/xmuweili/app-screen-mcp'

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