Event Source Create¶
Author an event source — validate the structured fields and write
/ .md. Builds a polling watcher that fetches state, reacts on a meaningful change, evaluates a CEL condition, and fires a scoped action (notify). Refuses to overwrite unless overwrite=true; a malformed source returns its validation errors.
MCP name: event_source_create
Category: events
Mutates state (retry policy: manual)
Parameters¶
| Name | Type | Required | Description |
|---|---|---|---|
action |
str |
No | Action to run on a firing change (only 'notify' is supported) |
action_params |
dict |
No | Parameters for the action (e.g. notify title/body overrides) |
allowed_actions |
list |
No | Actions this source is scoped to run; the action must be in this list (defaults to [action]) |
autonomy |
str |
No | notify_only (default) or auto_execute (not yet supported) |
condition |
str |
No | Optional CEL predicate over event.data / prev.data; the action fires only when it is true |
cursor_from |
str |
No | now (default; first observation is a silent baseline) or all (fire on the first observation too) |
enabled |
bool |
No | Whether the source polls immediately (default true) |
event_type |
str |
No | Override the emitted event type (defaults to ai.workbuddy.source. |
extract_mode |
str |
No | How to extract the watched value — json_path, css, or hash (whole-payload) |
extract_path |
str |
No | JSONPath (e.g. $.quote.price) or CSS selector for the watched value |
interval |
str |
Yes | Poll interval, e.g. '30s', '5m', '6h', '1d' |
max_per_hour |
int |
No | Optional rate-limit; more firings than this in an hour suspends the source |
name |
str |
Yes | Source name (1-64 chars, alphanumeric start; becomes the .md file stem) |
overwrite |
bool |
No | Replace an existing source of the same name (default false) |
semantic |
dict |
No | Optional Tier-3 semantic-LLM gate, layered on top of the CEL condition. Keys: question (required, the classify prompt), query (web-search query; defaults to question), cooldown (e.g. '1h', post-fire suppression), debounce ('N/M', e.g. '2/3'), min_confidence (0..1), max_results (int). Fires only when a local model judges the searched evidence relevant. |
source_type |
str |
Yes | Delivery backend — http_poll (GET a URL) or fake (test/no-network) |
url |
str |
No | URL to GET (required for http_poll) |
Details¶
Author an event source by building its frontmatter from structured fields,
validating it (known type, valid interval, valid JSONPath and CEL, action in
allowed_actions, valid autonomy), and writing <event_sources>/<name>.md. The
poller re-loads the directory each tick, so a new source activates on the next
poll — no restart needed.
This is the activate step behind /wb-event-new; prefer that conversational
loop (it elicits the watch, proposes a grounded draft, and dry-runs it before
calling this) over hand-filling the parameters. The action is scoped: only
actions in allowed_actions may run, and only notify exists today
(autonomy: notify_only).