clear_clipboard
Clear clipboard contents to remove sensitive data or prepare for new content copying in Windows automation workflows.
Instructions
清空剪贴板
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Input Schema (JSON Schema)
{
"properties": {},
"type": "object"
}
Implementation Reference
- src/tools/clipboard.js:84-93 (handler)The clearClipboard method implements the core logic of the clear_clipboard tool by executing a PowerShell command to set the clipboard value to null, handling success and error cases.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-38 (schema)The schema definition for the clear_clipboard tool, including its name, description, and an empty input schema since no parameters are required.{ name: 'clear_clipboard', description: '清空剪贴板', inputSchema: { type: 'object', properties: {}, }, },
- src/tools/clipboard.js:10-40 (registration)The getToolDefinitions method registers the clear_clipboard tool (along with get_clipboard and set_clipboard) by returning an array of tool definitions for the MCP protocol.getToolDefinitions() { return [ { name: 'get_clipboard', description: '获取剪贴板内容', inputSchema: { type: 'object', properties: {}, }, }, { name: 'set_clipboard', description: '设置剪贴板内容', inputSchema: { type: 'object', properties: { text: { type: 'string', description: '要设置的文本内容' }, }, required: ['text'], }, }, { name: 'clear_clipboard', description: '清空剪贴板', inputSchema: { type: 'object', properties: {}, }, }, ]; }