Skip to main content
Glama
Jake-loranger

Algorand MCP Server

send_payment

Send Algo cryptocurrency payments on the Algorand blockchain by specifying recipient address, amount, and sender mnemonic phrase.

Instructions

Send Algo payment transaction (WARNING: Requires mnemonic phrase)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
mnemonicYesSender account mnemonic phrase (25 words)
toAddressYesRecipient address
amountYesAmount in microAlgos (1 Algo = 1,000,000 microAlgos)
noteNoOptional transaction note

Implementation Reference

  • Core handler implementing the send_payment tool logic: imports account from mnemonic, builds payment transaction parameters, signs and sends the transaction using algosdk, waits for confirmation.
    async sendPayment(
        fromMnemonic: string,
        toAddress: string,
        amount: number,
        note?: string
    ) {
        try {
            const fromAccount = this.importAccountFromMnemonic(fromMnemonic);
            const suggestedParams = await this.algodClient.getTransactionParams().do();
    
            const txnParams: any = {
                sender: fromAccount.addr,
                receiver: toAddress,
                amount: amount,
                suggestedParams,
            };
    
            if (note) {
                txnParams.note = new TextEncoder().encode(note);
            }
    
            const txn = algosdk.makePaymentTxnWithSuggestedParamsFromObject(txnParams);
    
            const signedTxn = txn.signTxn(fromAccount.sk);
            const response = await this.algodClient.sendRawTransaction(signedTxn).do();
            const txId = response.txid || txn.txID();
    
            // Wait for confirmation
            const result = await algosdk.waitForConfirmation(this.algodClient, txId, 4);
    
            return {
                txId,
                confirmedRound: result.confirmedRound,
            };
        } catch (error) {
            throw new Error(`Payment failed: ${error}`);
        }
    }
  • MCP server request handler for 'send_payment': parses input arguments using Zod schema and delegates execution to AlgorandService.sendPayment, formats success/error response.
    case 'send_payment': {
        const parsed = SendPaymentArgsSchema.parse(args);
        try {
            const result = await algorandService.sendPayment(
                parsed.mnemonic,
                parsed.toAddress,
                parsed.amount,
                parsed.note
            );
            return {
                content: [
                    {
                        type: 'text',
                        text: `Payment Successful!\nTransaction ID: ${result.txId}\nConfirmed in Round: ${result.confirmedRound}\nAmount: ${parsed.amount / 1000000} ALGO`,
                    },
                ],
            };
        } catch (error) {
            return {
                content: [
                    {
                        type: 'text',
                        text: `Payment failed: ${error}`,
                    },
                ],
                isError: true,
            };
        }
    }
  • Zod schema defining input validation for send_payment tool arguments.
    const SendPaymentArgsSchema = z.object({
        mnemonic: z.string(),
        toAddress: z.string(),
        amount: z.number(),
        note: z.string().optional(),
    });
  • src/index.ts:179-204 (registration)
    Tool registration in the TOOLS array, defining name, description, and JSON input schema for the MCP server.
    {
        name: 'send_payment',
        description: 'Send Algo payment transaction (WARNING: Requires mnemonic phrase)',
        inputSchema: {
            type: 'object',
            properties: {
                mnemonic: {
                    type: 'string',
                    description: 'Sender account mnemonic phrase (25 words)',
                },
                toAddress: {
                    type: 'string',
                    description: 'Recipient address',
                },
                amount: {
                    type: 'number',
                    description: 'Amount in microAlgos (1 Algo = 1,000,000 microAlgos)',
                },
                note: {
                    type: 'string',
                    description: 'Optional transaction note',
                },
            },
            required: ['mnemonic', 'toAddress', 'amount'],
        },
    },

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/Jake-loranger/algorand-mcp-server'

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