# Quickstart: from search to cart with curl

Find a power bank under AED 150, check delivery to Abu Dhabi, and get a cart link. Needs only `curl` (and `jq` to read the answers). No key.

## 1. See the tools

```bash
curl -s https://begad.ae/api/agent/mcp \
  -H 'Content-Type: application/json' \
  -d '{"jsonrpc":"2.0","id":1,"method":"tools/list"}' | jq '.result.tools[].name'
```

## 2. Search

```bash
curl -s https://begad.ae/api/agent/mcp -H 'Content-Type: application/json' -d '{
  "jsonrpc":"2.0","id":2,"method":"tools/call",
  "params":{"name":"search_products","arguments":{"query":"power bank","max_price":150,"limit":3}}
}' | jq '.result.structuredContent.items[] | {id, name, price: .price.amount, in_stock}'
```

Arabic works the same way: `"query":"شاحن متنقل"`.

## 3. Product details

```bash
curl -s https://begad.ae/api/agent/mcp -H 'Content-Type: application/json' -d '{
  "jsonrpc":"2.0","id":3,"method":"tools/call",
  "params":{"name":"get_product","arguments":{"product":"PRODUCT_ID"}}
}' | jq '.result.structuredContent | {name, price, options, returns, delivery}'
```

## 4. Delivery to Abu Dhabi

```bash
curl -s https://begad.ae/api/agent/mcp -H 'Content-Type: application/json' -d '{
  "jsonrpc":"2.0","id":4,"method":"tools/call",
  "params":{"name":"get_delivery_options","arguments":{"items":[{"product_id":PRODUCT_ID,"quantity":1}],"emirate":"Abu Dhabi"}}
}' | jq '.result.structuredContent'
```

## 5. Cart link

```bash
curl -s https://begad.ae/api/agent/mcp -H 'Content-Type: application/json' -d '{
  "jsonrpc":"2.0","id":5,"method":"tools/call",
  "params":{"name":"create_cart","arguments":{"items":[{"product_id":PRODUCT_ID,"quantity":2}]}}
}' | jq -r '.result.structuredContent.cart_link'
```

Give that link to the person. Opening it puts the items in their own Begad cart and continues to checkout.

## Without MCP

The same search is a plain GET:

```bash
curl -s 'https://begad.ae/api/agent/catalog?q=power%20bank&max_price=150&limit=3' | jq '.items[].name'
```

And the cart link can be built by hand: `https://begad.ae/en/cart?add_items=PRODUCT_ID:2,OTHER_ID:1&checkout=1`.
