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

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

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."
Behavior3/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It explains the core behavior ('Copies the provided text to the system clipboard, making it available for pasting in other applications') and mentions the return value, but doesn't cover potential limitations like text size constraints, platform-specific behavior, or error conditions. It adequately describes the basic operation but lacks depth about edge cases.

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 well-structured and appropriately sized. It begins with a clear purpose statement, follows with additional context about clipboard functionality, then provides specific sections for arguments and returns. Every sentence adds value without redundancy, and the information is front-loaded with the most important details first.

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 tool's simplicity (single parameter, no annotations, but has output schema), the description is reasonably complete. It explains what the tool does, how to use it, and what to expect in return. The output schema existence means the description doesn't need to detail return values, and it provides adequate context for basic clipboard writing functionality.

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

Parameters4/5

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

The description adds meaningful context for the single parameter 'text' by explaining it's 'The text content to write to the clipboard,' which provides semantic understanding beyond the schema's basic type information. With 0% schema description coverage and only one parameter, the description effectively compensates by clarifying what the parameter represents.

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's purpose with a specific verb ('Write') and resource ('text content to the system clipboard'), and distinguishes it from its sibling 'read_clipboard' by focusing on output rather than input. The first sentence directly answers what the tool does.

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?

The description provides clear context for when to use this tool ('to write text to the clipboard'), but doesn't explicitly mention when not to use it or compare it to alternatives. The existence of 'read_clipboard' as a sibling implies a complementary relationship, but no explicit guidance is given about choosing between them.

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

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