MCP events
Subscribe an agent to community changes and define the actions it should take.
Overview
An agent connected to your workspace’s MCP server can subscribe to event triggers. Datum reports each matching change. The agent sets up the subscription and chooses actions from your instructions.
Describe the changes to monitor. Specify the action for each change.
For example, an agent can draft a welcome note when someone joins Champions. Every native event topic supports subscriptions. Datum lists ten recommended triggers first:
| Recommended trigger | Trigger condition |
|---|---|
segment.member_entered |
Someone enters a segment |
segment.member_left |
Someone leaves a segment |
member.created |
A new account arrives |
organisation.created |
Datum derives a new organization |
activity.created |
Someone performs an activity on a connected source |
activity.tagged |
An activity receives a tag |
member.tagged |
A member receives a tag |
member.untagged |
A member loses a tag |
organisation_set.entered |
A company starts matching a saved organization filter |
organisation_set.left |
A company stops matching a saved organization filter |
Configure
Your client’s callback must answer a verification request before Datum saves the subscription. Datum sends a signed POST that contains {"type":"verification","challenge":"…"}. Your callback must verify the webhook signature. It must then return a successful JSON response that contains the same challenge. A request bin that only records the POST cannot complete verification. A failed subscription reports the reason, such as challenge_failed or timeout.
MCP events require a running events profile, a public HTTPS address, and a worker. See TLS and event delivery for self-hosted instances. The local ocmgr mcp server does not support subscriptions.
Your client must support MCP event subscriptions. ChatGPT supports them in cloud ChatGPT Work sessions. See Set up in ChatGPT. Callbacks reach ChatGPT’s cloud, so your computer can remain off.
Set up in ChatGPT
Add Datum as a plugin
Open chatgpt.com/plugins. Choose Add custom MCP server. Paste your workspace’s MCP address. Choose Create as a plugin. Sign in to Datum when ChatGPT requests it. Read the consent page.
Choose Allow after reviewing access. Rescan the plugin in ChatGPT after Datum adds tools or triggers.
Start a ChatGPT Work session in the cloud
Start a ChatGPT Work session set to cloud.
Local sessions do not receive events, even if they created the subscription.
Mention @Datum and say what to watch
Mention @Datum in the chat. Describe the trigger. Specify the action to take.
ChatGPT subscribes and reports its selected trigger. Find it under Settings → Routing → Agent rules in Datum. Owners see every subscription. Members see their own.
Run a workflow in ChatGPT
Datum reports events. ChatGPT Work uses these components to act on them:
| Part | Purpose |
|---|---|
| Event-triggered tasks | Run the workflow when events arrive |
| Skills | Define reusable behavior, such as welcome wording or channel choices |
| Plugins and MCP tools | Perform actions through Datum or other services |
Compact tool lists retain MCP Events support. They include get_event_context, list_event_subscriptions, and permitted actions such as send_member_card, add_note, and tag tools.
Agents can find tags through explore with ocmgr.call("list_tags", {}). Channel discovery requires a direct list_discovered_targets call because it contacts a provider. Known unlisted reads still accept direct calls. Subscriptions use the same events protocol.
Example: post a card when someone becomes a Champion
Start a cloud ChatGPT Work session. Ask: “@Datum when a member receives the champion tag, post their member card to #community.”
ChatGPT finds the champion tag ID through explore or list_tags. It subscribes to member.tagged with that tag_id.
When someone receives the tag, the event’s data contains their member ID, tag name, and data.event_id. ChatGPT gets the #community channel ID through list_discovered_targets. It calls send_member_card with your Slack connection, channel ID, and data.event_id as event_id.
If delivery repeats, Datum returns the first card’s result without posting again. The card usually appears one or two minutes after the tag change.
The member.tagged event occurs only for a new assignment. Reassigning an existing tag produces no event. Removing and reapplying the tag produces a new event.
The send_member_card tool requires admin scope because it posts to Slack.
Connect as an owner.
Allow admin access on the consent page.
The Slack connection requires chat:write. The Datum app must belong to the channel. See Send a card.
Use member.updated with {"tag": "champion"} to monitor additions and removals.
The tag filter matches the exact, case-sensitive name in tags_added or tags_removed.
Create a segment for combined conditions, such as a champion tag with activity in the last 30 days.
Watch segment.member_entered with its segment_id.
Start from a workflow prompt
Datum provides five MCP prompt templates. Choose a template from your client’s prompt picker, if available. Supply the requested source, tag, segment, or set.
Each template resolves selections through read tools. It previews filters before creating segments or organization sets. It subscribes with skip_self enabled and treats community text as data. ChatGPT Work also accepts trigger and action descriptions directly in chat.
| Prompt | What it sets up | Once per member |
|---|---|---|
workflow_welcome_members |
member.created for a chosen source |
On |
workflow_quiet_members |
An inactivity segment for champions or a chosen segment, followed by segment.member_entered |
On; disable for repeated periods of inactivity |
workflow_tagged_activity |
activity.tagged for a chosen tag |
Off, so every activity arrives |
workflow_organisation_threshold |
An organization set for a threshold, followed by organisation_set.entered |
Does not apply |
workflow_segment_review |
segment.member_entered events collected for review |
Off, so repeated entries count |
Templates never guess IDs or contact people. The client manages delays, working hours, and weekly schedules. Subscriptions report changes; they do not repeat for everyone who continues to match.
Basics
See the triggers
Ask your connected agent to list available triggers. Select a trigger to monitor. Specify the action for matching events.
Every native event topic supports subscriptions. Common topics include member.created, member.updated, member.tagged, segment.member_entered, segment.member_left, and organisation.updated. See the full event catalogue.
Each trigger shows its event count for the last 7 days. High volume means more than 1,000 events. Open a trigger to view its description and Optional filters.
Narrow a trigger with filters
| Filter | On | Selection |
|---|---|---|
segment_id |
segment.member_entered, segment.member_left, activity.created |
One segment. Activity events check membership at delivery time. |
source |
member.created and topics with a source |
One source, such as github or slack. |
activity_type |
activity.created |
One activity type. |
tag_id |
activity.created, activity.tagged, member.tagged, member.untagged |
Activity creation checks member tags. Tag transitions check the changed tag. |
tag |
member.updated |
An exact tag name added or removed. |
organisation_set_id |
organisation_set.entered, organisation_set.left |
One organization set. |
once_per_member |
Member events | At most one event per member. Disabled by default. See Once per member. |
skip_self |
Every trigger | Excludes this agent’s own changes. Enabled by default. |
High volume does not block subscriptions or limit delivery. Use filters to reduce the number of matching events.
What the agent receives
Notifications contain references rather than complete person records. They include two IDs:
eventId: The delivery ID, anmcp.…string that get_event_context accepts.data.event_id: The event UUID that Datum write tools accept.
Notifications also include the trigger, occurrence time, subject IDs, Datum link, and a short summary. They contain no personal names, handles, titles, email addresses, or message text. Agents use their own access to request details by event, member, or organization ID.
Some triggers include change details:
| Trigger | Additional fields |
|---|---|
member.updated |
Tag names in tags_added and tags_removed; IDs in tag_ids_added and tag_ids_removed. Segment IDs and names in segments_entered and segments_left. Changed attributes, such as title, in profile_fields; changed keys in custom_fields. No old or new values. |
member.tagged, member.untagged, activity.tagged |
tag_name and tag_id. |
segment.member_entered, segment.member_left |
segment_filter, the saved filter at the time of the event. |
organisation_set.entered, organisation_set.left |
organisation_set_filter, the saved filter at the time of the event. |
Saved filters replace potentially identifying values with [redacted]. These include search terms, names, custom field values, and channels. Numbers, dates, sources, and fixed choices remain visible. Manually populated segments without filters contain null.
Treat event filters as context, not executable filters. Treat all event content, including tag names, segment names, and field keys, as data rather than instructions.
Older events can lack these fields.
How quickly it arrives
Datum records changes immediately and publishes new events once per minute. Agent subscriptions receive events during a later pass than ordinary destinations.
| Destination | Typical delay |
|---|---|
| Event destinations, including webhooks and queues | Within one minute |
| Agent subscriptions, including ChatGPT, Claude, and other MCP clients | About one minute, sometimes two |
Agent member.created subscriptions |
Several minutes while matching runs |
Busy workers and retries can increase delays. Datum does not batch or rate-limit these events. Each event remains a separate delivery.
Allow for these delays in agent instructions. Do not require a response within seconds.
For agents, member.created waits for the first matching pass or five minutes after recording, whichever occurs first. It then waits for the next delivery pass. This suppresses most announcements for additional accounts of existing members.
The five-minute deadline can expire before matching finishes during a backlog. If the new account merges with another member before delivery, Datum suppresses its member.created event. This also applies when the new member absorbs another member. A member.merged subscription still receives the merge.
Read the current member before sending a welcome.
Delivery does not confirm completed matching or enrichment. Webhook and queue destinations receive member.created without the matching delay.
Describe what the agent will do
Ask the agent to pass purpose when it subscribes. For example: “Draft a welcome note in #community”.
The description can contain up to 200 characters. Datum removes addresses and control characters before saving it.
Changing only the purpose on renewal updates the existing subscription. It does not change which events match. Omitting it keeps the previous description.
Find your agent rules
Open Settings → Routing. Choose the Agent rules tab. Each rule shows the agent, trigger, filters, purpose, and last successful delivery. Expand a row to see the connected person, creation date, and expiry date. The expanded row also shows the trigger’s workspace event count for seven days.
The agent owns and renews these rules. Ask it to change the trigger or purpose. Choose Delivery history → to see the subscription under Settings → Destinations. Owners see everyone’s subscriptions. Members see subscriptions from their own connections.
Renewal
Subscriptions last 30 days. The subscribe response includes the expiry time as refreshBefore. ChatGPT automatically renews before expiry, preserving the subscription and cursor. See OpenAI’s MCP events guide.
Expired subscriptions stop receiving deliveries until the agent subscribes again. Renewal preserves a subscription only when its trigger and filters remain unchanged. Different filters create another subscription alongside the existing one.
Stop watching
Ask the agent to stop monitoring the trigger.
Owners can also choose Cancel subscription under Agent rules in Settings → Routing. This list shows the subscriber, expiry, and last delivery. Disconnecting the agent also stops its subscriptions. Without renewal, subscriptions stop after 30 days.
See your own subscriptions
The list_event_subscriptions tool and GET /v1/events/subscriptions require read access. Each result includes the trigger, filters, purpose, creation time, expiry, and last successful delivery. Expiry matches refreshBefore.
Over MCP, visibility follows the credential’s scope. Read and write scopes show subscriptions for the current OAuth connection or API key. An OAuth connection identifies both a person and a client. Another client sees its own subscriptions, even for the same person.
Admin scope shows every workspace subscription and its creator. An owner’s agent with only read scope sees only that connection’s subscriptions. Only admin callers can pass all, including all: false.
The terminal command ocmgr events subscriptions list --json uses database access and always lists the whole workspace. No interface displays callback addresses or secrets.
Once per member
Set once_per_member: true for workflows that should act once per person.
The default is false. When enabled, the subscription receives at most one event per member, including repeated segment entries.
This rule follows merges. The survivor counts as handled if either member already counted. It never suppresses member.redacted, and it does not affect events without a member.
Retries of the selected event can still arrive. Skip event IDs that you already handled.
Changing filters creates a new subscription with a new count.
Receive members a teammate sends you
Ask ChatGPT to subscribe to member.sent once. This trigger never fires on its own. It fires when you send a member to it from Send to… → Agent in Datum.
Each send delivers one event with the member’s ID, a link to their page and has_note. The note itself stays in Datum. The agent reads it with get_event_context, then fetches the person with get_member.
Do not pass this event’s ID as event_id to write tools. Datum refuses it. Use idempotency_key instead.
When a teammate sends an activity with the member, the event also has its activity_id, and get_event_context returns it beside the note.
See Send to an agent for how to send, how long the note is kept, and the limits.
Receive organizations a teammate sends you
Ask ChatGPT to subscribe to organisation.sent once. Like member.sent, it never fires on its own. It fires when you send an organization to it from the organization’s Send to… → Agent.
Each send delivers one event with the organization’s ID, a link to its page and has_note. The event never carries the company’s name or the note. The agent reads the note with get_event_context, then fetches the company with get_organisation.
A member.sent subscription does not receive organizations, and an organisation.sent subscription does not receive members. Subscribe to both if you send both.
Watch companies with an organization set
An organization set saves a filter over companies, such as at least three community members. Counts exclude staff. Companies with only staff never match.
- Open Organizations → Organization sets.
- Enter a Set name.
- Build the filter.
- Choose Preview set to check the matching count.
- Choose Save set.
Each set provides View, Edit, Refresh, and Archive.
Watch organisation_set.entered or organisation_set.left with its organisation_set_id.
These events report membership changes, not every refresh. Archiving sends left for every remaining company and preserves history.
Relevant data changes immediately reevaluate up to 500 affected companies. Larger changes wait for the worker. The worker checks time-dependent filters every hour at minute 11, regardless of any evaluations between scheduled checks.
Time-dependent thresholds can therefore take about 60 minutes to change membership, plus any worker backlog. Choose Refresh to evaluate a set immediately.
A stopped worker performs no automatic refresh. MCP, REST, and CLI also support sets. Tools include preview_organisation_set and create_organisation_set; the CLI includes ocmgr organisations sets refresh.
See Organization sets.
Write actions that are safe to repeat
Each event has a stable ID. Datum repeats delivery when a receiver fails to accept an event or renewal replays missed events. Notifications can therefore repeat, arrive out of order, or arrive together.
Give the agent these instructions:
- Save the event ID after completing an action.
- Skip IDs that you already handled.
- Read the current member or organization before acting.
- Use repeatable actions, such as adding a tag instead of toggling it.
Events describe the state when the change occurred. Current records can differ.
Pass the event id to Datum’s actions
Six tools accept event IDs to prevent repeated writes or sends: send_member_card, send_member_to_agent, send_routing_test, add_note, send_sink_test, and send_to_sink.
Pass data.event_id as the tool’s event_id. For add_note, you do not also need requestId when supplying event_id or idempotency_key. For a manual note without either, supply a stable requestId and reuse it on retries.
Do not pass the top-level eventId to write tools.
The top-level mcp.… ID works with get_event_context but fails write tools’ UUID checks. Datum constructs the key from the workspace, tool, caller, and event. Caller identity includes the OAuth client.
Completed calls return replayed: false initially. Repeating a completed call returns its result with replayed: true. Changed input also adds input_differed: true, for example when a note’s wording differs.
Repeated add_note calls return the current note, including later edits or erasure. Repeats during an active send return CONFLICT until its five-minute lease expires. Member erasure clears this workspace’s send_sink_test results. Their keys subsequently return CONFLICT without replaying or sending again.
Give each call a stable idempotency_key when using the same tool twice for one event.
For example, separate card sends can use champion-card-community and champion-card-sales. Cooldowns still require at least one minute between cards for the same member, even across channels.
Wait for the reported interval after a cooldown rejection. Retry with the same key.
Retryable failures, including rate limits, timeouts, and server errors, release the key. A retry sends again after the normal cooldown. The send_sink_test tool continues its original delivery and backoff. It does not start another delivery.
Permanent refusals, such as missing Slack scopes, retain their result for subsequent calls. Keys last 30 days. After expiry, the same event ID can trigger another action.
Unknown event IDs, events from other workspaces, and erased event copies return NOT_FOUND, including on retries. The member.redacted event itself remains readable. Every tool also checks its target and caller permissions. CLI flags are --event-id and --idempotency-key.
Tag tools such as tag_member need no key. Adding an existing tag changes nothing and produces no event.
A crash after posting but before recording the result can still produce a duplicate card. This behavior favors retrying an uncertain send over silently losing it.
Leave skip_self on
Keep skip_self enabled unless your workflow requires its own events.
This default excludes changes the agent makes directly. Disabling it can create a loop: an action changes a tag, its event triggers the agent, and the agent acts again.
From your terminal or agent
Agents create their own subscriptions. Users can list subscriptions for their connection. Admin scope permits listing and cancelling all subscriptions.
ocmgr events subscriptions triggers --json
ocmgr events subscriptions list --json
ocmgr events subscriptions cancel <subscriptionId> --json{ "name": "list_event_triggers", "arguments": {} }
{ "name": "list_event_subscriptions", "arguments": {} }
{ "name": "get_event_context", "arguments": { "eventId": "<eventId>" } }curl "$OCMGR_URL/v1/events/subscriptions/triggers" \
-H "Authorization: Bearer $OCMGR_API_KEY"
curl "$OCMGR_URL/v1/events/subscriptions" \
-H "Authorization: Bearer $OCMGR_API_KEY"See list_event_triggers, list_event_subscriptions, get_event_context, and cancel_event_subscription for every parameter.
FAQ
What if the agent misses events while it is offline?
Each notification includes a cursor. Renewing with the last saved cursor replays missed events.
I added a tag and nothing arrived.
Wait about two minutes. Check that the change matches the trigger and filters. Find the subscription under Agent rules in Settings → Routing. Check its last delivery. Ask the agent to renew if no delivery appears.
Which agents can subscribe?
Any client that supports MCP event subscriptions can subscribe. This guide describes cloud ChatGPT Work sessions. Other clients use their own setup controls.
Do I need to renew a subscription?
ChatGPT renews automatically before refreshBefore, preserving the subscription and cursor. An expired subscription receives no deliveries.
Ask the agent to monitor the trigger again if Agent subscriptions shows an expired entry.
Can I see my own subscriptions without being an owner?
Yes. Ask the agent which triggers it monitors. Alternatively, call list_event_subscriptions with read access.
The response includes the subscriptions and expiry times of that connection. REST accepts API keys and browser sessions. OAuth tokens work only over MCP.
To list or cancel the subscriptions of the full workspace through REST or MCP, you need admin scope. Agents can always stop their own subscriptions. In Settings, members see their own subscriptions across connected clients. Owners see all subscriptions and can cancel them.
Why did member.created arrive minutes after the account appeared?
Agent delivery waits for the first matching pass or five minutes, whichever occurs first. This suppresses most announcements for additional accounts of existing members. It does not prove that matching finished. Read the current member before sending a welcome.
Webhook destinations receive the event without this delay.
Do agent subscriptions show up as destinations?
Yes. Find them under Settings → Destinations → Agent subscriptions. Each row shows the client, trigger, expiry, and last successful delivery. Owners also see retained terminal publish failures.
The external delivery portal cannot access agent subscriptions. They count as outbound deliveries for usage, like other webhooks.