get_clipboard
Retrieve text content from the Windows clipboard to access copied data for automation workflows and system integration tasks.
Instructions
获取剪贴板内容
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Input Schema (JSON Schema)
{
"properties": {},
"type": "object"
}
Implementation Reference
- src/tools/clipboard.js:60-69 (handler)The core handler function that implements the 'get_clipboard' tool logic using PowerShell's Get-Clipboard command to retrieve and return the clipboard content.async getClipboard() { try { const { stdout } = await execAsync('powershell -Command "Get-Clipboard"', { shell: 'powershell.exe' }); return { success: true, content: stdout.trim() }; } catch (error) { return { success: false, error: error.message }; } }
- src/tools/clipboard.js:12-19 (schema)The schema definition for the 'get_clipboard' tool, specifying its name, description, and empty input schema (no parameters required).{ name: 'get_clipboard', description: '获取剪贴板内容', inputSchema: { type: 'object', properties: {}, }, },
- src/server.js:43-52 (registration)Registers the ClipboardTools instance as 'clipboard' in the server's tools dictionary, enabling discovery and execution of its tools including 'get_clipboard'.this.tools = { filesystem: new FileSystemTools(), process: new ProcessTools(), mouseKeyboard: new MouseKeyboardTools(), window: new WindowTools(), screen: new ScreenTools(), clipboard: new ClipboardTools(), powershell: new PowerShellTools(), browser: new BrowserTools(), };
- src/server.js:97-101 (registration)The dispatch logic in handleToolCall that routes tool calls to the appropriate module (ClipboardTools for 'get_clipboard') based on canHandle.for (const [category, toolModule] of Object.entries(this.tools)) { if (toolModule.canHandle(name)) { result = await toolModule.executeTool(name, args); break; }
- src/tools/clipboard.js:42-45 (helper)Helper method that determines if ClipboardTools can handle the 'get_clipboard' tool name.canHandle(toolName) { const tools = ['get_clipboard', 'set_clipboard', 'clear_clipboard']; return tools.includes(toolName); }