{"name":"balance","title":"ETH and USDC balance","category":"wallets","useWhen":"Run before sending ETH or USDC or paying gas, to confirm the wallet really has enough. Never trust a balance remembered from earlier in a chat.","benefit":{"kind":"money","text":"An agent that trusts a balance it remembers can send a payment that fails, or pay gas from a wallet that can't cover it."},"description":"Reads a wallet's ETH and native USDC balance on Base directly from the chain, at one block.","price":"$0.01","priceText":"25 free calls a day, then $0.01 USDC per call (x402)","http":{"method":"POST","path":"/api/tools/balance","body":"JSON object with the inputs below"},"mcp":{"method":"tools/call","name":"balance"},"inputs":[{"name":"wallet","type":"string","required":true,"lookingFor":"The wallet address to check: 0x followed by 40 hex characters.","whereToGet":"The user, your own wallet, or the 'from' of a transaction."},{"name":"network","type":"string","required":false,"lookingFor":"\"base\" (default) or \"base-sepolia\" for the test network.","whereToGet":"Leave it out for real funds."}],"outputs":[{"field":"wallet","type":"string","is":"The wallet, in checksummed form.","howWorkedOut":"The input address, checksummed."},{"field":"network","type":"string","is":"The network read.","howWorkedOut":"The input, or base."},{"field":"block","type":"number","is":"The block both balances were read at.","howWorkedOut":"The latest block number from the RPC, then both reads pinned to it."},{"field":"eth","type":"string","is":"ETH balance in ETH (18 decimals).","howWorkedOut":"eth_getBalance at that block, divided by 10^18."},{"field":"eth_wei","type":"string","is":"ETH balance in wei, the raw unit.","howWorkedOut":"eth_getBalance at that block."},{"field":"usdc","type":"string | null","is":"Native USDC balance (6 decimals). null on base-sepolia, where we don't track a USDC address.","howWorkedOut":"balanceOf on Circle's USDC contract at that block, divided by 10^6."},{"field":"source","type":"string","is":"Where the numbers came from.","howWorkedOut":"Names the RPC calls and block."}],"notes":[],"inputSchema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"wallet":{"type":"string"},"network":{"default":"base","type":"string","enum":["base","base-sepolia"]}},"required":["wallet"]}}