Skip to main content
Glama

send_usdc

Send USDC cryptocurrency to Solana addresses on devnet. Execute real blockchain transactions by specifying recipient and amount.

Instructions

Send USDC to another Solana address. This executes a real transaction on Solana devnet.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
recipientYesThe Solana address to send USDC to
amountYesAmount of USDC to send (e.g., 5.00 for $5)
memoNoOptional memo/note for the transaction

Implementation Reference

  • MCP tool handler for 'send_usdc': destructures arguments from request, invokes wallet.sendUsdc, and returns formatted success response with transaction explorer link.
    case "send_usdc": {
      const { recipient, amount, memo } = args as {
        recipient: string;
        amount: number;
        memo?: string;
      };
    
      const result = await wallet.sendUsdc(recipient, amount, memo);
      return {
        content: [
          {
            type: "text",
            text: JSON.stringify({
              success: true,
              ...result,
              explorer: `https://explorer.solana.com/tx/${result.signature}?cluster=devnet`,
            }, null, 2),
          },
        ],
      };
    }
  • src/index.ts:43-64 (registration)
    Registers the 'send_usdc' tool in the TOOLS list, including name, description, and input schema for MCP tool listing.
    {
      name: "send_usdc",
      description: "Send USDC to another Solana address. This executes a real transaction on Solana devnet.",
      inputSchema: {
        type: "object",
        properties: {
          recipient: {
            type: "string",
            description: "The Solana address to send USDC to",
          },
          amount: {
            type: "number",
            description: "Amount of USDC to send (e.g., 5.00 for $5)",
          },
          memo: {
            type: "string",
            description: "Optional memo/note for the transaction",
          },
        },
        required: ["recipient", "amount"],
      },
    },
  • Core implementation of USDC transfer: validates balance, creates associated token accounts if needed, builds SPL transfer transaction, and sends/confirms on Solana devnet.
    async sendUsdc(
      recipientAddress: string,
      amount: number,
      memo?: string
    ): Promise<TransactionResult> {
      const recipient = new PublicKey(recipientAddress);
      const sender = this.keypair.publicKey;
    
      // Get ATAs
      const senderAta = await getAssociatedTokenAddress(USDC_MINT, sender);
      const recipientAta = await getAssociatedTokenAddress(USDC_MINT, recipient);
    
      // Check sender has enough USDC
      try {
        const senderAccount = await getAccount(this.connection, senderAta);
        const balance = Number(senderAccount.amount) / Math.pow(10, USDC_DECIMALS);
        if (balance < amount) {
          throw new Error(`Insufficient USDC balance. Have: ${balance}, Need: ${amount}`);
        }
      } catch (error: any) {
        if (error.message?.includes("Insufficient")) {
          throw error;
        }
        throw new Error("No USDC token account found. Request devnet USDC first.");
      }
    
      // Build transaction
      const transaction = new Transaction();
    
      // Check if recipient ATA exists, if not create it
      try {
        await getAccount(this.connection, recipientAta);
      } catch {
        // Create recipient ATA
        transaction.add(
          createAssociatedTokenAccountInstruction(
            sender, // payer
            recipientAta, // ata address
            recipient, // owner
            USDC_MINT // mint
          )
        );
      }
    
      // Add transfer instruction
      const amountInBaseUnits = Math.floor(amount * Math.pow(10, USDC_DECIMALS));
      transaction.add(
        createTransferInstruction(
          senderAta,
          recipientAta,
          sender,
          amountInBaseUnits
        )
      );
    
      // Send transaction
      const signature = await sendAndConfirmTransaction(
        this.connection,
        transaction,
        [this.keypair]
      );
    
      return {
        signature,
        recipient: recipientAddress,
        amount,
        memo,
      };
    }
Behavior3/5

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

With no annotations provided, the description carries full burden. It discloses that this executes a real transaction (implying mutation and potential costs/irreversibility) and specifies the network (devnet), which is useful. However, it lacks details on permissions, rate limits, error handling, or transaction confirmation, leaving behavioral aspects incomplete.

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 front-loaded with the core action and resource, followed by network context, in just two concise sentences. Every word earns its place with no redundancy or fluff, making it highly efficient and easy to parse.

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

Completeness3/5

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

Given the tool's complexity (financial transaction with no annotations and no output schema), the description is minimally adequate. It covers the action and network but lacks details on return values, error cases, or security implications, which are important for a mutation tool in this context.

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 description coverage is 100%, so the schema already documents all parameters (recipient, amount, memo) thoroughly. The description adds no additional parameter semantics beyond what the schema provides, such as format examples or constraints, meeting the baseline for high coverage.

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 the specific action ('Send USDC') and target resource ('to another Solana address'), distinguishing it from sibling tools like get_balance or get_recent_transactions which are read-only operations. It explicitly mentions execution on Solana devnet, providing precise scope.

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 implies usage context by specifying 'real transaction on Solana devnet', suggesting this is for sending funds in a test environment. However, it does not explicitly state when to use this versus alternatives like request_devnet_airdrop for funding or other tools for queries, leaving some guidance gaps.

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/noah-ing/agent-wallet-mcp'

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