Server Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
| api_key | Yes | Your Africa's Talking API key | |
| country | Yes | Your country (e.g. kenya, uganda, dr congo, rwanda, south africa) | |
| username | Yes | Your Africa's Talking username | |
| currency_code | Yes | Currency code (e.g. KES, UGX, NGN) |
Tools
Functions exposed to the LLM to take actions
| Name | Description |
|---|---|
| check_balance | Checks the airtime balance of the Africa's Talking account. This tool connects to the Africa's Talking API to fetch the user's
current application data, which includes the account balance.
Returns:
str: A message displaying the account balance or an error if the
balance cannot be retrieved. |
| load_airtime | Sends airtime to a specified phone number and logs the transaction. This tool formats the phone number, sends the airtime using the
Africa's Talking API, and saves a record of the transaction in the
database.
Args:
phone_number (str): The recipient's phone number.
amount (float): The amount of airtime to send.
currency_code (str): The currency for the transaction (e.g., "KES").
Returns:
str: A message indicating the status of the airtime transaction. |
| get_last_topups | Retrieves the last N top-up transactions from the database. Args:
limit (int, optional): The number of recent transactions to fetch.
Defaults to 3.
Returns:
str: A formatted string listing the last N transactions or a message
if no transactions are found. |
| sum_last_n_topups | Calculates the sum of the last 'n' successful top-ups. This tool retrieves the last 'n' transactions from the database and
calculates their total sum. It ensures that all transactions are in the
same currency before summing.
Args:
n (int, optional): The number of recent top-ups to sum. Defaults to 3.
Returns:
str: The total sum of the last 'n' top-ups or an error message if
the currencies are mixed or no transactions are found. |
| count_topups_by_number | Counts the number of top-ups for a specific phone number. Args:
phone_number (str): The phone number to count transactions for.
Returns:
str: The total count of top-ups for the given number or an error message. |
Prompts
Interactive templates invoked by user choice
| Name | Description |
|---|---|
No prompts | |
Resources
Contextual data attached and managed by the client
| Name | Description |
|---|---|
No resources | |