ToggleWifiTool

class ToggleWifiTool(context: Context) : McpTool

Toggles WiFi on/off. Requires CHANGE_WIFI_STATE. On API 29+ apps cannot toggle WiFi directly, so this opens the system WiFi settings panel instead of changing state.

Output keys on success: success (true), opened_settings. On API 29+ also message; below 29 also enabled (the applied state).

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