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
| Name | Required | Description | Default |
|---|---|---|---|
| content | Yes | Content to copy to clipboard |
Implementation Reference
- src/categories/clipboard.ts:77-84 (handler)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 `,
- src/categories/clipboard.ts:67-76 (schema)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);
- src/framework.ts:224-224 (registration)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
- src/framework.ts:280-295 (handler)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) {