Skip to main content
Glama
ONDC-Official

ondc-mcp

Official

Wait for the participant

flow_await
Read-only

Wait for ONDC flow events and return them the moment they occur. Target one flow or the full session, and pass after_seq to see only new events without polling.

Instructions

Block until something happens, then report it. Two scopes: Name a flow_id (or transaction_id) and it waits on that one run, returning as soon as the participant calls back — pass the seq from your last call as after_seq so nothing is seen twice. When the participant sends the flow's first action this is where you learn the transaction_id, because it was theirs to choose. Name neither and it waits on the whole session: any callback on any run, a step auto-advance sent, a refused call, a form submitted. That is the one to use when you have nothing to do — it needs no seq bookkeeping, and it comes back with runs telling you where every flow stands. Narrow what wakes it with kinds / flow_ids; anything filtered out is still reported, it just does not end the wait. timed_out: true means nothing happened yet — call again. Always prefer this over polling flow_get_status.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
kindsNoSession scope only. Wake only for these kinds. Everything else that happens is still reported in `events` — it just does not end the wait, so nothing is ever lost by filtering.
flow_idNoThe flow started with flow_start. Works before the transaction id exists, so prefer it.
flow_idsNoSession scope only. Wake only for these flows. Same rule as `kinds`: other flows' events are delivered, they just do not end the wait.
after_seqNoRun scope only. Only report events newer than this — use the `seq` from the last flow_get_status or flow_await so nothing is seen twice. Ignored in session scope, which tracks delivery for you.
session_idYesSession returned by session_create.
timeout_msNoHow long to block. Capped server-side; defaults to the cap.
transaction_idNoA specific transaction. Only known once the flow's first action has crossed the wire.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
seqYesRun scope: the run's latest event number, to pass back as after_seq. Session scope: the journal seq delivered through, which is tracked for you and needs passing nowhere.
nextNoWhat the loop needs now the wait is over. Run scope only — a session wait covers several runs, so it answers with `runs` instead.
runsNoSession scope only: where every run in this session stands, so you can pick which to drive next.
eventNo
scopeYes'run' — you named a flow or transaction, and this reports that one. 'session' — you named neither, and this reports the whole session.
eventsNoWhat has happened in this session since your last call — the participant's callbacks, steps sent automatically, refusals, form submissions. Attached to every session-scoped result and delivered exactly once, so read it here instead of polling. Absent when nothing happened. `more` above zero means call record_get_events for the rest.
timed_outYesTrue when nothing arrived. Call again to keep waiting.
transaction_idYesThe run's transaction id. When the participant sent the flow's first action, this wait is where you learn it — it was theirs to choose. Always null in session scope, which names no single run.
Behavior5/5

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

Beyond the readOnlyHint and openWorldHint annotations, the description discloses blocking semantics, timeout behavior (timed_out: true means nothing happened, call again), seq bookkeeping to avoid duplicates, and that filtered events are still delivered but do not end the wait. This significantly enriches behavioral understanding without contradicting annotations.

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?

The description is well-structured with a clear lead sentence, bolded scope separation, and no redundant content. It is dense but every sentence adds operational value, covering scopes, filtering, seq, timeout, and preference over polling. It remains focused despite its length.

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?

Given the tool's complexity (multiple scopes, filtering, seq semantics, timeout), the description covers all necessary usage aspects. It mentions key return concepts like runs and timed_out, and with the output schema available, it does not need to detail every return field. This is complete for effective use.

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

Parameters5/5

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

While the schema already has 100% parameter description coverage, the tool description adds cross-parameter semantics: after_seq is used to avoid duplicates in run scope and ignored in session scope, kinds/flow_ids filter only wake conditions but not reporting, and transaction_id is learned when the first action arrives. This goes beyond simple field definitions.

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?

The description clearly states the tool's function: 'Block until something happens, then report it.' It distinguishes two scopes (named flow/transaction vs. whole session) and contrasts with sibling flow_get_status by instructing 'Always prefer this over polling flow_get_status.' This provides a specific verb, resource, and behavior that sets it apart.

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?

The description explicitly tells when to use which scope: name a flow_id to wait on that run, name neither to wait on the whole session and 'use when you have nothing to do.' It also says to prefer this over flow_get_status, and explains filtering with kinds/flow_ids and re-calling on timed_out. This is comprehensive guidance with clear alternatives.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/ONDC-Official/automation-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server