Query events
Read a filtered page of local or Cloud events.
op_sys_command_query_eventsOn this page
Use this capability
op-sys --output json tools call op_sys_command_query_events \ --arguments '{}'Request template: replace placeholder identities and supply complete contract-specific objects before use. Required arguments are shown; optional arguments are listed below. MCP requests assume an initialized connection.
Named CLI command: op-sys query events. Use --help for command-specific flag syntax; the CLI/SDK/MCP examples share arguments; HTTP uses the documented route and body.
Parameters
Arguments are a JSON object. The published schema does not permit unknown top-level fields. Some retained CLI JSON flags are strings containing JSON; follow the declared type.
actorstringOptionalCooperative local actor. This does not change the authenticated hosted principal.
cursorstringOptionalOpaque page cursor for the selected local or Cloud scope; reuse the same filters.
entitystringOptionalentity_typestringOptionalevent_idstringOptionalevent_typestringOptionalledger_idstringOptionalStable ledger identity, local or hosted. A display name is not interchangeable with this ID.
limitintegerOptionalSchema default:
200namespacestringOptionalCloud aggregation namespace filter.
orderstringOptionalLocal sequence order (events: asc; tail/context: desc).
Allowed: "asc", "desc"
payloadstringOptionalCloud payload mode; metadata is compact and agent-context friendly.
Schema default:
"metadata"Allowed: "metadata", "full"
scopestringOptionalSchema default:
"local"Allowed: "local", "cloud", "all"
sinceintegerOptionalSchema default:
0since_atstringOptionalInclusive timestamp lower bound, for example 2026-05-21T10:00:00Z.
source_idstringOptionalworkflowstringOptionalworkflow_versionstringOptionalLocal workflow version filter.
Complete input JSON Schema
{ "additionalProperties": false, "properties": { "actor": { "type": "string" }, "cursor": { "description": "Opaque page cursor for the selected local or Cloud scope; reuse the same filters.", "type": "string" }, "entity": { "type": "string" }, "entity_type": { "type": "string" }, "event_id": { "type": "string" }, "event_type": { "type": "string" }, "ledger_id": { "type": "string" }, "limit": { "default": 200, "type": "integer" }, "namespace": { "description": "Cloud aggregation namespace filter.", "type": "string" }, "order": { "description": "Local sequence order (events: asc; tail/context: desc).", "enum": [ "asc", "desc" ], "type": "string" }, "payload": { "default": "metadata", "description": "Cloud payload mode; metadata is compact and agent-context friendly.", "enum": [ "metadata", "full" ], "type": "string" }, "scope": { "default": "local", "enum": [ "local", "cloud", "all" ], "type": "string" }, "since": { "default": 0, "type": "integer" }, "since_at": { "description": "Inclusive timestamp lower bound, for example 2026-05-21T10:00:00Z.", "type": "string" }, "source_id": { "type": "string" }, "workflow": { "type": "string" }, "workflow_version": { "description": "Local workflow version filter.", "type": "string" } }, "required": [], "type": "object"}Behavior & authority
Local event queries use the selected private state root. Cloud queries use tenant credentials, scopes and payload policy. This event surface is distinct from generic record collections.
Rules shared by event queries & context operations
- Context search ranks retained event text; it does not automatically reason over your organization.
- Local and Cloud continuation formats are independent. Keep filters, scope and effective limit stable; never reuse a cursor across scopes.
- Metadata is the default for Cloud payload selection. Full payloads require the relevant raw-content permission.
Response
Returns the command’s structured payload. The runtime output manual documents the payload families; no standalone response JSON Schema is published for this operation.
CLI tools/call result: payload.tool.result. Response envelopes across CLI, SDK and MCP ↗
The runtime does not publish a standalone response JSON Schema for this operation. Use the response description and linked output manual; the downloadable input schema is not a response contract.
Errors & retries
This operation uses the shared runtime error contract; no exhaustive operation-specific reason list is published.
For an uncertain write, preserve the original request and retry identity. On conflict, inspect current state before deciding what to change.