Skip to main content
Glama

read_clipboard

Retrieve text content from your system clipboard to access copied information across Linux, macOS, Windows, and WSL platforms.

Instructions

Read the current text content from the system clipboard.

Returns the text currently stored in the clipboard. If the clipboard is empty or contains non-text data, an empty string is returned.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The handler function for the 'read_clipboard' tool. It reads the system clipboard content using pyperclip.paste(), handles exceptions by raising a RuntimeError, and returns the content or an empty string.
    @mcp.tool() def read_clipboard() -> str: """Read the current text content from the system clipboard. Returns the text currently stored in the clipboard. If the clipboard is empty or contains non-text data, an empty string is returned. """ try: content = pyperclip.paste() except pyperclip.PyperclipException as e: msg = f"Failed to read clipboard: {e}" raise RuntimeError(msg) from e else: return content if content else ""
  • Registers the read_clipboard tool on the FastMCP instance using the @mcp.tool() decorator.
    @mcp.tool()

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/dahlia/clipboard-mcp'

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