kapruka_render_options_card
Render 1-4 products as ONE shareable JPEG "menu" card and return its URL.
The card shows each product's photo with a big numbered badge (the ref you
assign), and its name + price printed under the photo. Built for chat
commerce (WhatsApp): send the image, tell the customer "reply 1, 2 or 3",
and they pick without opening links. No AI is involved — the image is
server-composited from the live catalog data, so prices match what the
product tools return.
Ref numbering contract: refs are yours to assign — use sequential numbers
per conversation and NEVER reuse one (if the first card was 1-3, the next
card starts at 4). A number must keep meaning the same product for the whole
conversation.
Args:
params (RenderOptionsCardInput):
- items (list[CardProduct]): 1-4 of {product_id, ref}
- currency (str): LKR (default), USD, GBP, AUD, EUR
- courtesy ({currency, per_usd}, optional): home-currency figure printed
under each USD price ("≈ JPY 2,544"); the caller's rate, echoed back
- footer_note (str, optional): appended to the footer reply hint
Returns:
str: JSON:
{
"card_url": str, # public JPEG URL — send this as the image
"items": [{"ref": int, "product_id": str, "name": str,
"price": {"amount": float, "currency": str},
"price_note": str | null, "url": str}],
"courtesy": {"currency": str, "per_usd": float} | null, # what was printed, or null
"unavailable": [str] # product_ids that failed to load (omitted from card)
}
Error: "Error: <message>" when no product could be loaded.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"params": "<params>"
},
"name": "kapruka_render_options_card"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| params | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |