Skip to main content
Glama
Ronnietag
by Ronnietag

clipboard_read

Access clipboard content on Linux systems to retrieve copied text or data for integration with AI workflows and system operations.

Instructions

Read current clipboard contents

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The implementation of the clipboard_read tool, which attempts to read the clipboard using `xclip` or `pbpaste`.
    def execute_clipboard_read() -> str:
        """Read clipboard contents."""
        try:
            result = subprocess.run(
                ["xclip", "-selection", "clipboard", "-o"],
                capture_output=True,
                text=True,
                timeout=5,
            )
            if result.returncode == 0:
                return result.stdout
            return "(clipboard empty)"
        except FileNotFoundError:
            try:
                result = subprocess.run(
                    ["pbpaste"],
                    capture_output=True,
                    text=True,
                    timeout=5,
                )
                return result.stdout if result.returncode == 0 else "(clipboard unavailable)"
            except Exception:
                return "(clipboard tool not available)"
        except Exception:
            return "(clipboard read failed)"
  • Registration of the clipboard_read tool within the tools library.
        name="clipboard_read",
        scope=PermissionLevel.SAFE,
        description="Read current clipboard contents",
    )

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

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