Skip to content
Menu
Data

Connect an AI agent to India price data: API, CLI or MCP?

Use the REST API when an application sends the requests, the CLI for terminal work, and the MCP server, in preview, when an AI agent calls the tools itself. All three read the same India ecommerce price data through one contract, with the same key, permissions and credit rules, so the choice is about the workflow, not the data.

By , FounderPublished Last updated Part of the quick commerce data and api guideMore on data and APIs

Choose an interface: 3 choices

The three interfaces are thin layers over one API. Pick by who sends the request and who reads the answer. You can start with one and move to another later without changing your account, your key or what a read costs.

REST API

Best for: An application or a scheduled job that sends structured requests and stores the answers.

The REST API is at https://api.rewalto.com. It suits a dashboard, a nightly job or an agent framework where your own code makes each call and keeps the response. The first request guide walks through an identity read, and the quick commerce API guide says what the API returns by pin code today.

CLI

Best for: Terminal work and scripts run by a person who wants to see each request and answer.

The CLI makes the same API calls from a terminal, which helps when you want to try a read by hand before you write code or hand it to an agent. It uses the same key and permissions as the API. Its install steps are not published yet; until they are, the REST API covers the same reads.

MCP server (preview)

Best for: An AI agent in a compatible client that discovers and calls documented data tools from a conversation.

The MCP server, in preview at https://mcp.rewalto.com/mcp, lets a compatible AI client discover documented tools and call them from a conversation. Each tool is one API call with the same refusals and receipts. Every MCP tool (preview) shows what each returns, its inputs and whether it can spend credits. The quick commerce MCP server guide covers its data tools in more detail.

If you are unsure, start with the REST API. It is the interface the other two are built on, so a request that works there tells you the data, the key and the permissions are right before an agent is involved.

One contract, so the rules do not change

Whichever interface you pick, the same things hold. The data is the same: a field means the same thing in an API response, a terminal and an agent's tool answer. The key is the same, and so are its scopes: reading data and approving a quote are different permissions on every interface. An agent connection does not bypass a scope or a credit review.

Cost is the same too. Tools are free; delivered data spends credits at its published rate, and a run that delivers nothing costs nothing. A run with no published rate shows the API's quote and starts only after you approve it. See how data credits work and the credit reference.

Coverage does not change with the interface either. A connection cannot make a missing pin code or app appear. The data catalogue shows each dataset's current status and freshness. Read it before you ask an agent a question the data may not answer.

Match the interface to the job

Most teams do not need all three. Four common jobs show where each one fits, and why the answer is often the plain API even when an AI agent is involved.

A report that runs every night

A job that reads the same products at the same pin codes every night and writes them to a sheet or a database belongs on the REST API. Your code decides the inputs, keeps every response with its reading time and can be reviewed line by line. Nothing in the loop needs a conversation, so an agent adds cost and uncertainty without adding anything the job needs. If the report should run on a schedule with a spending limit, look at Monitors before you build a scheduler of your own.

A one-off question from an analyst

An analyst who wants to check one product at one pin code today needs a small read and a clear answer, not a program. The CLI suits this once its install steps are published: the request and the response sit side by side in the terminal, so it is easy to see which field answered the question. Until then, the same read works as a single API request from the first request guide.

An agent that answers questions in a chat

When a person asks an AI assistant something like "what does this pack cost at my pin code this week?" and expects the assistant to look it up, MCP is the natural fit. The client discovers the tools, picks one, sends the inputs and reads the answer back. That convenience is also the risk: the agent chooses the tool and the inputs, so review its plan before a wider or chargeable read, and ask it to keep the reading time and pin code next to every figure it reports.

An agent built in your own code

If you are building the agent yourself, with your own framework and your own tool definitions, you can call the REST API from those tools directly. You keep control of retries, logging and which fields reach the model. MCP helps most when the client is someone else's and you cannot add tools to it any other way.

Connect in 3 checks

The same three checks apply to the API, the CLI and the MCP server. Treat each one as separate: passing one does not prove the next.

  1. Reach the service: confirm your client or code can reach the documented address, https://api.rewalto.com for the API and https://mcp.rewalto.com/mcp for MCP (preview).
  2. Check identity and permissions: run a free identity or catalogue read and confirm the organisation and permissions it reports are the ones you meant to use.
  3. Inspect a small result: read one bounded answer and check its location, date and source before you widen the request or schedule it.

Keep the key out of prompts, screenshots and shared conversations. Store it in the client's supported secret setting or your server's secret store, and give it only the scopes the work needs.

Write down what each check showed, with the date. If the first check fails, the problem is the address or the network, not your key. If the second fails, look at the key, its scopes and the organisation before you touch anything else. If the third returns fewer rows than you expected, the connection is working and the question is coverage: check the catalogue for that app and pin code before you assume something broke.

Ground rules to give an agent

An agent will do what it is asked as well as it can, which includes guessing when it is not told to stop. A few plain instructions, given at the start of the task, prevent most of the answers you would later have to unpick.

  • Say which product, pin code and period you mean, and ask it to confirm them back before it reads.
  • Ask it to mark a missing reading as unknown, never as zero and never as out of stock.
  • Ask it to keep the reading time and pin code beside every price it reports.
  • Tell it to stop and ask before any read that spends credits or needs a quote.
  • Ask it to say which tool or request produced each figure, so you can repeat it.

These rules are the same whether the agent calls MCP tools or your own API wrappers. They are not a substitute for permissions: a key that cannot approve a quote is a firmer limit than a sentence in a prompt. Use both. When the agent hands back a table, read a few rows against the source before you share it, and keep the request reference with the result so the figures can be traced later.

Switching interfaces later

Because the three share one contract, moving between them is mostly a change of who sends the request. A read you tried by hand can become a line in a script, and a script can become a tool an agent calls, without new terms or a new price. What changes is who decides the inputs. In your own code you choose them; through MCP the agent does, so keep the bounds tighter at first and widen them once the answers check out.

Keep one key per workflow rather than one key for everything. If a nightly job and an agent share a key, a problem in one forces you to rotate the key for both. Separate keys also make the credit usage for each workflow easy to read on its own.

What is not published yet

Client-specific installation, OAuth sign-in, saved agent connections and connection testing are not published yet in the API, CLI and MCP reference, and neither are the CLI's install steps. This page gives no setup steps for any one client, because none are published to point to.

Until they are, the REST API returns the same data: start with the first request guide. When a client offers a connector screen or reads a configuration file, follow that client's own current instructions and check the transport and sign-in method it supports.

Common questions

Should I use the API, the CLI or MCP to connect an AI agent?

Use the REST API when an application sends the requests, the CLI for terminal work, and the MCP server, in preview, when an AI agent in a compatible client calls the tools itself. All three read the same data with the same key, permissions and credit rules.

Do the API, CLI and MCP return different data?

No. They share one data contract. Every MCP tool is one documented API call, so the fields, refusals and receipts are the same whichever interface makes the request.

Does an MCP connection cost more than the API?

No. Tools are free, and delivered data spends credits at the same published rate on every interface. A run with no published rate shows a quote first and starts only after you approve it.

Is the Rewalto MCP server ready to use?

It is in preview at mcp.rewalto.com/mcp. Its tool list is public and free to read. Client-specific installation, OAuth, saved agent connections and connection testing are not published yet; until they are, the REST API returns the same data.

What is the MCP address, and is it the same as the API address?

No. The MCP server (preview) is at https://mcp.rewalto.com/mcp and the REST API is at https://api.rewalto.com. Do not build one address by adding a path to the other.

How do I check that an agent connection works?

Run three separate checks: confirm the client can reach the documented address, run a free identity or catalogue read and confirm the organisation and permissions it reports, then read one small result and check its location, date and source.

Can an AI agent place orders through Rewalto?

No. Every interface reads dated market data. None of them logs in to a shopper's account, places orders or manages seller listings.

Start with the question you need to answer

Check the current data catalogue, then review the coverage and dates against your question. The research in an older guide does not establish that a service is available today.

Related guides

See it in real data.

Ask about a city, a product or a dataset. The answer is free, and any fresh run shows its cost first.