Skip to main content
Glama

Windows Automation MCP Server

get_clipboard

Retrieve text content from the Windows clipboard to access copied data for automation workflows and system integration tasks.

Instructions

获取剪贴板内容

Input Schema

NameRequiredDescriptionDefault

No arguments

Input Schema (JSON Schema)

{ "properties": {}, "type": "object" }

Implementation Reference

  • 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 }; } }
  • 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; }
  • 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); }

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/eva-wanxin-git/windows-automation-mcp'

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