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
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/tools/screen.ts:97-109 (handler)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 }), }, ], }; } - src/tools/screen.ts:56-66 (registration)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, }, }, ];