Skip to main content
Glama
nasoma

Africa's Talking Airtime MCP

check_balance

Verify your Africa's Talking airtime account balance to manage transactions and monitor airtime usage across supported African countries.

Instructions

Check the airtime balance for your Africa's Talking account.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • main.py:121-140 (handler)
    The main handler function for the 'check_balance' tool. It is registered via the @mcp.tool() decorator and implements the logic to fetch and return the Africa's Talking account balance.
    @mcp.tool() 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)}"

Other Tools

Related Tools

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