clear_clipboard
Clear sensitive or outdated data from your Windows clipboard to maintain privacy and prevent accidental pasting of unwanted content.
Instructions
清空剪贴板
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/tools/clipboard.js:84-93 (handler)The core handler function for the clear_clipboard tool. It uses PowerShell to set the clipboard value to $null, effectively clearing it, and returns a success message or error.async clearClipboard() { try { await execAsync('powershell -Command "Set-Clipboard -Value $null"', { shell: 'powershell.exe' }); return { success: true, message: '剪贴板已清空' }; } catch (error) { return { success: false, error: error.message }; } }
- src/tools/clipboard.js:31-39 (registration)The tool definition object that registers 'clear_clipboard' in the getToolDefinitions() method, including name, description, and empty input schema (no parameters required).{ name: 'clear_clipboard', description: '清空剪贴板', inputSchema: { type: 'object', properties: {}, }, }, ];
- src/tools/clipboard.js:34-37 (schema)The input schema definition for clear_clipboard, which is an empty object since no input parameters are required.inputSchema: { type: 'object', properties: {}, },
- src/tools/clipboard.js:53-54 (helper)The switch case in executeTool() that dispatches calls to the clear_clipboard handler.case 'clear_clipboard': return await this.clearClipboard();
- src/tools/clipboard.js:43-43 (helper)The tools array used in canHandle() to check if clear_clipboard is supported.const tools = ['get_clipboard', 'set_clipboard', 'clear_clipboard'];