SetWallpaperTool

class SetWallpaperTool(context: Context) : McpTool

Sets the wallpaper from a local image file via WallpaperManager.setBitmap, targeting the home screen, lock screen, or both.

Requires the SET_WALLPAPER permission (normal, granted at install). The path is sandboxed to the external-storage root (canonical-path check); paths outside it are rejected. Also rejected if device policy disallows setting wallpaper (WallpaperManager.isSetWallpaperAllowed) or the image cannot be decoded.

Output keys: success, path, target, width, height.

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