Skip to main content
Glama

write_clipboard

Copy text to your system clipboard for pasting into other applications. This tool transfers provided text content to the clipboard across Linux, macOS, Windows, and WSL platforms.

Instructions

Write text content to the system clipboard.

Copies the provided text to the system clipboard, making it available for pasting in other applications. Args: text: The text content to write to the clipboard. Returns: A confirmation message indicating success.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
textYes

Implementation Reference

  • The core handler function for the 'write_clipboard' tool. It is registered via the @mcp.tool() decorator and implements the logic to copy the input text to the system clipboard using pyperclip, handling exceptions and returning a success message. Type hints define the schema: input 'text: str', output 'str'.
    @mcp.tool() def write_clipboard(text: str) -> str: """Write text content to the system clipboard. Copies the provided text to the system clipboard, making it available for pasting in other applications. Args: text: The text content to write to the clipboard. Returns: A confirmation message indicating success. """ try: pyperclip.copy(text) except pyperclip.PyperclipException as e: msg = f"Failed to write to clipboard: {e}" raise RuntimeError(msg) from e else: return "Successfully wrote to clipboard."

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