Skip to main content
Glama
nasoma

Africa's Talking Airtime MCP

check_balance

Retrieve your current airtime account balance from Africa's Talking to monitor available funds for transactions across supported African countries.

Instructions

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.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • main.py:122-140 (handler)
    The 'check_balance' tool handler. This async function is decorated with @mcp.tool(), making it the primary implementation. It queries the Africa's Talking API for the account balance and returns a formatted string.
    async def check_balance() -> str: """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. """ try: response = africastalking.Application.fetch_application_data() if "UserData" in response and "balance" in response["UserData"]: balance = response["UserData"]["balance"] return f"Account Balance: {balance}" else: return "Balance information not available at the moment. Try again later." except Exception as e: return f"Error fetching balance: {str(e)}"

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/nasoma/africastalking-airtime-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server