analyze_burnable_accounts
Analyze Solana wallets to identify token accounts with minimal value that can be burned to recover SOL rent. Provides token details and USD values for each account.
Instructions
Analyze a Solana wallet for token accounts with balances worth less than $1 USD that can be burned and closed. Returns detailed information about each burnable account including token name, symbol, and USD value.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| wallet_address | Yes | The Solana wallet address to analyze |
Implementation Reference
- src/index.ts:204-218 (handler)The main handler that processes the analyze_burnable_accounts tool call. It extracts the wallet_address argument, validates it, calls the API client method, and returns the formatted response.
} else if (name === "analyze_burnable_accounts") { const walletAddress = (args as Record<string, string>).wallet_address; if (!walletAddress) { throw new Error("wallet_address is required"); } const result = await apiClient.analyzeBurnableAccounts(walletAddress); return { content: [ { type: "text", text: formatBurnableAccountsResponse(result), }, ], }; - src/index.ts:157-171 (registration)Tool registration defining the analyze_burnable_accounts tool with its name, description, and inputSchema that requires a wallet_address parameter.
name: "analyze_burnable_accounts", description: "Analyze a Solana wallet for token accounts with balances worth less than $1 USD that can be burned and closed. " + "Returns detailed information about each burnable account including token name, symbol, and USD value.", inputSchema: { type: "object" as const, properties: { wallet_address: { type: "string", description: "The Solana wallet address to analyze", }, }, required: ["wallet_address"], }, }, - src/index.ts:92-106 (handler)The SolClaimerApiClient.analyzeBurnableAccounts method that makes the actual HTTP POST request to the backend API endpoint '/api/v1/accounts/analyze-burnable'.
async analyzeBurnableAccounts(walletAddress: string): Promise<BurnableAccountsAnalysis> { try { const response = await this.apiClient.post<BurnableAccountsAnalysis>( "/api/v1/accounts/analyze-burnable", { walletAddress } ); return response.data; } catch (error) { throw new Error( `Failed to analyze burnable accounts: ${ error instanceof Error ? error.message : "Unknown error" }` ); } } - src/index.ts:36-45 (schema)TypeScript interface BurnableAccountsAnalysis defining the response structure including accountsToBurn, totalSol, totalUsdValue, and accountDetails array.
interface BurnableAccountsAnalysis { success: boolean; data: { accountsToBurn: number; totalSol: number; totalUsdValue: number; accountDetails: AccountDetail[]; }; timestamp: string; } - src/index.ts:262-289 (helper)The formatBurnableAccountsResponse helper function that formats the API response into a human-readable string with account details including token name, amount, USD value, and verification status.
function formatBurnableAccountsResponse(data: BurnableAccountsAnalysis): string { if (!data.success) { return "Failed to analyze burnable accounts"; } let response = ` Burnable Token Accounts Analysis ================================= Total Accounts to Burn: ${data.data.accountsToBurn} Total SOL to Recover: ${data.data.totalSol} SOL Total USD Value: $${data.data.totalUsdValue.toFixed(2)} Accounts Details: `; data.data.accountDetails.forEach((account, index) => { response += ` ${index + 1}. ${account.tokenName} (${account.tokenSymbol}) Mint: ${account.mint} Amount: ${account.uiAmount} (${account.amount} smallest units) USD Value: $${account.usdValue.toFixed(2)} Lamports (rent): ${account.lamports} Verified Contract: ${account.isVerifiedContract ? "Yes" : "No"} `; }); return response; }