zeph_clipboard
Copy text to the clipboard on one or all of your devices. Text appears in clipboard history and can be pasted immediately.
Instructions
Copy text to the user's device clipboard. The text will appear in their clipboard history and can be pasted immediately.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| text | Yes | Text to copy to clipboard | |
| targetDeviceId | No | Target device ID. Omit to use configured default or send to all devices. |
Implementation Reference
- src/tools/clipboard.ts:23-36 (handler)The tool handler function. It takes 'text' and optional 'targetDeviceId', calls client.sendPush with type 'clipboard', and returns the push ID.
async ({ text, targetDeviceId }) => { try { const result = await client.sendPush({ title: 'Clipboard', body: text, type: 'clipboard', targetDeviceId: targetDeviceId ?? config.deviceId, }); return textResult({ pushId: result.data.pushId }); } catch (err) { return formatToolError(err); } }, ); - src/tools/clipboard.ts:18-21 (schema)Input schema: 'text' (required string) and 'targetDeviceId' (optional string). Annotations: not readOnly, not destructive, openWorldHint true.
inputSchema: { text: z.string().describe('Text to copy to clipboard'), targetDeviceId: z.string().optional().describe('Target device ID. Omit to use configured default or send to all devices.'), }, - src/tools/clipboard.ts:7-37 (registration)The registerClipboardTool function that calls server.registerTool with the name 'zeph_clipboard' and its schema/handler.
export const registerClipboardTool = (server: McpServer, client: ZephApiClient, config: McpServerConfig) => { server.registerTool( 'zeph_clipboard', { description: 'Copy text to the user\'s device clipboard. The text will appear in their clipboard history and can be pasted immediately.', annotations: { readOnlyHint: false, destructiveHint: false, openWorldHint: true, }, inputSchema: { text: z.string().describe('Text to copy to clipboard'), targetDeviceId: z.string().optional().describe('Target device ID. Omit to use configured default or send to all devices.'), }, }, async ({ text, targetDeviceId }) => { try { const result = await client.sendPush({ title: 'Clipboard', body: text, type: 'clipboard', targetDeviceId: targetDeviceId ?? config.deviceId, }); return textResult({ pushId: result.data.pushId }); } catch (err) { return formatToolError(err); } }, ); }; - src/index.ts:60-61 (registration)Top-level invocation: registerClipboardTool(server, client, config) wires up the tool into the MCP server.
registerNotifyTool(server, client, config); registerClipboardTool(server, client, config); - src/api-client.ts:37-48 (helper)The sendPush method on ZephApiClient used by the clipboard handler to POST /pushes/send with the title, body, type, and targetDeviceId.
async sendPush(params: { title: string; body?: string; url?: string; type?: string; priority?: string; targetDeviceId?: string; channelId?: string; files?: { fileKey: string; fileName: string; fileSize: number; fileType: string }[]; }): Promise<PushResponse> { return this.request<PushResponse>('POST', '/pushes/send', params); }