clipboard_read
Read macOS clipboard contents as plain text to access copied data for automation tasks.
Instructions
Read the current contents of the macOS clipboard as plain text.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/tools/clipboard.ts:42-53 (handler)The handler function that executes the `clipboard_read` tool logic by calling the `clipboardRead` helper.
async function handleClipboardRead(): Promise<CallToolResult> { const text = await clipboardRead(); return { content: [ { type: "text" as const, text: JSON.stringify({ text }), }, ], }; } - src/helpers/clipboard.ts:13-18 (helper)The implementation of `clipboardRead` helper which executes `pbpaste`.
export async function clipboardRead(): Promise<string> { const { stdout } = await execFileAsync("pbpaste", [], { timeout: CLIPBOARD_TIMEOUT_MS, }); return stdout; } - src/tools/clipboard.ts:18-27 (registration)Definition of the `clipboard_read` tool.
{ name: "clipboard_read", description: "Read the current contents of the macOS clipboard as plain text.", inputSchema: zodToToolInputSchema(ClipboardReadInputSchema), annotations: { readOnlyHint: true, destructiveHint: false, }, }, - src/tools/clipboard.ts:9-9 (schema)Input schema for `clipboard_read`.
const ClipboardReadInputSchema = z.object({});