Skip to main content
Glama

clipboard_set_clipboard

Copies specified text to your macOS clipboard using AppleScript, enabling quick content transfer between applications.

Instructions

[Clipboard management operations] Set clipboard content

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
contentYesContent to copy to clipboard

Implementation Reference

  • Handler logic for the set_clipboard script: generates AppleScript that sets the system clipboard to the provided content using `set the clipboard to "${args.content}"`, with error handling and success message.
    script: (args) => `
      try
        set the clipboard to "${args.content}"
        return "Clipboard content set successfully"
      on error errMsg
        return "Failed to set clipboard: " & errMsg
      end try
    `,
  • Input schema for set_clipboard tool: requires a 'content' string parameter.
    schema: {
      type: "object",
      properties: {
        content: {
          type: "string",
          description: "Content to copy to clipboard",
        },
      },
      required: ["content"],
    },
  • src/index.ts:28-28 (registration)
    Registration of the clipboard category containing the set_clipboard script by adding it to the MCP server.
    server.addCategory(clipboardCategory);
  • Tool name construction in listTools handler: combines category name 'clipboard' and script name 'set_clipboard' to form 'clipboard_set_clipboard'.
    name: `${category.name}_${script.name}`, // Changed from dot to underscore
  • Generic tool execution handler in CallToolRequestSchema: finds script by parsing tool name, generates script content, executes via osascript, returns result. This runs for clipboard_set_clipboard.
      const result = await this.executeScript(scriptContent);
      
      this.log("info", "Tool execution completed successfully", { 
        tool: toolName,
        resultLength: result.length
      });
    
      return {
        content: [
          {
            type: "text",
            text: result,
          },
        ],
      };
    } catch (error) {

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/joshrutkowski/applescript-mcp'

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