Skip to main content
Glama
ONDC-Official

ondc-mcp

Official

Restart a flow

flow_restart

Restart a failed or unwanted flow attempt in the same session, preserving all recorded payloads for compliance review. Use when a run goes wrong and you need a fresh try without losing audit data.

Instructions

Abandon this run's current attempt and open a fresh one of the same flow, in the same session. Use it when a run has gone wrong and you want another go: a flow's state is derived by replaying what was exchanged, so a NACKed step or an out-of-sequence callback stays part of the history and flow_start would only resume it. Nothing recorded is destroyed — the abandoned attempt keeps its payloads and stays readable with record_get_payload, because a failed attempt is a compliance finding, not a mistake to erase. The new attempt starts unbound: transaction_id comes back null and the next action mints a fresh one. Prefer this over creating a second session; an abandoned session keeps competing for the participant's callbacks on the endpoint every session shares.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
reasonNoWhy this attempt is being abandoned. Recorded against it, and worth supplying — it is what the compliance report can say about the retry.
flow_idYesThe flow to restart. Named by flow, never by transaction: the run is what is being restarted, and it may not have a transaction id yet.
session_idYesSession returned by session_create.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
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.
attemptYesWhich try this is. 1 unless the run has been restarted; every attempt gets its own transaction_id.
flow_idYesAddress this run by (session_id, flow_id) from here on.
outcomeYesWhat the first step of the flow needs.
mock_roleYesThe role this server plays in this flow.
session_idYes
auto_advanceYes
callback_urlYesWhat the participant must call back on. Advertised as bap_uri/bpp_uri in every payload this mock sends.
transaction_idYesNull for a new run: the transaction id belongs to whoever sends the flow's first action, so it does not exist until that action crosses the wire. Drive the run with flow_id until then; every loop answer reports the id once it is known.
abandoned_transaction_idYesThe transaction the abandoned attempt was running, or null when it never sent anything. Its payloads stay readable with record_get_payload — restarting destroys no evidence.
Behavior5/5

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

Beyond annotations, the description discloses critical behavioral traits: "Nothing recorded is destroyed" (non-destructive despite a restart), the abandoned attempt remains readable, and transaction_id comes back null for the new attempt. It also explains the compliance rationale, which is valuable context not present in the 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 a well-structured paragraph that front-loads the core purpose, then explains rationale, key behaviors, and alternatives. Every sentence adds value with no fluff or redundancy, making it efficient and appropriately sized for the tool's complexity.

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?

The description covers all key aspects: when to use, what happens (including output semantics like null transaction_id), what does not happen (nothing destroyed), and why it's preferred over alternatives. It is complete for a tool with this complexity, especially given the presence of output schema and annotations.

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

Parameters3/5

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

The input schema already describes all three parameters with 100% coverage, so the baseline is 3. The description does not add significant parameter-specific semantics beyond what the schema provides, although it does mention the return behavior of transaction_id. Since the schema covers everything, a 3 is appropriate.

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 with a specific verb and resource: "Abandon this run's current attempt and open a fresh one of the same flow, in the same session." It distinguishes itself from flow_start (which resumes) and from creating a second session, making its purpose 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?

The description gives explicit when-to-use guidance: "Use it when a run has gone wrong and you want another go." It also explains why flow_start is not appropriate (it would resume) and why a second session is discouraged, providing clear alternatives and exclusions.

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