GlobalActionTool

class GlobalActionTool(context: Context) : McpTool

global_action — dispatch a system-wide AccessibilityService global action: back, home, recents, notifications, quick_settings, power_dialog, lock_screen, or screenshot (see the companion MAP).

The action string is lowercased before lookup. AccessibilityTools.idempotentGlobalActions lists the subset dispatchers may mark as safe to retry.

Params: required action.

On success returns success = true and the resolved action name. Errors are long-form messages: action is required, an "Unknown action" message listing the valid keys, the notConnectedError message when the service is not bound, and a "performGlobalAction returned false" message when the system rejects the action.

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