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.`);
      }
    }
Behavior2/5

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

No annotations are provided, so the description bears full responsibility for behavioral disclosure. It only states 'Type text string', omitting critical details such as whether typing is into a focused VNC element, any potential side effects, or required session state.

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 minimal (three words) with no wasted content, but it is arguably too sparse to be effective. It lacks necessary context such as usage hints, making it more under-specified than concisely informative.

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?

Given the simple tool with well-documented schema parameters, the description fails to provide essential context about the VNC environment, such as that typing occurs in a remote desktop session. The absence of an output schema and annotations further reduces completeness.

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% with both parameters having clear descriptions. The tool description adds no additional meaning beyond the schema, warranting the baseline score of 3 by the rubric's rule.

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 'Type text string' clearly states the verb ('type') and resource ('text string'), making the tool's basic function obvious. However, it does not explicitly distinguish itself from the sibling tool 'vnc_type_multiline', which likely types multiple lines, missing an opportunity to clarify single-line behavior.

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?

The description provides no guidance on when to use this tool versus alternatives like vnc_type_multiline or vnc_key_press. There is no mention of prerequisites, contexts, or exclusions, leaving the agent without decision-making support.

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