Skip to main content
Glama

vnc_type_text

Types text into a remote system connected via VNC. Optionally presses Enter after typing.

Instructions

Type text string

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
textYesSingle line of text to type
enterNoPress Enter after typing text

Implementation Reference

  • src/server.ts:89-99 (registration)
    Tool registration for 'vnc_type_text' with name, description, and inputSchema (text string, optional enter boolean)
    {
      name: 'vnc_type_text',
      description: 'Type text string',
      inputSchema: {
        type: 'object',
        properties: {
          text: { type: 'string', description: 'Single line of text to type' },
          enter: { type: 'boolean', description: 'Press Enter after typing text', default: false }
        },
        required: ['text']
      }
  • Main handler function 'handleTypeText' - types text using typeString(), optionally presses Enter, returns result text
    export async function handleTypeText(
      vncManager: VncConnectionManager, 
      args: { text: string; enter?: boolean }
    ) {
      return vncManager.executeWithConnection(async (client) => {
        // Single-line text input only
        await typeString(client, args.text);
    
        // Press Enter only if explicitly requested
        if (args.enter) {
          const enterKeysym = getKeysym('Return');
          client.sendKeyEvent(enterKeysym, true);
          await new Promise(resolve => setTimeout(resolve, 50));
          client.sendKeyEvent(enterKeysym, false);
        }
    
        const enterText = args.enter ? ' + Enter' : '';
        return {
          content: [{ type: 'text', text: `Typed text: ${args.text}${enterText}` }]
        };
      });
    }
  • src/server.ts:143-144 (registration)
    Routes 'vnc_type_text' tool calls to handleTypeText function via switch-case
    case 'vnc_type_text':
      return await handleTypeText(this.vncManager, args as any);
  • Helper function 'typeString' - iterates over each character, determines typing speed based on text complexity, calls typeCharacter
    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' - sends VNC key events per character, handles Shift for uppercase/symbols
    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.`);
      }
    }

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.2

TDQS

C2.8/5.0
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It only restates the tool name-level behavior and does not explain how typing is performed, where input lands, whether it is single-line, or whether Enter is pressed. The schema covers the enter option, but the description itself adds no 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.

Conciseness3/5

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

The description is very short and free of filler, but its brevity is not particularly informative. It is closer to under-specification than to purposeful, well-structured content, since it adds little beyond the tool name.

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

Completeness2/5

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

With no annotations and no output schema, the description needed to provide more orientation. It does not explain this tool's role among siblings, especially vnc_type_multiline, and does not clarify practical details such as whether text is typed into the focused VNC window. The schema covers parameters, but the overall context is incomplete.

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 description coverage is 100%: both 'text' and 'enter' are already described meaningfully. The description adds no meaning beyond the schema, but the baseline of 3 is appropriate because the schema carries the semantic weight.

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

Purpose4/5

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

The description states a clear action ('Type') and a clear object ('text string'), so an agent can tell this tool sends text input. However, it does not explicitly distinguish this tool from its sibling vnc_type_multiline or mention the VNC context, so it stops short of full 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?

There is no guidance about when to use this tool versus vnc_key_press, vnc_type_multiline, or vnc_screenshot. It also does not mention that text goes to the currently focused field, nor when the enter option should be enabled.

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