Skip to main content
Glama

Send SMS

sms_send
Destructive

Send SMS messages to up to 1,000 recipients across 20+ African markets via Africa's Talking. Supports Unicode, returns per-recipient status and cost.

Instructions

Send SMS to one or many recipients via Africa's Talking. Supports up to 1,000 recipients per call. Works across Kenya, Nigeria, Ghana, Tanzania, Uganda, and 15+ African markets. Returns per-recipient status and cost.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
messageYesSMS message text. Unicode supported (Kiswahili, etc.)
recipientsYesList of phone numbers in E.164 format e.g. ['+254712345678']
sender_idNoOptional pre-registered alphanumeric sender ID

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The sms_send tool handler function. Accepts message text, a list of recipient phone numbers (E.164 format), and an optional sender_id. Calls Africa's Talking SMS API and returns per-recipient status, cost, and a summary.
    def sms_send(
        message: Annotated[str, "SMS message text. Unicode supported (Kiswahili, etc.)"],
        recipients: Annotated[list[str], "List of phone numbers in E.164 format e.g. ['+254712345678']"],
        sender_id: Annotated[str, "Optional pre-registered alphanumeric sender ID"] = "",
    ) -> dict:
        """
        Send SMS to one or many recipients via Africa's Talking.
        Supports up to 1,000 recipients per call.
        Works across Kenya, Nigeria, Ghana, Tanzania, Uganda, and 15+ African markets.
        Returns per-recipient status and cost.
        """
        sms = _at_sms()
        kwargs: dict = {"message": message, "recipients": recipients}
        if sender_id:
            kwargs["sender_id"] = sender_id
    
        response = sms.send(**kwargs)
        data      = response["SMSMessageData"]
        results   = data["Recipients"]
    
        success_count = sum(1 for r in results if r["status"] == "Success")
        failed        = [
            {"number": r["number"], "status": r["status"]}
            for r in results if r["status"] != "Success"
        ]
    
        return {
            "sent":     success_count,
            "failed":   len(failed),
            "failures": failed,
            "summary":  data.get("Message", ""),
            "results":  [
                {"number": r["number"], "status": r["status"], "cost": r.get("cost"), "id": r.get("messageId")}
                for r in results
            ],
        }
  • Registration of sms_send as an MCP tool via @mcp.tool decorator with annotations (title='Send SMS', destructiveHint=True, etc.).
    @mcp.tool(annotations={
        'title': 'Send SMS',
        'readOnlyHint': False,
        'destructiveHint': True,
        'idempotentHint': False,
        'openWorldHint': True,
    })
  • The _at_sms helper function that initializes the Africa's Talking SDK (with AT_USERNAME and AT_API_KEY env vars) and returns the SMS service object used by sms_send.
    def _at_sms():
        africastalking.initialize(
            username=os.environ["AT_USERNAME"],
            api_key=os.environ["AT_API_KEY"],
        )
        return africastalking.SMS
  • Smoke test that verifies 'sms_send' is registered among the MCP tools (asserts its name is in the list of tool names).
    tools = asyncio.run(mcp.list_tools())
    names = [t.name for t in tools]
    expected = [
        "mpesa_stk_push",
        "mpesa_stk_query",
        "mpesa_transaction_status",
        "sms_send",
        "airtime_send",
    ]
    for name in expected:
        assert name in names, f"Tool '{name}' not registered. Found: {names}"
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Description discloses destructiveHint (cost/fees) beyond annotations, adds constraints (1,000 recipients) and return details (per-recipient status and cost). No contradiction.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Concise, front-loaded first sentence with core purpose, followed by essential details in a few sentences. No wasted words.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Covers key constraints (max recipients, markets, return info). Output schema exists, so return explanation sufficient. Could mention authentication but not required.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so description adds minimal extra value (mentions Unicode). Baseline 3 appropriate.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

Description clearly states verb (Send) and resource (SMS), and differentiates from siblings which deal with airtime and M-Pesa services.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Provides usage context (max recipients, supported markets, return info) but lacks explicit when-to-use vs alternatives. However, siblings are distinct, so implied.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other 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/gabrielmahia/mpesa-mcp'

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