move_mouse
Automatically move the mouse cursor to specific screen coordinates to automate Windows desktop interactions and system control tasks.
Instructions
移动鼠标到指定位置
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| x | Yes | X 坐标 | |
| y | Yes | Y 坐标 | |
| smooth | No | 是否平滑移动(可选) |
Input Schema (JSON Schema)
{
"properties": {
"smooth": {
"description": "是否平滑移动(可选)",
"type": "boolean"
},
"x": {
"description": "X 坐标",
"type": "number"
},
"y": {
"description": "Y 坐标",
"type": "number"
}
},
"required": [
"x",
"y"
],
"type": "object"
}
Implementation Reference
- src/tools/mouse-keyboard.js:125-136 (handler)The core handler function that moves the mouse to the specified (x, y) coordinates using robotjs, with optional smooth movement. Returns success status and position.moveMouse(x, y, smooth = false) { try { if (smooth) { this.robot.moveMouseSmooth(x, y); } else { this.robot.moveMouse(x, y); } return { success: true, position: { x, y }, message: '鼠标已移动' }; } catch (error) { return { success: false, error: error.message }; } }
- src/tools/mouse-keyboard.js:27-38 (schema)Tool schema definition including name, description, and input parameters (x, y required; smooth optional boolean).name: 'move_mouse', description: '移动鼠标到指定位置', inputSchema: { type: 'object', properties: { x: { type: 'number', description: 'X 坐标' }, y: { type: 'number', description: 'Y 坐标' }, smooth: { type: 'boolean', description: '是否平滑移动(可选)' }, }, required: ['x', 'y'], }, },
- src/tools/mouse-keyboard.js:108-109 (registration)Registration in the executeTool switch statement, dispatching to the moveMouse handler with parsed arguments.case 'move_mouse': return this.moveMouse(args.x, args.y, args.smooth);
- src/tools/mouse-keyboard.js:94-95 (registration)Tool name listed in the canHandle method's supported tools array.const tools = ['move_mouse', 'mouse_click', 'type_text', 'press_key', 'get_mouse_position', 'get_screen_size'];