Watch Events (long-poll fact writes)
watch_eventsLong-poll this account's fact-write events instead of re-scanning with since_epoch. Every store/supersede/delete/archive/restore/move publishes one event {key, id, namespace, layer, op, ts, seq}. One call waits up to max_wait_s (max 25) for the first matching event and returns up to 50, plus next_since. MCP has no streaming here, so loop: pass next_since back as since on the next call and nothing is missed (the server keeps the last ~10000 events per account). Omit since to start from now; since=0 replays what is retained; a bare integer N returns events with seq > N.
EXAMPLES
Wait for hands to post results: watch_events(prefix='task:pr27-review:result:', max_wait_s=25)
Resume: watch_events(prefix='comms::', since='<next_since>')
Inside a workspace only events for keys the grant can read are returned. Long-lived clients can use GET /api/v1/events (SSE) instead.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| since | No | Resume cursor: the next_since of the previous call (a stream id '<ms>-<n>'), '0' for everything retained, or a seq integer. Omit to start from now. | |
| prefix | No | Only events whose key starts with this prefix. | |
| namespace | No | Only events in this namespace (exact). | |
| max_wait_s | No | Seconds to wait for the first event (0-25, default 20). |