Skip to main content
Glama

tap_relative

Tap on iOS Simulator screens using relative coordinates to automate testing and control devices. Specify X and Y positions between 0 and 1 for precise interaction.

Instructions

Tap using relative coordinates (rx, ry) in [0,1] where (0.5, 0.5) is center.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
rxYesRelative X in [0,1]
ryYesRelative Y in [0,1]
udidNoSimulator UDID (optional, defaults to booted simulator)

Implementation Reference

  • Implementation of the tap_relative tool logic.
    private async tapRelative(rx: number, ry: number, udid?: string) {
      if (!Number.isFinite(rx) || !Number.isFinite(ry) || rx < 0 || rx > 1 || ry < 0 || ry > 1) {
        throw new McpError(
          ErrorCode.InvalidRequest,
          'rx and ry must be finite numbers between 0 and 1.'
        );
      }
    
      const target = await resolveUdid(udid);
      try {
        const size = await this.getScreenSize(target);
        const x = Math.round(size.width * rx);
        const y = Math.round(size.height * ry);
    
        await execAsync(`idb ui tap --udid ${target} ${x} ${y}`);
  • Tool registration and schema definition for tap_relative.
    {
      name: 'tap_relative',
      description: 'Tap using relative coordinates (rx, ry) in [0,1] where (0.5, 0.5) is center.',
      inputSchema: {
        type: 'object',
        properties: {
          rx: { type: 'number', description: 'Relative X in [0,1]' },
          ry: { type: 'number', description: 'Relative Y in [0,1]' },
          udid: { type: 'string', description: 'Simulator UDID (optional, defaults to booted simulator)' },
        },
        required: ['rx', 'ry'],
        additionalProperties: false,
      },
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 the coordinate system but lacks behavioral details such as what happens if coordinates are out of bounds, whether it simulates a human tap with timing, if it requires the simulator to be active, or error handling. For a mutation tool (tap implies interaction) with zero annotation coverage, this is a significant gap.

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, efficient sentence with zero waste. It front-loads the key information (action and coordinate system) and avoids redundancy. Every word earns its place by clarifying the tool's unique aspect.

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 complexity of a mutation tool (tap action) with no annotations and no output schema, the description is incomplete. It lacks details on behavioral traits (e.g., error conditions, simulator state requirements), output expectations, or interaction effects. The schema covers parameters well, but the description does not compensate for the missing behavioral and output context.

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 100%, so the schema already documents all parameters ('rx', 'ry', 'udid') with their types and descriptions. The description adds minimal value by reinforcing the coordinate range and center point for 'rx' and 'ry', but does not provide additional syntax or context beyond what the schema states. Baseline 3 is appropriate when schema does the heavy lifting.

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 specific action ('Tap') with the resource ('relative coordinates') and distinguishes it from siblings like 'tap' (absolute coordinates) and 'tap_id'/'tap_text' (element-based). It specifies the coordinate system ([0,1] range) and reference point (center at 0.5,0.5), making the purpose unambiguous.

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

Usage Guidelines4/5

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

The description implicitly provides context by defining the coordinate system, which helps differentiate when to use this tool versus 'tap' (absolute coordinates) or 'tap_id'/'tap_text' (element-based). However, it does not explicitly state when to prefer this over alternatives or mention prerequisites like needing a booted simulator, though the optional 'udid' parameter hints at simulator context.

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