trigger
Arm a reactive DOM watcher on one selector to detect changes, thresholds, value matches, or text. Persists across service-worker eviction.
Instructions
Arm a reactive DOM trigger on one selector. Use this when the user wants to watch an element until it changes, crosses a threshold, equals or matches a value, or contains text. The watch is owned by the background trigger runtime and persisted across service-worker eviction. Pass one selector and one condition object; runtime validation checks the nested condition details before arming. Use stop_trigger to cancel, get_trigger_status to inspect one watcher, and list_triggers to enumerate watchers.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| watch | No | Optional watch mechanism. live-observe uses in-page mutation observation; refresh-poll periodically reloads the trigger-owned tab and reads the selector. | |
| locale | No | Optional locale hint for numeric parsing, such as en-US or de-DE. | |
| tab_id | No | Optional. Tab id to arm the trigger against. Alias of target_tab_id for callers that use ordinary tool tab targeting. | |
| extract | No | Optional value extraction mode. Defaults are selected by the trigger runtime from the condition. | |
| attrName | No | Optional alias for attribute when content-side trigger readers use attrName. | |
| detached | No | When true, arm and return trigger_id immediately instead of blocking. | |
| selector | Yes | CSS selector or stable element selector to watch. | |
| attribute | No | Optional attribute name when extract is attribute. | |
| condition | No | Trigger condition object validated by the trigger manager. Supported kinds include changed, threshold, delta_percent, equals, contains, regex, and compound AND/OR conditions. | |
| timeout_ms | No | Blocking wait timeout in ms. Default 120000. Timeout returns timed_out. | |
| trigger_id | No | Optional caller-supplied trigger correlation id. MCP callers may omit it; the server generates one before arming. | |
| rearm_on_fire | No | When true, keep watching after a fire and expose fire_count/last_event through status. | |
| target_tab_id | No | Optional. Explicit target tab id for the watched page. | |
| poll_interval_ms | No | Optional refresh-poll interval in milliseconds. The background runtime enforces its minimum floor. | |
| decimal_separator | No | Optional decimal separator override for numeric parsing. | |
| safety_ceiling_ms | No | Maximum blocking wait before auto-detach. Default/max 240000. |