Skip to main content
Glama
LukeLamb

claude-linux-mcp

clipboard_set

Destructive

Writes a string to the X11 CLIPBOARD selection, making it accessible for pasting in other applications.

Instructions

Write a string to the X11 CLIPBOARD selection.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
textYes

Implementation Reference

  • Handler function that writes a string to the X11 CLIPBOARD selection using xclip. Spawns xclip detached with stdin piped, sends the text, and resolves after 150ms to let xclip become the selection owner.
    function clipboardSet(args) {
      const missing = requireBin('xclip');
      if (missing) return Promise.resolve(errorResult(missing));
      if (typeof args.text !== 'string') return Promise.resolve(errorResult('text is required (string)'));
    
      return new Promise((resolve) => {
        const child = spawn(BIN.xclip, ['-selection', 'clipboard', '-i'], {
          detached: true,
          stdio: ['pipe', 'ignore', 'ignore'],
        });
        child.on('error', (e) => resolve(errorResult(`clipboard_set failed: ${e.message}`)));
        child.unref();
        try { child.stdin.end(args.text); } catch (_) {}
        // xclip forks once it has stdin; give it ~150ms to become the selection owner.
        setTimeout(() => resolve(textResult({ length: args.text.length })), 150);
      });
    }
  • Tool definition/input schema for clipboard_set. Specifies name, description, annotations (destructiveHint: true), and inputSchema expecting a required 'text' string.
    {
      name: 'clipboard_set',
      description: 'Write a string to the X11 CLIPBOARD selection.',
      annotations: { title: 'Write clipboard', destructiveHint: true },
      inputSchema: {
        type: 'object',
        properties: { text: { type: 'string' } },
        required: ['text'],
      },
    },
  • server.js:553-567 (registration)
    HANDLERS map that registers the clipboardSet function under the 'clipboard_set' key for JSON-RPC dispatch.
    const HANDLERS = {
      screenshot,
      list_windows: listWindows,
      focus_window: focusWindow,
      move_window: moveWindow,
      close_window: closeWindow,
      mouse_move: mouseMove,
      mouse_click: mouseClick,
      mouse_drag: mouseDrag,
      mouse_scroll: mouseScroll,
      type_text: typeText,
      key_press: keyPress,
      clipboard_get: clipboardGet,
      clipboard_set: clipboardSet,
      launch_app: launchApp,
  • Helper function that checks if a required system binary is available. Used by clipboardSet to verify xclip is installed before proceeding.
    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;
    }
Behavior3/5

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

Annotations indicate destructiveHint: true, so the tool is marked as destructive. The description adds minimal behavioral information beyond stating it writes to the clipboard. It could mention that it overwrites existing clipboard content or is X11-specific, but it does not. With annotations covering the destructive nature, a score of 3 is appropriate.

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?

The description is a single, front-loaded sentence that conveys everything necessary. No wasted words; every word earns its place.

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?

Given the low complexity (1 param, no output schema, annotations present), the description is mostly complete. It mentions the specific X11 selection, which is useful context. However, it could clarify that it overrides clipboard content and is limited to X11 environments. Still, it is sufficient for an agent to use correctly.

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?

The input schema has one parameter 'text' with no description (0% coverage). The description implicitly identifies it by saying 'Write a string', which matches the schema type. However, it does not add additional meaning such as format constraints, max length, or encoding. It adds marginal value over the schema alone.

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 action ('Write a string') and the resource ('to the X11 CLIPBOARD selection'), distinguishing it from sibling tools like clipboard_get. It is specific and unambiguous.

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

Usage Guidelines3/5

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

The description does not explicitly state when to use or not use this tool versus alternatives. However, given the sibling tool clipboard_get, the purpose is implicitly clear. No exclusions or alternative suggestions are provided, making it adequate but not thorough.

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