Skip to main content
Glama
LukeLamb

claude-linux-mcp

type_text

Destructive

Types a string into the currently-focused window by emitting keystrokes. Use the delay parameter to control typing speed.

Instructions

Type a string into the currently-focused window (emits keystrokes). Use key_press for special/modifier combos.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
textYes
delayNoMilliseconds between keystrokes. Default 12.

Implementation Reference

  • The typeText function that executes the 'type_text' tool logic. It validates the 'text' argument is a string, sets a delay (default 12ms), then shells out to xdotool type --delay <ms> -- <text> to emit keystrokes into the currently-focused window.
    async function typeText(args) {
      const missing = requireBin('xdotool');
      if (missing) return errorResult(missing);
      if (typeof args.text !== 'string') return errorResult('text is required (string)');
      const delay = Math.max(0, Math.floor(args.delay ?? 12));
      const r = await run(BIN.xdotool, ['type', '--delay', String(delay), '--', args.text]);
      if (r.code !== 0) return errorResult(`type_text failed: ${r.stderr || r.stdout}`);
      return textResult({ length: args.text.length, delay_ms: delay });
    }
  • The tool registration object for 'type_text' in the TOOLS array, including its name, description, annotations (destructiveHint: true), and inputSchema (text: string required, delay: number optional).
    {
      name: 'type_text',
      description: 'Type a string into the currently-focused window (emits keystrokes). Use key_press for special/modifier combos.',
      annotations: { title: 'Type text', destructiveHint: true },
      inputSchema: {
        type: 'object',
        properties: {
          text: { type: 'string' },
          delay: { type: 'number', description: 'Milliseconds between keystrokes. Default 12.' },
        },
        required: ['text'],
      },
  • server.js:563-563 (registration)
    The HANDLERS map that registers the 'type_text' tool name to its handler function typeText.
    type_text: typeText,
  • The requireBin helper used by typeText to check if xdotool is installed before attempting to use it.
    function requireBin(name) {
      if (!BIN[name]) {
        return `Required system tool "${name}" is not installed. Install with: sudo apt install ${name === 'gnomeShot' ? 'gnome-screenshot' : name === 'xclip' ? 'xclip' : name === 'xdotool' ? 'xdotool' : 'wmctrl'}`;
      }
      return null;
    }
Behavior4/5

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

Description adds that it emits keystrokes and targets the focused window, which complements the destructiveHint annotation without contradiction.

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?

Two clear, well-structured sentences that efficiently convey purpose and usage guidance.

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

Completeness4/5

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

Covers tool purpose and alternative usage, but lacks details like error handling, cancellation, or behavior without a focused window.

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

Parameters2/5

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

The schema has 50% description coverage; the description only paraphrases the text parameter and does not explain the delay parameter beyond what the schema provides.

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 types a string into the currently-focused window and distinguishes it from key_press for special/modifier combos.

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

Usage Guidelines4/5

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

Explicitly tells when to use key_press instead, but doesn't provide other usage context like prerequisites or when not to use.

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/LukeLamb/claude-linux-mcp'

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