Skip to main content
Glama
ONDC-Official

ondc-mcp

Official

Validate a payload

payload_validate
Read-onlyIdempotent

Validate a protocol payload against the ONDC spec for the session's build. Runs JSON Schema and contextual rule checks, returning rule codes and JSONPaths for any failures.

Instructions

Check a protocol payload against the ONDC spec for this session's build, without sending it anywhere. Runs L0 (JSON Schema) and L1 (the spec's contextual rules); every failure comes back with a rule code and a JSONPath. Use it to inspect a body before committing to it, or to understand a refusal. Note that flow_proceed already gates what it sends, so this is not a required step in the loop. A valid verdict only covers the layers listed in checked.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
actionNoAction to validate as. Defaults to the payload's own context.action, which is almost always what you want.
payloadYesThe full protocol payload, exactly as it would go on the wire.
session_idYesSession whose build (domain + version) the payload is judged against.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
actionYesThe action the payload was judged as.
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.
statusYes
checkedYesLayers that actually produced a verdict.
docs_urlNoThe published rule list for this build, when upstream named one.
findingsYesEvery failure found, across every layer that ran.
uncheckedYesLayers that did not. A `valid` status only covers what is in `checked`.
Behavior5/5

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

Beyond the annotations (readOnly, idempotent, openWorld), the description adds that it runs L0 and L1 validation, returns rule codes with JSONPath on failure, and that a valid verdict only covers layers in 'checked'. This provides meaningful behavioral context about validation scope and error output, which the annotations do not.

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 few sentences, each with a distinct purpose: what it does, what validation layers run, how to use it, its non-requirement in the flow, and the scope of the verdict. It is front-loaded with the core purpose and contains no filler or redundancy.

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, existing output schema, and sibling tools, the description is complete. It covers the validation scope, error reporting format, usage intent, and relationship to flow_proceed, enabling an agent to select and invoke it correctly without needing additional context.

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?

Schema coverage is 100%, so the baseline is 3. The description does not add new parameter-specific information beyond what the schema already states (e.g., action defaults to the payload's context.action). It does not compensate for any gaps because none exist; the schema carries the semantic load.

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 'Check a protocol payload against the ONDC spec for this session's build, without sending it anywhere,' which uses a specific verb and resource, and immediately distinguishes it from sending tools. It clearly identifies the tool's validation role and its non-side-effect nature.

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?

It explicitly states 'Use it to inspect a body before committing to it, or to understand a refusal' and notes that 'flow_proceed already gates what it sends, so this is not a required step in the loop.' This gives clear when-to-use context and names an alternative, making it easy for an agent to decide.

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