GetCallStateTool

class GetCallStateTool(context: Context) : McpTool

Returns the device call state from android.telephony.TelephonyManager. The deprecated callState getter needs READ_PHONE_STATE: without it, apps targeting API < 31 silently get CALL_STATE_IDLE (so this tool may falsely report "idle"), while apps targeting API 31+ get a SecurityException instead — caught here and surfaced as a clear error rather than a generic failure. Output: state ("idle" | "ringing" | "active" | "unknown").

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