Skip to main content
Glama

vnc_move_mouse

Moves the mouse cursor to specified X and Y coordinates on the remote desktop.

Instructions

Move mouse to specified coordinates

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
xYesX coordinate
yYesY coordinate

Implementation Reference

  • The handler function that executes the vnc_move_mouse tool logic. It validates coordinates via VncConnectionManager.validateCoordinates, then calls client.sendPointerEvent with button mask 0 (no button pressed) to move the mouse cursor.
    export async function handleMoveMouse(
      vncManager: VncConnectionManager, 
      args: { x: number; y: number }
    ) {
      return vncManager.executeWithConnection(async (client) => {
        // Validate coordinates
        const coordValidation = vncManager.validateCoordinates(client, args.x, args.y);
        if (!coordValidation.valid) {
          throw new Error(coordValidation.error!);
        }
    
        client.sendPointerEvent(args.x, args.y, 0);
    
        return {
          content: [{ type: 'text', text: `Moved mouse to (${args.x}, ${args.y})` }]
        };
      });
    }
  • src/server.ts:139-162 (registration)
    Registration in the CallToolRequestSchema handler that routes the 'vnc_move_mouse' request to the handleMoveMouse function.
          case 'vnc_move_mouse':
            return await handleMoveMouse(this.vncManager, args as any);
          case 'vnc_key_press':
            return await handleKeyPress(this.vncManager, args as any);
          case 'vnc_type_text':
            return await handleTypeText(this.vncManager, args as any);
          case 'vnc_type_multiline':
            return await handleTypeMultiline(this.vncManager, args as any);
          case 'vnc_screenshot':
            return await handleScreenshot(this.vncManager, args as any);
          default:
            throw new Error(`Unknown tool: ${name}`);
        }
      } catch (error) {
        return {
          content: [
            {
              type: 'text',
              text: `Error: ${error instanceof Error ? error.message : String(error)}`
            }
          ]
        } as any;
      }
    });
  • The tool schema definition in the ListToolsRequestSchema handler, specifying input parameters (x, y) both required numbers.
    name: 'vnc_move_mouse',
    description: 'Move mouse to specified coordinates',
    inputSchema: {
      type: 'object',
      properties: {
        x: { type: 'number', description: 'X coordinate' },
        y: { type: 'number', description: 'Y coordinate' }
      },
      required: ['x', 'y']
    }
  • Helper method used by handleMoveMouse to validate that the x/y coordinates are within the VNC screen bounds before moving the mouse.
    public validateCoordinates(client: VncClient, x: number, y: number): CoordinateValidation {
      const screenWidth = client.clientWidth || 0;
      const screenHeight = client.clientHeight || 0;
      
      if (screenWidth === 0 || screenHeight === 0) {
        return { valid: true }; // Allow if dimensions not yet known
      }
      
      if (x < 0 || x >= screenWidth || y < 0 || y >= screenHeight) {
        return {
          valid: false,
          error: `Coordinates (${x}, ${y}) are outside screen bounds (0, 0) to (${screenWidth - 1}, ${screenHeight - 1})`
        };
      }
      
      return { valid: true };
    }
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries full burden. It does not disclose whether movement is absolute or relative, instantaneous or animated, or what side effects (e.g., triggering hover events) may occur. Minimal behavioral context.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Single sentence with no unnecessary words. Efficiently communicates the tool's purpose.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a simple mouse move operation with high schema coverage, the description is minimally adequate. However, it omits coordinate reference (e.g., screen vs. window), which may cause ambiguity for complex use cases.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100% (both x and y have descriptions). The description adds no additional meaning beyond 'X coordinate' and 'Y coordinate', so baseline of 3 is appropriate.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description 'Move mouse to specified coordinates' uses a specific verb ('move') and resource ('mouse'), clearly stating the action. It differentiates from sibling tools like vnc_click and vnc_key_press, which perform other actions.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance on when to use this tool versus alternatives like vnc_click or vnc_type_text. The description does not mention exclusions or context, leaving the agent to infer usage from the name alone.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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/hrrrsn/mcp-vnc'

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