Skip to main content
Glama

ui_describe_point

Read-only

Retrieve the accessibility element at specific coordinates on an iOS Simulator screen, enabling UI inspection for testing and automation.

Instructions

Returns the accessibility element at given co-ordinates on the iOS Simulator's screen

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
udidNoUdid of target, can also be set with the IDB_UDID env var
xYesThe x-coordinate
yYesThe y-coordinate

Implementation Reference

  • The async handler function that executes the tool logic. It resolves the booted device UDID (via getBootedDeviceId), calls `idb ui describe-point --udid <udid> --json -- <x> <y>`, and returns the accessibility element at the given coordinates. On error, returns a user-friendly troubleshooting message.
      async ({ udid, x, y }) => {
        try {
          const actualUdid = await getBootedDeviceId(udid);
    
          const { stdout, stderr } = await idb(
            "ui",
            "describe-point",
            "--udid",
            actualUdid,
            "--json",
            // 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.
            "--",
            String(x),
            String(y)
          );
    
          if (stderr) throw new Error(stderr);
    
          return {
            isError: false,
            content: [{ type: "text", text: stdout }],
          };
        } catch (error) {
          return {
            isError: true,
            content: [
              {
                type: "text",
                text: errorWithTroubleshooting(
                  `Error describing point (${x}, ${y}): ${toError(error).message}`
                ),
              },
            ],
          };
        }
      }
    );
  • Input schema defined using Zod for the tool. Defines three parameters: `udid` (optional, UUID format), `x` (number, the x-coordinate), and `y` (number, the y-coordinate).
    {
      udid: z
        .string()
        .regex(UDID_REGEX)
        .optional()
        .describe("Udid of target, can also be set with the IDB_UDID env var"),
      x: z.number().describe("The x-coordinate"),
      y: z.number().describe("The y-coordinate"),
    },
  • src/index.ts:517-570 (registration)
    Registration of the tool via `server.tool()` with the name "ui_describe_point", a description, the Zod schema, metadata options (title, readOnlyHint, openWorldHint), and the handler function. Wrapped in a conditional check `!isToolFiltered("ui_describe_point")` to allow disabling via the IOS_SIMULATOR_MCP_FILTERED_TOOLS environment variable.
    if (!isToolFiltered("ui_describe_point")) {
      server.tool(
        "ui_describe_point",
        "Returns the accessibility element at given co-ordinates on the iOS Simulator's screen",
        {
          udid: z
            .string()
            .regex(UDID_REGEX)
            .optional()
            .describe("Udid of target, can also be set with the IDB_UDID env var"),
          x: z.number().describe("The x-coordinate"),
          y: z.number().describe("The y-coordinate"),
        },
        { title: "Describe UI Point", readOnlyHint: true, openWorldHint: true },
        async ({ udid, x, y }) => {
          try {
            const actualUdid = await getBootedDeviceId(udid);
    
            const { stdout, stderr } = await idb(
              "ui",
              "describe-point",
              "--udid",
              actualUdid,
              "--json",
              // 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.
              "--",
              String(x),
              String(y)
            );
    
            if (stderr) throw new Error(stderr);
    
            return {
              isError: false,
              content: [{ type: "text", text: stdout }],
            };
          } catch (error) {
            return {
              isError: true,
              content: [
                {
                  type: "text",
                  text: errorWithTroubleshooting(
                    `Error describing point (${x}, ${y}): ${toError(error).message}`
                  ),
                },
              ],
            };
          }
        }
      );
    }
  • The `isToolFiltered` helper function reads from the IOS_SIMULATOR_MCP_FILTERED_TOOLS environment variable and checks if the tool name is in the filter list, allowing selective disabling of tools.
    // Read filtered tools from environment variable
    const FILTERED_TOOLS =
      process.env.IOS_SIMULATOR_MCP_FILTERED_TOOLS?.split(",").map((tool) =>
        tool.trim()
      ) || [];
    
    // Function to check if a tool is filtered
    function isToolFiltered(toolName: string): boolean {
      return FILTERED_TOOLS.includes(toolName);
    }
  • The `idb` helper function wraps the `run` function to execute the idb binary with the provided arguments. It's used by the handler to call the `ui describe-point` subcommand.
    /**
     * Runs the idb command with the given arguments
     * @param args - arguments to pass to the idb command
     * @returns The stdout and stderr of the command
     * @see https://fbidb.io/docs/commands for documentation of available idb commands
     */
    async function idb(...args: string[]) {
      return run(getIdbPath(), args);
    }
Behavior4/5

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

The description states it 'returns' the element, consistent with the readOnlyHint annotation. It adds context by specifying the coordinates and platform, but does not disclose behavior for invalid coordinates (e.g., returns null) or performance implications. The openWorldHint annotation is not addressed.

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?

A single 12-word sentence that is front-loaded with the verb and resource. Every word adds value, and there is no unnecessary information.

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

Completeness4/5

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

For a simple tool with only 3 parameters and no output schema, the description is sufficient to convey the main action. However, it could be improved by briefly describing the return value (e.g., 'Returns the accessibility element JSON or null if none found'). The absence does not severely harm usability.

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%, so the schema already describes each parameter adequately. The description does not add new semantic meaning beyond what is 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?

The description clearly states the verb 'Returns' and the resource 'accessibility element at given co-ordinates', specifying the platform (iOS Simulator). This differentiates it from siblings like 'ui_describe_all' which describe all elements. The purpose is unambiguous.

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

Usage Guidelines3/5

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

The description implies the tool is used to get an accessibility element at a point, but it does not explicitly state when to use it versus alternatives, nor does it mention prerequisites (e.g., simulator must be booted) or exclusions. No guidance on when not to use is provided.

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