Skip to main content
Glama

ui_type

Input text into the iOS Simulator to automate typing in test scenarios.

Instructions

Input text into the iOS Simulator

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
udidNoUdid of target, can also be set with the IDB_UDID env var
textYesText to input

Implementation Reference

  • The handler function for the 'ui_type' tool. It accepts `udid` (optional) and `text` parameters, resolves the device ID via `getBootedDeviceId`, invokes `idb ui text --udid <udid> -- <text>`, and returns success or error response.
      async ({ udid, text }) => {
        try {
          const actualUdid = await getBootedDeviceId(udid);
    
          const { stderr } = await idb(
            "ui",
            "text",
            "--udid",
            actualUdid,
            // When passing user-provided values to a command, it's crucial to use `--`
            // to separate the command's options from positional arguments.
            // This prevents the shell from misinterpreting the arguments as options.
            "--",
            text
          );
    
          if (stderr) throw new Error(stderr);
    
          return {
            isError: false,
            content: [{ type: "text", text: "Typed successfully" }],
          };
        } catch (error) {
          return {
            isError: true,
            content: [
              {
                type: "text",
                text: errorWithTroubleshooting(
                  `Error typing text into the iOS Simulator: ${
                    toError(error).message
                  }`
                ),
              },
            ],
          };
        }
      }
    );
  • Zod schema definition for the 'ui_type' tool. Defines two inputs: `udid` (optional, matches UDID_REGEX) and `text` (required, max 500 chars, ASCII printable only via regex).
    {
      udid: z
        .string()
        .regex(UDID_REGEX)
        .optional()
        .describe("Udid of target, can also be set with the IDB_UDID env var"),
      text: z
        .string()
        .max(500)
        .regex(/^[\x20-\x7E]+$/)
        .describe("Text to input"),
    },
  • src/index.ts:388-444 (registration)
    Registration of the 'ui_type' tool on the MCP server. Wrapped in a filter guard (`isToolFiltered`). Calls `server.tool("ui_type", ...)` with description, schema, metadata (title, readOnlyHint, openWorldHint), and the handler function.
    if (!isToolFiltered("ui_type")) {
      server.tool(
        "ui_type",
        "Input text into the iOS Simulator",
        {
          udid: z
            .string()
            .regex(UDID_REGEX)
            .optional()
            .describe("Udid of target, can also be set with the IDB_UDID env var"),
          text: z
            .string()
            .max(500)
            .regex(/^[\x20-\x7E]+$/)
            .describe("Text to input"),
        },
        { title: "UI Type", readOnlyHint: false, openWorldHint: true },
        async ({ udid, text }) => {
          try {
            const actualUdid = await getBootedDeviceId(udid);
    
            const { stderr } = await idb(
              "ui",
              "text",
              "--udid",
              actualUdid,
              // When passing user-provided values to a command, it's crucial to use `--`
              // to separate the command's options from positional arguments.
              // This prevents the shell from misinterpreting the arguments as options.
              "--",
              text
            );
    
            if (stderr) throw new Error(stderr);
    
            return {
              isError: false,
              content: [{ type: "text", text: "Typed successfully" }],
            };
          } catch (error) {
            return {
              isError: true,
              content: [
                {
                  type: "text",
                  text: errorWithTroubleshooting(
                    `Error typing text into the iOS Simulator: ${
                      toError(error).message
                    }`
                  ),
                },
              ],
            };
          }
        }
      );
    }
Behavior2/5

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

Annotations indicate a write operation (readOnlyHint=false) with potential side effects (openWorldHint=true), but the description does not disclose whether text is appended or overwritten, or any other behavioral implications.

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?

Single sentence, no unnecessary words, perfectly concise and front-loaded.

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

Completeness3/5

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

Given the complexity of a text input tool with no output schema, the description lacks detail on return value or behavioral nuances, but is minimally adequate for a simple action.

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 coverage is 100% with parameter descriptions; the description adds no additional semantic value beyond what is already in the schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

Description clearly states the tool inputs text into iOS Simulator, using a specific verb and resource, distinguishing it from siblings like ui_tap and ui_swipe.

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 guidance on when to use this tool vs alternatives, no prerequisites or exclusions mentioned. The description is too brief to inform decision-making.

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/joshuayoes/ios-simulator-mcp'

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