add_trigger
Create a rule that runs an action—play, pause, seek, set a parameter, or emit an event—when a specified event fires, optionally gated by a condition.
Instructions
Add an event→action rule. When eventType fires (optionally on a layer/timeline), run one action (play/pause/seek a timeline, setParam, emitEvent…). Add an optional condition (condPath/condOp/condValue) to gate it. For click events, the layer must be tappable (set_interactive); for drag events, draggable.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"eventType": "<eventType>",
"actionType": "<actionType>"
},
"name": "add_trigger"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | No | Optional trigger id | |
| label | No | Human label for the Events panel | |
| condOp | No | Condition operator | |
| condPath | No | Condition path e.g. "params.score" | |
| condValue | No | Condition comparison value | |
| eventType | Yes | Event that fires the rule | |
| requestId | No | ||
| sessionId | No | ||
| actionLoop | No | Loop flag for playSegment | |
| actionType | Yes | Action to run | |
| eventRefId | No | Marker id (markerReached) or event name (customEvent) | |
| actionTimeMs | No | Target time (ms) for seek | |
| eventLayerId | No | Layer for click/drag/layer* events | |
| actionParamId | No | Parameter id for setParam | |
| eventSegmentId | No | Segment for segment* events | |
| actionEventName | No | Event name for emitEvent | |
| actionSegmentId | No | Segment id for playSegment | |
| eventTimelineId | No | Timeline for animation* events | |
| actionParamValue | No | Static value for setParam | |
| actionTimelineId | No | Target timeline for play/pause/stop/reverse/seek | |
| expectedRevision | No | ||
| actionParamValueFrom | No | Dynamic setParam source from the firing event |