generate_qr
Create M-Pesa QR codes for a set amount and till or paybill. Enable quick payments by generating scannable codes for buy goods, paybill, or send money transactions.
Instructions
Generate a dynamic M-Pesa QR code for a specific amount and till or paybill.
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": {
"merchantName": "<merchantName>",
"refNo": "<refNo>",
"amount": "<amount>",
"trxCode": "<trxCode>",
"cpi": "<cpi>"
},
"name": "generate_qr"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| cpi | Yes | Till, paybill, or phone number the payment goes to. | |
| size | No | QR image size in pixels. | 300 |
| refNo | Yes | Your reference for the transaction. | |
| amount | Yes | Amount in KES. Whole numbers only. | |
| trxCode | Yes | BG buy goods, WA withdraw agent, PB paybill, SM send money, SB send to business. | |
| merchantName | Yes | Name shown to the customer scanning the code. |