Package-level declarations

Types

Link copied to clipboard

Reports which motion/fitness sensors the device exposes (step counter, step detector, accelerometer, gyroscope, heart rate, significant motion) and their specs. No permissions required (this only enumerates hardware; it does not read sensor values). Output: has_step_counter, has_heart_rate_sensor, note, and sensors — a list of per-sensor maps (key, available, plus name/vendor/version/max_range/resolution/power_ma when present).

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

Reads the TYPE_STEP_COUNTER sensor and returns the cumulative step total since the last reboot (not a per-day count). Registers a one-shot listener with a 3 s timeout. Requires ACTIVITY_RECOGNITION on Android 10+ (API 29+) — note execute() does NOT itself verify the permission, so a missing grant surfaces as a sensor timeout rather than a permission error. Output: steps_since_reboot, timestamp, note. Returns ToolResult.error when no step-counter sensor exists or the sensor does not report within 3 s.

Link copied to clipboard

Provider for the health/fitness tools: GetStepCountTool and GetActivityInfoTool. Only step counting is permission-gated; GetActivityInfoTool needs no permission.