Skip to main content
Glama

stream_event_subscription

Read-only

Read the next events on a saved subscription — a bounded read of GET /event-subscription/{subscription_id} that resumes from the position saved when the previous read closed, so repeated calls see every matching event exactly once with no gap and no replay.

For a live-streaming ask, the default is a dashboard (in Claude, an Artifact) that
loops stream_events with its cursor — see stream_events; a page should prefer that
ad-hoc stream, since a subscription read can stall.

Returns {"events": [...], "cursor": "<last id seen>", "closed": null | reason,
"elapsed_seconds": n} — same shape and event objects as stream_events. A call returns after `max_events`
matched events or `max_wait_seconds` (cap 55 s); call again to keep listening. The
API saves the cursor when this read closes the connection, so the next call resumes
correctly WITHOUT passing `cursor`. Pass `cursor` only to override the saved
position for one connection (e.g. re-read from an earlier frame id); it is not
persisted.

An empty `events` list means nothing matched in the window, not that the
subscription is broken. `closed` = "subscription deleted" means it was removed
mid-stream — do not reconnect. 404 `unknown subscription_id` covers both a missing
id and another user's id (indistinguishable by design).

Acting on what arrives: an `event` item is the full realtime event (use it
directly); to hand over research, get_latest_report([symbol]) first (it returns in
seconds; batch up to 50 symbols per call), and only if it comes back stale/missing
with no report on the way a generate_report_for_stock(ticker) note. A `report_plan`
item means the symbol's new report was just published: get_latest_report([symbol])
returns it.

Requires auth (your MCP client attaches the OAuth bearer automatically).

Input Schema

NameRequiredDescriptionDefault
cursorNoOverride the saved position for this one connection (not persisted). Omit to resume where the last read stopped.
max_eventsNoReturn after this many matched events (clamped to 1-200).
subscription_idYesThe `subscription_id` returned by register_event_subscription.
max_wait_secondsNoReturn after this many seconds even if fewer events arrived (clamped to 1-55).

Output Schema

NameRequiredDescriptionDefault
closedNoSet when the server ended the stream (e.g. "subscription deleted"); do not reconnect.
cursorNoLast stream id seen (advances on heartbeats too). Pass it back on the next call; null only when no frame carried an id and none was passed in.
eventsYesMatched events in publish order; empty on a quiet tape. A frame whose data was not JSON comes through as {"raw": <text>}.
elapsed_secondsYesWall time this read held the stream open.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.8/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations only declare readOnlyHint=true and the description is fully consistent while adding much more: cursor is persisted on read close but the explicit cursor param is not persisted, the read is bounded by max_events/max_wait_seconds (55s cap), stalls are possible, empty events is not an error, and 404 conflates missing and other-user ids by design. Auth requirements are also stated.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Front-loaded with purpose, then alternatives, then return shape and failure modes, then workflow follow-ups — a logical progression with no filler sentences. It is long (~330 words) and restates the return shape that the output schema already provides, which keeps it from a 5.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a bounded, resumable, long-poll read with auth, an output schema, and several distinct failure modes, the description covers everything an agent needs: return window, cursor persistence, empty-result interpretation, terminal close reasons, and 404 semantics.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so baseline is 3; the description goes further by explaining the retry loop ("call again to keep listening") and that cursor should normally be omitted, only overridden for a one-off re-read. It largely echoes the schema's own cursor/stdout wording, so it is not transformative, but the loop semantics are genuinely additive.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb and resource ("Read the next events on a saved subscription") plus the underlying endpoint and the resumable semantics. It explicitly contrasts itself with the sibling stream_events, so an agent can choose between them without opening a schema.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Gives an explicit routing rule: for live-streaming asks, prefer an ad-hoc stream_events dashboard; use this subscription read for the saved-position case, and note the stall risk. It also prescribes follow-up behavior (call again to keep listening; call get_latest_report before generate_report_for_stock; do not reconnect on "subscription deleted"), which is exactly the when/when-not/alternatives coverage this dimension rewards.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources