Skip to main content
Glama

get_cursor_position

Retrieve the current mouse cursor position in screen coordinates for macOS automation tasks.

Instructions

Get the current mouse cursor position in screen coordinates.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The implementation of the get_cursor_position tool handler, which calls the cursor input helper and returns the x and y coordinates.
    async function handleGetCursorPosition(): Promise<CallToolResult> {
      const response = await runInputHelper("cursor", {});
      const { x, y } = CursorPositionResponseSchema.parse(response);
    
      return {
        content: [
          {
            type: "text" as const,
            text: JSON.stringify({ x, y }),
          },
        ],
      };
    }
  • The registration of the get_cursor_position tool within the tool definitions list.
      {
        name: "get_cursor_position",
        description: "Get the current mouse cursor position in screen coordinates.",
        inputSchema: zodToToolInputSchema(GetCursorPositionInputSchema),
        annotations: {
          readOnlyHint: true,
          destructiveHint: false,
        },
      },
    ];

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/antbotlab/mac-use-mcp'

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