Poll durable events
cooper_poll_eventsUse this when a scheduled agent needs Cooper events without a public webhook URL and without storing a cursor. Requires auth and message_read (a full-access key or OAuth token can call it). Creates a durable event consumer for client_id on first use. start defaults to now, so only events after this call are pending. Pass start oldest or an ISO-8601 timestamp on the first call to begin earlier. The same client_id later returns the existing consumer and does not move its cursor. A different types list or inbox returns HTTP 409 consumer_conflict. Inputs: client_id (required, 1–64 characters: letters, digits, and . _ : -), types (optional array or comma-separated event types), inbox (optional inbox id, username, or email), start (optional now, oldest, or ISO-8601; used only when the consumer is created), limit (optional, default 50, maximum 100), wait (optional, 0–25 seconds), commit (optional evc1 cursor). When commit is set, that cursor is committed before the poll. An older cursor does not move the position backwards. Returns {object:"list", data:[{id, type, inbox_id, created_at, data}], commit_cursor, has_more, events_may_have_expired, consumer}. data matches GET /api/v1/events. Reading does not advance the cursor. Pass commit_cursor to the next commit after you process the page. events_may_have_expired is true when the committed cursor is older than the events this consumer was guaranteed to keep. For an active consumer that floor is the later of 90 days ago and 7 days before the consumer was created. A consumer with no create, poll, or commit for 90 days only guarantees 7 days, does not pin events, and is not deleted. Nothing is kept longer than 90 days. An account with no consumers still keeps 7 days. An account can store at most 50 consumers (HTTP 409 consumer_limit, a technical limit, not a plan limit). Fails with 400 invalid_client_id, 400 invalid_event_type, 400 invalid_start, 400 invalid_cursor, 400 invalid_limit, 400 invalid_wait, or 404 inbox_not_found.
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": {
"client_id": "<client_id>"
},
"name": "cooper_poll_events"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| wait | No | Seconds to wait for an event. Default 0. Maximum 25. Same cap as GET /api/v1/events. | |
| inbox | No | Optional inbox id, username, or email. An inbox-scoped key is pinned to its own inbox. | |
| limit | No | Page size. Default 50. Maximum 100. | |
| start | No | Where a new consumer starts: "now" (default), "oldest" (7 days ago, the window every account still has), or an ISO-8601 timestamp. Ignored when the consumer already exists. oldest does not jump to rows another consumer kept past 7 days. | |
| types | No | Optional comma-separated event types. An array of strings is also accepted. Omit it to receive every type. A later call with a different list is HTTP 409 consumer_conflict. | |
| commit | No | Optional evc1 cursor to commit before this poll. An older cursor does not move backwards. | |
| client_id | Yes | Durable name for this consumer, 1–64 characters: letters, digits, and . _ : -. The same value resumes the cursor. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| data | No | Events [{id, type, inbox_id, created_at, data}]. | |
| object | No | Object type name, such as list, message, or thread. | |
| consumer | No | The event consumer. | |
| has_more | No | True when more items are waiting after this page. | |
| commit_cursor | No | Pass it to cooper_commit_events after processing these events. | |
| events_may_have_expired | No | True when the committed cursor is older than the events this consumer was guaranteed to keep (90 days for an active consumer, not before 7 days before it was created; 7 days when the consumer is stale). |