request_devnet_airdrop
Get free SOL tokens on Solana's devnet test network to pay for transaction fees during development and testing.
Instructions
Request free SOL on devnet for testing. Use this to get SOL for transaction fees.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| amount | No | Amount of SOL to request (max 2) |
Implementation Reference
- src/wallet.ts:228-246 (handler)Core implementation of the request_devnet_airdrop tool logic: requests SOL airdrop on Solana devnet using the wallet's connection and keypair.async requestAirdrop(amount: number = 1): Promise<{ success: boolean; amount: number; signature?: string }> { try { const signature = await this.connection.requestAirdrop( this.keypair.publicKey, amount * LAMPORTS_PER_SOL ); await this.connection.confirmTransaction(signature); return { success: true, amount, signature, }; } catch (error: any) { // Rate limited or other error throw new Error(`Airdrop failed: ${error.message}. Try again later or use https://faucet.solana.com`); } }
- src/index.ts:182-193 (handler)MCP tool dispatcher handler for 'request_devnet_airdrop': parses input arguments, enforces max amount, delegates to wallet.requestAirdrop, and formats response.case "request_devnet_airdrop": { const { amount = 1 } = args as { amount?: number }; const result = await wallet.requestAirdrop(Math.min(amount, 2)); return { content: [ { type: "text", text: JSON.stringify(result, null, 2), }, ], }; }
- src/index.ts:79-92 (schema)Input schema definition for the 'request_devnet_airdrop' tool, specifying optional 'amount' parameter.{ name: "request_devnet_airdrop", description: "Request free SOL on devnet for testing. Use this to get SOL for transaction fees.", inputSchema: { type: "object", properties: { amount: { type: "number", description: "Amount of SOL to request (max 2)", }, }, required: [], }, },
- src/index.ts:24-93 (registration)Registration of all tools including 'request_devnet_airdrop' in the TOOLS array used by MCP server.const TOOLS: Tool[] = [ { name: "get_wallet_address", description: "Get the agent's Solana wallet address. Use this to receive funds or share your address.", inputSchema: { type: "object", properties: {}, required: [], }, }, { name: "get_balance", description: "Check the USDC and SOL balance of the agent wallet. Returns balances on Solana devnet.", inputSchema: { type: "object", properties: {}, required: [], }, }, { 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"], }, }, { name: "get_recent_transactions", description: "Get recent transactions for the agent wallet.", inputSchema: { type: "object", properties: { limit: { type: "number", description: "Maximum number of transactions to return (default: 10)", }, }, required: [], }, }, { name: "request_devnet_airdrop", description: "Request free SOL on devnet for testing. Use this to get SOL for transaction fees.", inputSchema: { type: "object", properties: { amount: { type: "number", description: "Amount of SOL to request (max 2)", }, }, required: [], }, }, ];