ScanBarcodeTool

class ScanBarcodeTool(context: Context) : McpTool

Decodes a 1D/product barcode from a still image file (referenced by image_uri) using ML Kit, restricted to EAN-13, UPC-A, CODE-128, CODE-39, EAN-8, and UPC-E. Reads an existing image — does NOT open the camera, so no camera permission is needed despite the module declaring CAMERA. Returns the first barcode found, or found = false when none is present.

Result keys: raw_value, format (one of the supported format names, or "UNKNOWN"), found.

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