ReadClipboardTool

Reads the system primary clip via ClipboardManager, coercing the first item to text. No permissions required. Output always includes has_content (whether a primary clip exists), is_text (clip MIME type starts with text/), and text (coerced string, or null when empty).

On API 29+ the OS only lets the app with input focus (or the default IME) read the clipboard; everyone else silently gets an empty clip. So when the clip reads back empty and the host app is neither foreground nor the default IME, the tool returns an error instead of a misleading has_content: false — the clipboard may well have content that simply isn't readable.

Constructors

Link copied to clipboard
constructor(context: Context)

Properties

Link copied to clipboard
open override val annotations: ToolAnnotations
Link copied to clipboard
open override val description: String
Link copied to clipboard
open override val name: String
Link copied to clipboard
open override val outputSchema: Map<String, Any>
Link copied to clipboard
open override val parameters: List<ToolParameter>

Functions

Link copied to clipboard
open suspend override fun execute(params: Map<String, Any>): ToolResult