Skip to main content
Glama

airdrop_sol

Request SOL airdrop for testing on devnet or testnet networks to fund wallets for blockchain development and transaction simulations.

Instructions

Request SOL airdrop for testing (devnet/testnet only)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
walletNameYesName of the wallet
amountNoAmount of SOL to airdrop (default: 1)

Implementation Reference

  • The main execution handler for the 'airdrop_sol' tool. It validates the network and wallet, computes lamports, requests airdrop via Solana RPC, and returns the transaction signature.
    async function handleAirdropSol(args: any) {
      const { walletName, amount = 1 } = args;
      
      if (currentNetwork === "mainnet") {
        throw new Error("Airdrop is not available on mainnet");
      }
    
      const wallet = wallets.get(walletName);
      if (!wallet) {
        throw new Error(`Wallet '${walletName}' not found`);
      }
    
      ensureConnection();
      const lamports = Math.floor(amount * LAMPORTS_PER_SOL);
      const signature = await connection.requestAirdrop(wallet.keypair.publicKey, lamports);
    
      return {
        success: true,
        signature,
        amount: amount,
        explorerUrl: `https://explorer.solana.com/tx/${signature}?cluster=${currentNetwork}`
      };
    }
  • JSON schema defining the input parameters for the airdrop_sol tool: walletName (string, required), amount (number, optional).
    inputSchema: {
      type: "object",
      properties: {
        walletName: {
          type: "string",
          description: "Name of the wallet"
        },
        amount: {
          type: "number",
          description: "Amount of SOL to airdrop (default: 1)"
        }
      },
      required: ["walletName"]
    }
  • src/index.ts:194-210 (registration)
    Registration of the 'airdrop_sol' tool in the tools array returned by ListToolsRequestSchema handler, including name, description, and input schema.
    {
      name: "airdrop_sol",
      description: "Request SOL airdrop for testing (devnet/testnet only)",
      inputSchema: {
        type: "object",
        properties: {
          walletName: {
            type: "string",
            description: "Name of the wallet"
          },
          amount: {
            type: "number",
            description: "Amount of SOL to airdrop (default: 1)"
          }
        },
        required: ["walletName"]
      }
  • src/index.ts:1306-1307 (registration)
    Dispatch case in the central CallToolRequestSchema switch statement that routes 'airdrop_sol' calls to the handleAirdropSol handler.
    case "airdrop_sol":
      result = await handleAirdropSol(args);

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/ExpertVagabond/solana-mcp-server'

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