Skip to main content
Glama

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

NameRequiredDescriptionDefault
idNoOptional trigger id
labelNoHuman label for the Events panel
condOpNoCondition operator
condPathNoCondition path e.g. "params.score"
condValueNoCondition comparison value
eventTypeYesEvent that fires the rule
requestIdNo
sessionIdNo
actionLoopNoLoop flag for playSegment
actionTypeYesAction to run
eventRefIdNoMarker id (markerReached) or event name (customEvent)
actionTimeMsNoTarget time (ms) for seek
eventLayerIdNoLayer for click/drag/layer* events
actionParamIdNoParameter id for setParam
eventSegmentIdNoSegment for segment* events
actionEventNameNoEvent name for emitEvent
actionSegmentIdNoSegment id for playSegment
eventTimelineIdNoTimeline for animation* events
actionParamValueNoStatic value for setParam
actionTimelineIdNoTarget timeline for play/pause/stop/reverse/seek
expectedRevisionNo
actionParamValueFromNoDynamic setParam source from the firing event

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.7/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already declare a non-read-only, closed-world operation, so safety scope is partly covered. The description adds trigger semantics, condition gating, and click/drag prerequisites, but it omits important mutation behavior such as duplicate-id handling, conflict behavior for expectedRevision, and what happens when prerequisites are not met.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is front-loaded with the core purpose and then adds prerequisites and condition semantics in a compact sequence. It is appropriately sized for a 22-parameter tool and has no filler.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a high-complexity mutation tool with 22 parameters and no output schema, the description covers the core event-action-condition model and prerequisites. However, it leaves important operational details unstated, especially optimistic concurrency via expectedRevision, identifier uniqueness/overwrite behavior, and what response or side effects to expect.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is high at 86%, so the schema already documents most parameters. The description adds useful relational meaning for eventType/actionType and condPath/condOp/condValue, but it does not clarify several less-documented parameters such as requestId, sessionId, or expectedRevision beyond what the schema provides.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb and resource: 'Add an event→action rule.' It clearly describes the event/action model, but it does not explicitly distinguish this tool from sibling rule/state-machine tools such as create_state_machine or add_sm_transition.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Gives clear usage context and prerequisites: click events require a tappable layer via set_interactive, and drag events require a draggable layer. It does not state when to use this instead of the state-machine or binding tools, nor does it list exclusions.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.