Skip to main content
Glama

initiate_payment

Destructive

STEP 2 of the in-chat payment flow. Starts a payment session for an order and returns a PaymentSession with an instruction the agent renders in chat. REQUIRES a buyer_delegation_token — obtain it exactly like execute_checkout: call request_delegation, have the user approve in chat, then check_delegation to get the token (spending money always needs human approval). For channel "mobile_money" you MUST collect the buyer's phone (Ghana: 055… or +233…) and provider — use codes mtn, vod (Vodafone/Telecel), or tgo (AirtelTigo); aliases telecel→vod, tigo→tgo are accepted. ALWAYS quote the Show this instruction to the buyer line from the response verbatim (Paystack display_text). For channel "card", no phone/provider is needed; the response instruction contains an authorization_url you send the user to. After calling: if instruction.action == "submit_otp", ask the user for the OTP and call submit_payment_otp. If instruction.action == "approve_on_phone", tell the user to approve the prompt on their phone, then poll get_payment_status. If instruction.action == "redirect" (card), send the user the authorization_url, then poll get_payment_status.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
phoneNoBuyer mobile-money phone number (required for channel "mobile_money")
channelYesPayment channel chosen by the buyer (from get_payment_methods)
gatewayNoPayment gateway to use when the store has more than one enabled (see get_payment_methods.gateways[].id). Optional — defaults to the store's first enabled gateway.
site_idNoRegistered site ID (optional if DEFAULT_SITE_ID is set)
order_idYesOrder ID to pay for
providerNoMobile-money provider (required for channel "mobile_money"). Codes: mtn, vod (Vodafone/Telecel), tgo (AirtelTigo).
buyer_delegation_tokenNoDelegation token from the buyer (from request_delegation/check_delegation). Required — payments always need human approval.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
messageNo
referenceNo
instructionNo
payment_statusNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.8/5.0
Behavior5/5

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

Annotations indicate destructive and readOnly false. Description elaborates extensively: starts a financial transaction, requires human approval, channel-specific behavior (mobile_money vs card), and detailed response handling. No contradiction with annotations.

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?

Efficiently front-loaded with 'STEP 2' and structured with prerequisites, channel specifics, and post-call actions. Every sentence adds value; no redundancy.

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?

Given 7 parameters, two channels, delegation flow, and output schema (exists), the description covers all necessary context: how to call, what to expect (instruction with action), and how to proceed. References sibling tools (request_delegation, check_delegation, submit_payment_otp, get_payment_status) to complete the picture.

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

Parameters5/5

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

Schema coverage is 100%, but description adds significant meaning: exact phone format (055... or +233...), provider alias mapping (telecel→vod, tigo→tgo), and clarifies that phone and provider are required only for mobile_money. Also explains gateway optionality and default behavior.

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?

Clearly states it is step 2 of the payment flow, starts a payment session, and returns a PaymentSession with instruction. Distinct from siblings like get_payment_status or submit_payment_otp by specifying its role in the multi-step process.

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 explicit prerequisites (buyer_delegation_token) and how to obtain it via request_delegation and check_delegation. Describes post-call actions based on instruction.action. Does not explicitly name alternative tools, but context implies sequencing and when to use other steps.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.