GetProximityTool

class GetProximityTool(context: Context) : McpTool

Reads the TYPE_PROXIMITY sensor. No permissions. Many devices report only binary near/far rather than a true centimetre distance. With duration_ms (1-5000) it collects a series of samples; otherwise a single reading. See readSensor. Output: latest distance_cm, is_near (distance < 5cm), accuracy, timestamp, plus a readings list of {distance_cm,is_near,timestamp}. Returns ToolResult.error when the device has no proximity sensor.

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