---
name: babelii-buy
description: Buy mobile credit, data packages, data vouchers, PLN electricity tokens, game vouchers and e-wallet top-ups (DANA, GoPay, OVO, ShopeePay) in Indonesia through Babelii's MCP server. Use when the user asks to buy or top up an Indonesian digital product. Flow: search, prepare, ask for confirmation, order, pass on the payment link.
version: 1.0.0
---

# Buy at Babelii through MCP

Babelii is an Indonesian PPOB platform (prepaid top-ups and bill payments). You act as the buyer's own agent (not Babelii and not Abel). Prices and availability come only from Babelii's tools, never from your memory.

(This is the English edition of the Indonesian skill at https://babelii.diofis.net/ai/skill.md. The tool names, parameters and rules are identical.)

## Check what your session can do before you start

What your session can do depends on the tools and permissions it has. Reading the website, or finding Babelii in an MCP registry, does not connect the agent by itself.

An MCP connector with the right permissions is enough; an open sandbox is not required. An allowed HTTP POST can be an alternative. If the session can only read the web, use Abel. Do not claim you can place orders before a tool path is available.

Connection test text (read-only):

Guide: https://babelii.diofis.net/en/ai
Purchase instructions: https://babelii.diofis.net/en/ai/skill.md
Public MCP: https://babelii.diofis.net/mcp/commerce/

Check whether this session has an MCP connector that can reach Babelii, or the ability to send an HTTP POST to the public MCP address. If it does, read the purchase instructions, run initialize and tools/list, call discover_babelii if it is available, then call search_products with query="DANA" and operator="DANA". Show the tool results you actually received. This test is discovery and search only: do not check bills, prepare an order, or create an order. If you can only read web pages, explain that limitation and point me to Abel at https://babelii.diofis.net/guest/abel. If access fails, state the stage and the error message; do not guess the cause. Do not conclude that you can execute purchases just from homepage text or a successful search. Any later order still follows the buyer permission and confirmation rules in the purchase instructions.

## Connection
- **Babelii-Diofis** MCP address (no login): `https://babelii.diofis.net/mcp/commerce/` (MCP Streamable HTTP, JSON replies).
- **Babelii-Diofis Account** (orders paid automatically from the balance, no payment page): `https://babelii.diofis.net/mcp/commerce/login/`. MCP clients that support OAuth open the Babelii login page themselves; otherwise the account owner creates a token under "AI agent tokens" and sends it as the header `Authorization: Bearer <token>`.
- MCP client: add that address. No MCP client: send JSON-RPC over plain HTTP (see "Plain HTTP" below). No cookies are needed and no session has to be kept.
- Full guide: https://babelii.diofis.net/en/ai

## Tools
Tools marked **account only** appear only on the Account connection (`/mcp/commerce/login/` or an account token). On the connection without login only the other tools exist; do not call a tool that does not appear in `tools/list`.

| Tool | Purpose |
|---|---|
| `discover_babelii` | identifies Babelii and the access your connection has (guest or account); call it first if you are unsure which tools are available |
| `search_products` | search products; result rows already include the price and the markers `requires_destination`, `needs_inquiry`, `open_denom`. Pages of 10 rows (`limit` up to 20); a `more` note means there are more |
| `get_product` | details of one product (optional) |
| `search_marketplace` | browse Babelii's Marketplace: other vendors sell hotspot vouchers, food, services and goods. Read-only; hotspot vouchers in stock are ordered like ordinary products, other listings are bought through the `buy_url` on their product page. A result with `sold_out=true` means that vendor's stock is currently empty |
| `prepare_purchase` | prepares an order without creating it; for `needs_inquiry` products it runs the name/bill check itself |
| `execute_purchase` | creates the order from the result of `prepare_purchase` |
| `purchase_status` | order status |
| `inquire_purchase` | separate customer name check (rarely needed; it has a cost, do not repeat it) |
| `renew_purchase` | refreshes the price of an already prepared quote (at most three times, no new order) |
| `purchase_history` | **account only** (login required): the account's order history. Not available on the connection without login; do not try it there |
| `ask_abel` | ask Abel, the separate product adviser, if this tool is available to you |
| `search_knowledge` | **account only** (login required): official explanation of how Babelii works; not a source of prices. Without login, use the guide at https://babelii.diofis.net/en/ai or the customer service address below |

`product_ref` has the form `catalogue:<group>:<code>`. Groups: `phone-credit` (mobile credit), `data-voucher`, `data-package`, `token`, `game`, `bills`.

A result row with `available=false` and `sold_out=true` is a real product whose stock is currently empty: say "currently out of stock" (not "does not exist") and do not try to order it.

A group filter is available in `search_products`: use `catalogue="data-voucher"` for vouchers, `catalogue="data-package"` for data packages and `catalogue="phone-credit"` for mobile credit. For example an AXIS voucher without a destination number: `query="voucher AXIS", catalogue="data-voucher", operator="AXIS", requires_destination=false`. Do not rely on free-text search alone when the product group is clear; check `tools/list` before concluding that a parameter is unavailable.

Product names, operators and Rupiah prices are in Indonesian. Search with the Indonesian product vocabulary: "pulsa" for mobile credit, "paket data" or "kuota" for data, "token PLN" for electricity tokens, "voucher game" for game vouchers.

## If the session can only read the web or send GET
- An agent cannot execute purchases through MCP without POST or a connector. It can still help browse the catalogue and give links so the buyer continues on the site.
- The GET catalogue index: https://babelii.diofis.net/public-api/v1/catalogue. Follow the `api_url` from the index, use the `search` filter the catalogue supports, and give the `buy_url` from the available results. Do not assemble order links or invent product codes.
- Public catalogue prices are guest prices, not a promise of account prices. Respect caching and rate limits. The GET catalogue's coverage can differ from MCP; an empty result is not proof that Babelii as a whole lacks that product.
- If a product is not found or the buyer needs help choosing, point them to https://babelii.diofis.net/guest/abel. Opening a link or reading the catalogue does not create an order.

## Buying flow
1. `search_products` once. Say "pulsa" for mobile credit and "paket data" or "kuota" for data. Do not repeat the search or the name check.
2. Ask only for what is missing: the destination number (if `requires_destination`), the amount (if `open_denom`, minimum Rp1,000), and the buyer's name. The buyer's name is required for anonymous buyers; phone and email are optional, do not insist on them. Do not make up a name.
3. `prepare_purchase` with `product_ref`, `destination`, `buyer_name` (and `amount`). The result contains `intent_id`, `customer_name` (if there is a name check), `maximum_amount` (the maximum price) and `expires_at`.
4. Show ONE summary: product, destination, customer name, maximum price. For an e-wallet, make sure the customer name really is the recipient the buyer means. Ask "Order now?".
5. Any reply of agreement from the buyer to an unchanged summary is enough: `execute_purchase` with the same `intent_id`, `confirmed=true`, `terms_accepted=true`. If anything changed (price, name, destination), prepare again and ask for confirmation again.
6. Anonymous buyer: the result contains `order_number`, the payment link and `track_url`. Give the payment link to the buyer; the order is processed once payment is settled. An order being created does not mean the product has been delivered. With a connected account: the order is paid from the balance within the limits the account owner set, with no payment link.
7. `purchase_status` only when asked, once. Do not poll.

## Rules
- Never `execute_purchase` without the buyer's confirmation of the final summary. A suggestion or recommendation is not permission to buy.
- Repeating `execute_purchase` with the same intent is safe (it does not create a second order). If the result is uncertain (timeout), check with `purchase_status` on the same intent; do not replace it with a new intent.
- If a tool refuses (amount limit, hourly limit, missing name, expired quote), report the reason as it is. A quote is valid for about 5 minutes; prepare again when it runs out.
- Do not use the web form `/guest/orders`: it is protected by human verification (Cloudflare Turnstile) and is not meant for agents. MCP is the path for agents.
- Payment is made by a human (anonymous) or from the account owner's balance. Do not state that a balance or product has arrived before the order status says so.
- For complicated recommendations, direct the buyer to ask Abel, Babelii's adviser: https://babelii.diofis.net/guest/abel. You are not Abel.

## Customer service (after buying)
Questions after a transaction (order not received, policy, refunds, asking to speak to staff) are served at a separate address: https://babelii.diofis.net/mcp/support/ (Streamable HTTP, no login). Its tools: `search_help` (answer only from the official articles returned), `order_status` (order number = rough status; the full tracking link from the checkout page = details), `contact_support` (name required, contact optional; give the reference and access code exactly as returned, the access code is shown only once), `ticket_status` (staff replies), and `find_products` (product advice with purchase links). That address cannot cancel, refund or order, and you must not promise those outcomes. You are not Abel; Abel answers directly in the site chat and on Telegram.

## Plain HTTP (no MCP client)
Call `POST https://babelii.diofis.net/mcp/commerce/` with the headers `Content-Type: application/json` and `Accept: application/json, text/event-stream`. The order is `initialize`, `notifications/initialized`, then `tools/call`. Set a `User-Agent` that describes your application and its version, for example `buyer-agent/1.0`; there is no need to pretend to be a browser or an internal Babelii agent.

If you are refused, report the URL, the stage of the call, the HTTP status and the response message; note `CF-Ray` if available for tracing. A 403 alone does not prove that Cloudflare is blocking Python or that the User-Agent is the cause. Do not state that cause as fact without evidence from the response or logs. If the response says `retryable=false`, `owner_action_required=true`, or Cloudflare Error 1010, stop trying and report that the site owner needs to check the access rules; do not rotate the User-Agent or retry to get around the block. If a human challenge appears, direct the buyer to Abel. Changing the User-Agent gives no permission, balance or trusted identity. A new connection counts as successful only after `initialize` and a tool call have actually returned results.

```python
import json, requests

URL = "https://babelii.diofis.net/mcp/commerce/"
s = requests.Session()
s.headers.update({"Content-Type": "application/json", "Accept": "application/json, text/event-stream", "User-Agent": "buyer-agent/1.0"})
_id = 0

def rpc(method, params=None, notify=False):
    global _id
    body = {"jsonrpc": "2.0", "method": method}
    if not notify:
        _id += 1
        body["id"] = _id
    if params is not None:
        body["params"] = params
    r = s.post(URL, json=body, timeout=90)
    return None if notify else r.json().get("result", {})

def call(tool, **args):
    res = rpc("tools/call", {"name": tool, "arguments": args})
    text = "".join(c.get("text", "") for c in res.get("content", []) if c.get("type") == "text")
    if res.get("isError"):
        raise RuntimeError(text)
    return json.loads(text)

rpc("initialize", {"protocolVersion": "2025-03-26", "capabilities": {}, "clientInfo": {"name": "buyer-agent", "version": "1.0"}})
rpc("notifications/initialized", notify=True)

product = call("search_products", query="pulsa telkomsel 10000")["products"][0]
prepared = call("prepare_purchase", product_ref=product["ref"], destination="<destination number>", buyer_name="<buyer name>")
print(prepared["maximum_amount"], prepared.get("customer_name"))   # show this to the buyer and WAIT for their confirmation
# only after the buyer answers yes:
order = call("execute_purchase", intent_id=prepared["intent_id"], confirmed=True, terms_accepted=True)
print(order.get("payment_url"), order.get("track_url"))   # give the payment link to the buyer
```
