get_wallet_overview
Retrieve a detailed overview of a wallet, including EDU balance, tokens, and NFTs, by specifying the wallet address and optional token or NFT contract addresses.
Instructions
Get an overview of a wallet including EDU, tokens, and NFTs
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| nftAddresses | No | List of NFT contract addresses to check | |
| tokenAddresses | No | List of token contract addresses to check | |
| walletAddress | Yes | Wallet address to check |
Input Schema (JSON Schema)
{
"properties": {
"nftAddresses": {
"description": "List of NFT contract addresses to check",
"items": {
"type": "string"
},
"type": "array"
},
"tokenAddresses": {
"description": "List of token contract addresses to check",
"items": {
"type": "string"
},
"type": "array"
},
"walletAddress": {
"description": "Wallet address to check",
"type": "string"
}
},
"required": [
"walletAddress"
],
"type": "object"
}
Implementation Reference
- src/blockchain.ts:371-427 (handler)The main handler function that executes the tool logic by fetching EDU native token balance, multiple ERC20 token balances (with USD values from SailFish oracle), and ERC721 NFT balances (optionally with token IDs).export async function getWalletOverview( walletAddress: string, tokenAddresses: string[] = [], nftAddresses: string[] = [] ): Promise<{ address: string, eduBalance: { balance: string, balanceInEdu: string }, tokens: Array<{ tokenAddress: string, balance: string, decimals: number, symbol: string, name: string, formattedBalance: string, usdValue?: string }>, nfts: Array<{ contractAddress: string, name?: string, symbol?: string, balance: string, tokenIds?: string[] }> }> { try { // Get EDU balance const eduBalance = await getEduBalance(walletAddress); // Get token balances const tokens = await getMultipleTokenBalances(tokenAddresses, walletAddress); // Get NFT balances const nfts = await Promise.all( nftAddresses.map(async (nftAddress) => { try { return await getERC721Balance(nftAddress, walletAddress); } catch (error) { console.error(`Error fetching NFT balance for ${nftAddress}:`, error); return { contractAddress: nftAddress, balance: '0' }; } }) ); return { address: walletAddress, eduBalance, tokens, nfts }; } catch (error) { console.error('Error fetching wallet overview:', error); throw error; } }
- src/index.ts:950-968 (registration)MCP tool call handler dispatch that validates parameters and invokes the getWalletOverview function from the blockchain module.case 'get_wallet_overview': { if (!args.walletAddress || typeof args.walletAddress !== 'string') { throw new McpError(ErrorCode.InvalidParams, 'Wallet address is required'); } const tokenAddresses = Array.isArray(args.tokenAddresses) ? args.tokenAddresses : []; const nftAddresses = Array.isArray(args.nftAddresses) ? args.nftAddresses : []; const overview = await blockchain.getWalletOverview(args.walletAddress, tokenAddresses, nftAddresses); return { content: [ { type: 'text', text: JSON.stringify(overview, null, 2), }, ], }; }
- src/index.ts:375-401 (schema)Tool schema definition registered in ListToolsRequestSchema, including input schema with walletAddress (required), optional tokenAddresses and nftAddresses arrays.name: 'get_wallet_overview', description: 'Get an overview of a wallet including EDU, tokens, and NFTs', inputSchema: { type: 'object', properties: { walletAddress: { type: 'string', description: 'Wallet address to check', }, tokenAddresses: { type: 'array', items: { type: 'string', }, description: 'List of token contract addresses to check', }, nftAddresses: { type: 'array', items: { type: 'string', }, description: 'List of NFT contract addresses to check', }, }, required: ['walletAddress'], }, },