PrintContentTool

class PrintContentTool(context: Context) : McpTool

Renders text or HTML content in an off-screen WebView and hands it to PrintManager.print, which opens the system print UI. Plain text is HTML-escaped and wrapped in a monospace <pre> block; pass is_html = true to print raw HTML as-is.

No permissions required. The print job is dispatched on the main thread once the WebView finishes loading; success indicates the dialog was launched, not that anything was printed.

Output keys: success, job_name, content_length, message.

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 parameters: List<ToolParameter>

Functions

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