analyze_burnable_accounts
Analyze a Solana wallet to identify token accounts with less than $1 USD value that can be burned and closed. Get details on each account to recover SOL rent.
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
| Name | Required | Description | Default |
|---|---|---|---|
| wallet_address | Yes | The Solana wallet address to analyze |
Implementation Reference
- src/index.ts:259-273 (handler)The handler that processes the 'analyze_burnable_accounts' tool call. Extracts wallet_address from args, calls apiClient.analyzeBurnableAccounts(), and formats the 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:38-47 (schema)The BurnableAccountsAnalysis interface defines the response schema for the burnable accounts analysis, 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:22-36 (schema)The AccountDetail interface defines the shape of each token account returned in the analysis, including pubkey, mint, amount, decimals, usdValue, tokenName, tokenSymbol, etc.
interface AccountDetail { pubkey: string; mint: string; amount: string; decimals: number; uiAmount: number | null; lamports: number; state: string; closeAuthority: string | null; usdValue: number; tokenName?: string; tokenSymbol?: string; tokenLogo?: string; isVerifiedContract?: boolean; } - src/index.ts:195-210 (registration)The tool registration in the tools array with name 'analyze_burnable_accounts', description, and inputSchema requiring wallet_address.
{ 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:101-111 (helper)The analyzeBurnableAccounts method on SolClaimerApiClient that calls the external API endpoint /api/v1/accounts/analyze-burnable via POST.
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: ${this.formatApiError(error)}`); } } - src/index.ts:365-400 (helper)The formatBurnableAccountsResponse function that formats the API response into a human-readable text string for display to the user.
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: ${formatUsd(data.data.totalUsdValue)} Accounts Details: `; if (data.data.accountDetails.length === 0) { response += "No burnable token accounts found.\n"; } data.data.accountDetails.forEach((account, index) => { response += ` ${index + 1}. ${formatTokenLabel(account)} Mint: ${account.mint} Amount: ${formatTokenAmount(account)} USD Value: ${formatUsd(account.usdValue)} Lamports (rent): ${account.lamports} Verified Contract: ${account.isVerifiedContract ? "Yes" : "No"} `; }); response += ` Burn link: https://solclaimer.app `; return response; }