Skip to main content
Glama

vnc_type_multiline

Type multiple lines of text into a remote system via VNC. Accepts an array of lines to input sequentially, each separated by a newline.

Instructions

Type multiple lines of text, separated by newlines

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
linesYesArray of lines to type

Implementation Reference

  • The main handler function for vnc_type_multiline. Iterates over the array of lines, types each line using typeString(), and presses Enter after each line.
    export async function handleTypeMultiline(
      vncManager: VncConnectionManager, 
      args: { lines: string[] }
    ) {
      return vncManager.executeWithConnection(async (client) => {
        // Multi-line mode: type each string as a separate line with Enter after each
        for (const line of args.lines) {
          await typeString(client, line);
          
          // Always press Enter after each line
          const enterKeysym = getKeysym('Return');
          client.sendKeyEvent(enterKeysym, true);
          await new Promise(resolve => setTimeout(resolve, 50));
          client.sendKeyEvent(enterKeysym, false);
          await new Promise(resolve => setTimeout(resolve, 100)); // Brief pause between lines
        }
    
        return {
          content: [{ type: 'text', text: `Typed ${args.lines.length} lines: ${args.lines.join(' | ')}` }]
        };
      });
    }
  • Input schema registration for vnc_type_multiline: takes an array of strings (lines) as input.
    {
      name: 'vnc_type_multiline',
      description: 'Type multiple lines of text, separated by newlines',
      inputSchema: {
        type: 'object',
        properties: {
          lines: { type: 'array', items: { type: 'string' }, description: 'Array of lines to type' }
        },
        required: ['lines']
      }
  • src/server.ts:145-146 (registration)
    Tool dispatch: case handler that routes 'vnc_type_multiline' to handleTypeMultiline.
    case 'vnc_type_multiline':
      return await handleTypeMultiline(this.vncManager, args as any);
  • Helper function typeString() that iterates over characters and types them one by one.
    async function typeString(client: any, text: string) {
      // Determine if this text needs slower typing
      const hasSpecialChars = /[|:;&<>?/\\~`!@#$%^*()+=\[\]{}'",-]/.test(text);
      const isLongText = text.length > 10;
      const useSlowTyping = hasSpecialChars || isLongText;
    
      // Use different timing based on text complexity
      const keyHoldTime = useSlowTyping ? 75 : 50;
      const betweenKeyDelay = useSlowTyping ? 100 : 50;
    
      for (const char of text) {
        await typeCharacter(client, char, keyHoldTime, betweenKeyDelay);
      }
    }
  • Helper function typeCharacter() that handles pressing individual keys including Shift for special characters.
    async function typeCharacter(
      vncClient: VncClient, 
      char: string, 
      keyHoldTime: number, 
      betweenKeyDelay: number
    ) {
      // Check if this is a character that needs shift
      const needsShift = charNeedsShift(char);
      const keysym = getKeysym(needsShift ? getUnshiftedChar(char) : char);
      const shiftKeysym = getKeysym('Shift');
      
      console.error(`Typing '${char}' with keysym 0x${keysym.toString(16)}${needsShift ? ' (with Shift)' : ''}`);
      
      try {
        // Press Shift if needed
        if (needsShift) {
          vncClient.sendKeyEvent(shiftKeysym, true);
          await new Promise(resolve => setTimeout(resolve, 10));
        }
        
        // Press and release the key
        vncClient.sendKeyEvent(keysym, true);
        await new Promise(resolve => setTimeout(resolve, keyHoldTime));
        vncClient.sendKeyEvent(keysym, false);
        
        // Release Shift if it was pressed
        if (needsShift) {
          await new Promise(resolve => setTimeout(resolve, 10));
          vncClient.sendKeyEvent(shiftKeysym, false);
        }
        
        await new Promise(resolve => setTimeout(resolve, betweenKeyDelay));
      } catch (error) {
        console.error(`VNC library error typing character '${char}':`, error);
        // Rethrow to fail the entire text operation and allow client retry
        throw new Error(`VNC buffer error typing character '${char}'. This may be a temporary issue - please retry the operation.`);
Behavior2/5

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

With no annotations, the description carries full burden. It only states the basic action, omitting details on prerequisites, side effects, or handling of special characters. Minimal transparency.

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, front-loaded with key information, no wasted words. Efficiently conveys the core 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 one-parameter tool, the description is adequate but incomplete. It lacks behavioral details like whether it simulates keypresses or requires focus. Could be more comprehensive given no output schema.

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% with a clear description of 'lines' as array of strings. The description adds that lines are separated by newlines, which is a minor enhancement. 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 clearly states the tool's function: typing multiple lines of text separated by newlines. It uses a specific verb and resource, and the context of sibling tools like vnc_type_text implies differentiation.

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 is provided on when to use this tool versus alternatives like vnc_type_text or vnc_key_press. The description does not specify context or exclusions.

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