Skip to main content
Glama

send-mon-transaction

Initiate MON token transfers on the Monad testnet by specifying recipient addresses and transaction amounts using this MCP server tool.

Instructions

Send MON transaction on Monad testnet

Input Schema

NameRequiredDescriptionDefault
amountYesAmount of MON to send
toYesRecipient address

Input Schema (JSON Schema)

{ "$schema": "http://json-schema.org/draft-07/schema#", "additionalProperties": false, "properties": { "amount": { "description": "Amount of MON to send", "type": "string" }, "to": { "description": "Recipient address", "type": "string" } }, "required": [ "to", "amount" ], "type": "object" }

Implementation Reference

  • The core handler function that executes the tool: creates wallet client, sends transaction to recipient with parsed ether amount, returns success with tx hash or error message.
    async ({ to, amount }) => { try { // Create wallet client const client = await createWallet(); // Send transaction const hash = await client.sendTransaction({ to: to as `0x${string}`, value: parseEther(amount), }); return { content: [ { type: "text", text: `Transaction sent successfully! Hash: ${hash}`, }, ], }; } catch (error) { return { content: [ { type: "text", text: `Failed to send transaction. Error: ${error instanceof Error ? error.message : String(error)}`, }, ], }; } }
  • Input validation schema using Zod for recipient address and MON amount.
    { to: z.string().describe("Recipient address"), amount: z.string().describe("Amount of MON to send"), },
  • Registers the send-mon-transaction tool on the MCP server with name, description, schema, and handler function.
    export function sendMonProvider(server: McpServer) { server.tool( "send-mon-transaction", "Send MON transaction on Monad testnet", { to: z.string().describe("Recipient address"), amount: z.string().describe("Amount of MON to send"), }, async ({ to, amount }) => { try { // Create wallet client const client = await createWallet(); // Send transaction const hash = await client.sendTransaction({ to: to as `0x${string}`, value: parseEther(amount), }); return { content: [ { type: "text", text: `Transaction sent successfully! Hash: ${hash}`, }, ], }; } catch (error) { return { content: [ { type: "text", text: `Failed to send transaction. Error: ${error instanceof Error ? error.message : String(error)}`, }, ], }; } } ); }
  • Utility function to create a configured wallet client for Monad testnet from environment private key, used by the handler.
    export async function createWallet() { const privateKey = process.env.PRIVATE_KEY; if (!privateKey) { throw new Error('PRIVATE_KEY environment variable is not set'); } const account = privateKeyToAccount(privateKey as `0x${string}`); const client = createWalletClient({ account, chain: monadTestnet, transport: http() }); return client; }
  • src/index.ts:24-24 (registration)
    Top-level call to walletProvider during server initialization, which chains to sendMonProvider registration.
    walletProvider(server);

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/lispking/monad-mcp-server'

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