Skip to main content
Glama

M-Pesa STK Push

mpesa_stk_push
Destructive

Sends an M-Pesa payment prompt to the customer's phone for PIN entry to complete payment. Returns a CheckoutRequestID to track the transaction.

Instructions

Trigger an M-Pesa STK Push — sends a payment prompt to the customer's phone. The customer enters their M-Pesa PIN to complete payment. Returns a CheckoutRequestID to track the transaction with mpesa_stk_query. Async: use mpesa_stk_query after 10-30 seconds to check completion.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
phoneYesCustomer phone number (any Kenyan format: +254..., 07..., 254...)
amountYesAmount in KES (whole number, minimum 1)
account_refYesAccount reference shown to customer on their phone (max 12 chars)
descriptionNoTransaction description (max 13 chars)Payment

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Behavior5/5

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

The description adds significant behavioral context beyond annotations: it explains that the tool is async, that the customer enters their PIN to complete payment, and that a CheckoutRequestID is returned for follow-up. This aligns with destructiveHint=true and provides useful actionable information.

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?

The description is concise with four short sentences, all of which provide necessary information. It front-loads the primary action and sequentially covers process, return value, and follow-up. There is no wasted text.

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

Completeness5/5

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

The description covers the essential aspects of a payment initiation tool: what it does (trigger STK push), the user interaction (customer enters PIN), the result (CheckoutRequestID), and the asynchronous follow-up (use mpesa_stk_query after 10-30 seconds). With an output schema present, the description does not need to detail return fields.

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?

The input schema has 100% coverage with descriptions for all parameters. The tool description does not add additional meaning beyond the schema (e.g., no examples or format clarification). Baseline 3 applies as schema already documents parameters adequately.

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?

The description clearly states that the tool triggers an M-Pesa STK Push, sends a payment prompt to the customer's phone, and returns a CheckoutRequestID for tracking. It distinguishes itself from sibling tools like mpesa_stk_query by noting that the query tool is for checking completion.

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?

The description provides explicit guidance on when to use the sibling tool mpesa_stk_query (after 10-30 seconds) to check completion. It implies that this tool is for initiating payments, but does not explicitly state when not to use it or mention alternatives like airtime_send.

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