Skip to main content
Glama

ctxstore — memory that follows you across models

Watch Events (long-poll fact writes)

watch_events
Read-onlyIdempotent

Long-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

NameRequiredDescriptionDefault
sinceNoResume 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.
prefixNoOnly events whose key starts with this prefix.
namespaceNoOnly events in this namespace (exact).
max_wait_sNoSeconds to wait for the first event (0-25, default 20).

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.9/5.0
Behavior5/5

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

Annotations already cover safety (readOnly, idempotent, non-destructive), but the description adds substantial context beyond them: max wait of 25s, up to 50 events returned plus next_since, server retention of ~10000 events per account, and workspace read-grant filtering of keys. This is the kind of operational behavior an agent needs and can't infer from structured fields.

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

Conciseness5/5

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

Front-loaded with the core mechanic and the no-streaming loop constraint, then examples. Dense but every sentence carries information (event shape, retention, cursor semantics) and nothing is redundant filler.

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?

With no output schema, the description carries the return burden and does so: event fields, the 50-event cap, and next_since are all explained. An agent can loop correctly and avoid missed events from this description alone.

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 the baseline is 3, but the description adds real meaning: since=0 replays retained events, a bare integer N returns seq > N, and next_since is the resume cursor to feed back. It reinforces and slightly extends the schema rather than merely restating it.

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 ('Long-poll this account's fact-write events') and explicitly distinguishes itself from the re-scan pattern ('instead of re-scanning with since_epoch'). The event enumeration and returned shape make the scope unambiguous.

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 the when-to-use (instead of re-scanning), the exact loop pattern to follow because 'MCP has no streaming here', and names an alternative for long-lived clients (GET /api/v1/events SSE). Two concrete examples cover the common wait and resume cases.

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.