Skip to main content
Glama

input_tap

Simulate screen taps at precise coordinates on Android devices for automated testing and UI interaction.

Instructions

Tap at specific coordinates

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
xYesX coordinate for tap
yYesY coordinate for tap

Implementation Reference

  • The handler function that implements the input_tap tool logic: taps at (x,y) coordinates using ADB command and appends updated UI hierarchy dump.
    input_tap: async (args: any) => { const { x, y } = args as { x: number; y: number }; await executeCommand(`adb shell input tap ${x} ${y}`); const uiContent = await captureUIContent(false); return { content: [ { type: 'text', text: `Tap executed at coordinates: (${x}, ${y})`, }, ...uiContent, ], }; },
  • Input schema and metadata definition for the input_tap tool.
    name: 'input_tap', description: 'Tap at specific coordinates', inputSchema: { type: 'object', properties: { x: { type: 'number', description: 'X coordinate for tap', }, y: { type: 'number', description: 'Y coordinate for tap', }, }, required: ['x', 'y'], }, },
  • src/index.ts:26-30 (registration)
    Registration of the list tools handler, which exposes the input_tap tool via the toolDefinitions array.
    server.setRequestHandler(ListToolsRequestSchema, async () => { return { tools: toolDefinitions, }; });
  • src/index.ts:32-46 (registration)
    Registration of the call tool handler, which dynamically invokes the input_tap handler from toolHandlers object based on tool name.
    server.setRequestHandler(CallToolRequestSchema, async (request) => { const { name, arguments: args } = request.params; try { const handler = toolHandlers[name as keyof typeof toolHandlers]; if (!handler) { throw new McpError(ErrorCode.MethodNotFound, `Unknown tool: ${name}`); } return await handler(args); } catch (error) { const errorMessage = error instanceof Error ? error.message : String(error); throw new McpError(ErrorCode.InternalError, `Tool execution failed: ${errorMessage}`); } });

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/TiagoDanin/Android-Debug-Bridge-MCP'

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