Package-level declarations

Types

Link copied to clipboard
class GetSettingsTool(context: Context) : McpTool

Reads a snapshot of common device settings. Uses only install-time permissions declared by the module manifest (ACCESS_WIFI_STATE, and legacy BLUETOOTH on API <= 30); if either read fails (e.g. a host manifest merge removed the permission) the corresponding flag reports false.

Link copied to clipboard

Sets screen brightness (0-255, clamped). Requires WRITE_SETTINGS; when not granted it launches the system grant screen (only if the host is foreground or holds SYSTEM_ALERT_WINDOW, since Android 10+ blocks background activity starts) and returns an error instead of writing.

Link copied to clipboard

Provider for device settings tools.

Link copied to clipboard
class SetVolumeTool(context: Context) : McpTool

Sets the volume of an audio stream (media, ring, alarm, or notification; default media), clamping the level to the stream's max. The underlying AudioManager call needs no permission, so SettingsTools always registers this tool. (Changing the ring/notification stream while Do Not Disturb is active may throw SecurityException, reported as an error.)

Link copied to clipboard
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 — which requires the host app to be in the foreground or hold SYSTEM_ALERT_WINDOW (background activity starts are blocked); otherwise it returns an error.