Skip to main content
Glama
aj47
by aj47
index.ts1.53 kB
/** * UI Automation Tools * Tools for interacting with native macOS UI elements */ import { z } from 'zod'; import { accessibilityManager } from '../../lib/accessibility.js'; import type { ToolResult } from '../../types/index.js'; /** * Click */ export const click = { name: 'click', description: 'Click at the current mouse position or at specific coordinates. ' + 'Supports left, right, and middle mouse buttons.', inputSchema: z.object({ x: z.number().optional().describe('X coordinate (optional, uses current position if not provided)'), y: z.number().optional().describe('Y coordinate (optional, uses current position if not provided)'), button: z.enum(['left', 'right', 'middle']).optional().describe('Mouse button (default: left)'), }), handler: async (args: { x?: number; y?: number; button?: 'left' | 'right' | 'middle' }): Promise<ToolResult> => { try { await accessibilityManager.click(args.x, args.y, args.button); const location = args.x !== undefined && args.y !== undefined ? ` at (${args.x}, ${args.y})` : ''; return { content: [ { type: 'text', text: `Clicked ${args.button || 'left'} button${location}`, }, ], }; } catch (error: any) { return { content: [ { type: 'text', text: `Error: ${error.message}`, }, ], isError: true, }; } }, }; // Export all UI tools export const uiTools = [ click, ];

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/aj47/electron-native-mcp'

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