Skip to main content
Glama

scan_wallet

Scan a Solana wallet to identify empty token accounts with reclaimable SOL. Returns count of closeable accounts and estimated recoverable SOL without requiring private keys.

Instructions

Scan a Solana wallet for reclaimable SOL locked in empty token accounts. Returns count of closeable accounts and estimated SOL recoverable. Free, read-only — no private key needed.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
walletYesSolana wallet address (base58)

Implementation Reference

  • The 'scanWallet' function performs the actual backend API call to '/api/checkTokenAccounts' and processes the result to identify reclaimable SOL from token accounts.
    export async function scanWallet(walletAddress) {
        const data = await apiPost('/api/checkTokenAccounts', {
            walletAddresses: [walletAddress],
        });
        if (!data.success) {
            return {
                success: false,
                totalAccounts: 0,
                totalSolRecoverable: 0,
                tokenAccounts: [],
                burnAccounts: [],
                error: data.error || 'Scan failed',
            };
        }
        // API returns { wallets: [{ address, emptyAccounts, potentialReward, accounts: [...] }] }
        const wallets = data.wallets || [];
        const wallet = wallets[0] || {};
        const accounts = wallet.accounts || [];
        const tokenAccounts = accounts
            .filter(a => !a.hasBalance || Number(a.balance || 0) === 0)
            .map(a => ({
            pubkey: String(a.pubkey || a.address || ''),
            mint: String(a.mint || ''),
            amount: 0,
            rentLamports: 2039280,
        }));
        const burnAccounts = accounts
            .filter(a => a.hasBalance && Number(a.balance || 0) > 0)
            .map(a => ({
            pubkey: String(a.pubkey || a.address || ''),
            mint: String(a.mint || ''),
            amount: Number(a.balance || 0),
            rentLamports: 2039280,
        }));
        const totalAccounts = tokenAccounts.length + burnAccounts.length;
        const totalSolRecoverable = Number(wallet.potentialReward || 0) || totalAccounts * 0.00204;
        return {
            success: true,
            totalAccounts,
            totalSolRecoverable,
            tokenAccounts,
            burnAccounts,
        };
    }
Behavior4/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It effectively communicates key behavioral traits: the operation is free, read-only, doesn't require private keys, and returns specific metrics (count and estimated SOL). It doesn't mention rate limits, error conditions, or performance characteristics, but provides sufficient core information for a tool with one parameter.

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 perfectly concise and front-loaded. The first sentence establishes the core purpose, the second specifies the return values, and the third provides important usage context. Every sentence earns its place with zero wasted words.

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

Completeness4/5

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

Given the tool's moderate complexity (single parameter, no output schema, no annotations), the description provides good completeness. It explains what the tool does, what it returns, and key behavioral constraints. The main gap is the lack of output schema, but the description adequately describes the return values (count and estimated SOL).

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?

The input schema has 100% description coverage, with the single parameter 'wallet' already documented as 'Solana wallet address (base58)' with length constraints. The description doesn't add any additional parameter semantics beyond what the schema provides, so it meets the baseline score of 3 for high schema 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 ('Scan a Solana wallet'), target resource ('reclaimable SOL locked in empty token accounts'), and output ('Returns count of closeable accounts and estimated SOL recoverable'). It distinguishes itself from sibling tools by focusing on wallet scanning for reclaimable SOL rather than DEX detection, price checking, or token information retrieval.

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 provides clear context for when to use this tool: to find reclaimable SOL in empty token accounts. It explicitly states 'Free, read-only — no private key needed,' which helps determine appropriate usage scenarios. However, it doesn't explicitly mention when NOT to use it or name specific alternatives among the sibling tools.

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/RefundYourSOL/refundyoursol-mcp'

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