SpeakTextTool

class SpeakTextTool(context: Context) : McpTool

Speaks text aloud through the device TextToSpeech engine, suspending until playback completes. No permissions required.

Initializes a one-shot engine, applies pitch/speed (each clamped to 0.5–2.0) and language (falls back to English if the requested BCP-47 tag is unsupported or missing data), speaks with QUEUE_FLUSH, then shuts the engine down. Cancelling the coroutine shuts down the engine.

Output map (on completion): success (true), text_length (Int), language (the requested tag, not necessarily the one actually used after fallback).

Constructors

Link copied to clipboard
constructor(context: Context)

Types

Link copied to clipboard
object Companion

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