Skip to main content
Glama
ONDC-Official

ondc-mcp

Official

Create mock session

session_create

Open a test session against an ONDC participant by supplying its URL and role (BAP/BPP); the mock acts as the counterpart and returns available flows along with a callback URL.

Instructions

Open a session against a network participant under test and list every flow available for its build. Supply the participant's subscriber URL and whether it is a BAP (buyer app) or BPP (seller app); this server automatically takes the opposite role and answers as that counterparty. Domain, version and use-case must be a published combination — call catalog_list_builds first if unsure, because an unknown use-case is rejected rather than silently returning no flows. The returned callback_url is what the participant must send its callbacks to; give it to them before starting a flow.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
domainYesONDC domain code, e.g. ONDC:FIS12.
np_typeYesWhat the participant under test is: BAP (buyer app) or BPP (seller app). The mock takes the opposite role.
usecaseYesUse-case name exactly as published, e.g. 'PERSONAL LOAN'. Case- and space-sensitive.
versionYesSpec version, e.g. 2.0.3.
auto_advanceNoDefaults to on for llm_auto sessions and off for manual ones. When on, this server sends its own next step as soon as the participant answers, instead of waiting to be asked — pausing for inputs, forms and errors. You do not see less of the flow: everything sent this way comes back as a CHAIN_SENT event on your next tool result. Set it false to drive every step yourself.
subscriber_idNoRegistry subscriber id of the participant, when known.
subscriber_urlYesBase URL of the participant under test, e.g. https://bap.example.com.
interaction_modeNo'llm_auto' (default) — you supply every input and fill forms yourself. 'manual' — a human supplies them; forms come back as links to hand over.
receiver_public_urlNoOverride the URL advertised for callbacks. Set this to your tunnel address (ngrok, cloudflared) whenever the participant is not on this machine — otherwise its callbacks go somewhere it cannot reach.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
flowsYesEvery flow published for this build, ready to start.
totalYesNumber of flows available.
sessionYes
Behavior5/5

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

The description reveals non-obvious behaviors: the server automatically takes the opposite role, an unknown use-case is rejected (not silently empty), and the callback_url must be given to the participant. These are valuable insights beyond the annotations (readOnlyHint=false, openWorldHint=true) and significantly improve the agent's understanding of side effects and failure modes.

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?

Four sentences, each serving a distinct purpose: action, role selection, published-combo requirement, and callback_url handoff. There is no fluff or repetition; the most important info is front-loaded in the first sentence.

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 (9 params, 5 required) and the existence of an output schema, the description covers the operation's purpose, a critical prerequisite (validating builds), an error condition, and an operational follow-up (giving callback_url to the participant). This is complete enough for an agent to invoke the tool correctly without consulting siblings.

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 parameters are already documented, but the description adds relational meaning: it explains that np_type determines the mock's opposite role, and that domain/version/usecase must form a published combination. This goes beyond the schema's individual field descriptions, enriching the agent's ability to choose valid parameter values.

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 opens with a specific verb and resource: 'Open a session against a network participant under test and list every flow available for its build.' This clearly states the action (create session) and the immediate outcome (list flows), and it distinguishes itself from sibling tools like flow_start or catalog_list_builds by focusing on session creation.

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

Usage Guidelines4/5

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

It provides clear contextual guidance, including the prerequisite step 'call catalog_list_builds first if unsure' and a practical note about handing the callback_url to the participant. It does not explicitly say 'use this before flow_start' or contrast with alternatives like flow_get_status, but the context is strong enough to infer when it applies.

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