VibratePatternTool

Plays a waveform vibration from timings — alternating OFF/ON durations in ms, starting with OFF (timings[0] is a delay before the first vibration; matches VibrationEffect.createWaveform/legacy Vibrator.vibrate(long[], int) semantics exactly). Any non-empty length is valid — there is no even/odd requirement. Every entry must be a non-negative number (non-numeric entries are rejected, not dropped); each entry is capped at MAX_TIMING_MS and the whole pattern must total at most MAX_PATTERN_MS.

Optional repeat index (-1 = no repeat, clamped to bounds). A pattern with repeat >= 0 loops until cancelled: call cancel_vibration (CancelVibrationTool) to stop it. As a safety net it is automatically cancelled after MAX_REPEAT_DURATION_MS. Requires VIBRATE.

Output keys on success: success (true), total_duration_ms (one pass of the pattern), auto_cancel_after_ms (only when repeating). Errors on invalid timings or a device with no vibrator.

Constructors

Link copied to clipboard
constructor(context: Context)

Types

Link copied to clipboard
object Companion

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 outputSchema: Map<String, Any>
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