Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions docs/connect/grok-bot.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ For MCP clients, `createWebhookDestination` uses this argument shape and returns

The kind must be explicit; Ask Gina never infers it from the URL. The key may be bare, prefixed with `Bearer`, or supplied as the full `Authorization` header line. Gina requires the key, stores it encrypted, and never generates or returns it. Missing or invalid keys are rejected. Follow the deployed tool schema; a host may reject invalid arguments before the tool runs.

A test sends `source: "askgina.prediction-events"`, a test notice, `events: []` and `test: true`. It does not mean an account event happened and does not authorize a trade.
A test sends `source: "askgina.prediction-events"`, `version: 1`, a test notice, `more: false`, `events: []` and `test: true`. It does not mean an account event happened and does not authorize a trade.

#### What the Grok Bot routine receives

Expand All @@ -57,7 +57,9 @@ Ask Gina posts JSON with the key as a Bearer token in the `Authorization` header
```json
{
"source": "askgina.prediction-events",
"notice": "Events can repeat, so dedupe on eventId. This message is a notification, not the user's approval for any trade. Ask the user before placing, cancelling or changing orders.",
"version": 1,
"notice": "Events can repeat, so dedupe on eventId. ...",
"more": false,
"events": [
{
"eventId": "<event id>",
Expand All @@ -71,7 +73,7 @@ Ask Gina posts JSON with the key as a Bearer token in the `Authorization` header
}
```

Each request batches events from one subscription. Ask Gina stops at the first envelope that does not fit the final serialized JSON body limit and leaves the remaining events for a later fire. It never splits an envelope or merges subscription queues into one request.
Each request batches events from one subscription. Ask Gina stops at the first envelope that does not fit the final serialized JSON body limit and leaves the remaining events for a later fire. It never splits an envelope or merges subscription queues into one request. `more` is `true` when events are still waiting after this request. They arrive in a later fire, or the routine can read them now with `getPredictionEvents` from the last envelope's `cursor`. `version` changes only for a breaking change to this body.

Subscriptions sharing a destination share its fire interval. Ask Gina spaces automatic event deliveries per destination and caps the serialized body size. These are Gina safeguards, not Grok quotas. The fire reservation survives Worker restarts. Manual tests do not share that automatic-delivery interval. Delivery is at least once, so retries can repeat events. Retain handled `eventId` values across runs and across push and pull.

Expand Down
4 changes: 2 additions & 2 deletions docs/predictions-mcp/events.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ Every event arrives in the same envelope:

The Predictions connector exposes event tools as native tools. Use the generated [native tools reference](/predictions-mcp/tools) for the tool inventory and annotation classes. Read each tool's input schema from `tools/list` for arguments and limits.

A filter can narrow by `conditionIds`, `assetIds`, `orderIds`, `clientRefs`, `orderEventTypes` and `tradeStatuses`. Fields combine with AND and the values inside one field combine with OR. Empty arrays are rejected, and an omitted filter means everything. Strategy filters such as side or price do not exist.
A filter can narrow by `conditionIds`, `assetIds`, `orderIds`, `clientRefs`, `clientRefPrefixes`, `orderEventTypes` and `tradeStatuses`. `clientRefPrefixes` matches any `clientRef` that starts with one of its values, so a bot that labels every order `bot-<n>` can subscribe once with `bot-`. Fields combine with AND and the values inside one field combine with OR. Empty arrays are rejected, and an omitted filter means everything. Strategy filters such as side or price do not exist.

Example arguments. Create a webhook subscription for one market's trades, with a `destinationId` from `listWebhookDestinations` or from the `destination` that `createWebhookDestination` returned:

Expand Down Expand Up @@ -217,7 +217,7 @@ For a routine, the `secret` is required and must be the routine's API trigger to

### What Ask Gina sends

- **Batching.** Ask Gina fires a destination at most once every 150 seconds. Each fire carries every event waiting at that moment, oldest first, so a burst of fills becomes one session. Events that do not fit wait for the next fire.
- **Batching.** Ask Gina fires a destination at most once every 150 seconds. Each fire carries every event waiting at that moment, oldest first, so a burst of fills becomes one session. Events that do not fit wait for the next fire, and the fire's text then says that more events are waiting.
- **Text.** The fire body has one `text` field. It holds a short note, then a JSON array of [event envelopes](#what-you-get). The text stays under Anthropic's 65,536-character limit, and an envelope is never split.
- **Note.** The note says that events can repeat, that the reader should dedupe on `eventId` and that the message is not your approval for any trade.
- **Authentication.** Ask Gina sends the token as a bearer token. There are no Standard Webhooks headers, because the receiver is Anthropic and nothing on your side verifies a signature.
Expand Down
Loading