Skip to main content
Glama

get_account_info

Retrieve account address and native token balances across all supported EVM chains for cross-chain trading operations on Paloma DEX.

Instructions

Get account information including address and balances across all chains.

Returns:
    JSON string with account address and native token balances on all supported chains.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The handler function decorated with @mcp.tool() that implements the get_account_info tool. It fetches the server's account address and native token balances (ETH equivalents) across all configured EVM chains using Web3 clients, returning formatted JSON.
    @mcp.tool()
    async def get_account_info(ctx: Context) -> str:
        """Get account information including address and balances across all chains.
        
        Returns:
            JSON string with account address and native token balances on all supported chains.
        """
        try:
            paloma_ctx = ctx.request_context.lifespan_context
            
            account_info = {
                "address": paloma_ctx.address,
                "balances": {}
            }
            
            for chain_id, config in CHAIN_CONFIGS.items():
                if chain_id in paloma_ctx.web3_clients:
                    try:
                        web3 = paloma_ctx.web3_clients[chain_id]
                        balance_wei = web3.eth.get_balance(paloma_ctx.address)
                        balance_eth = web3.from_wei(balance_wei, 'ether')
                        
                        account_info["balances"][config.name] = {
                            "native_balance": str(balance_eth),
                            "chain_id": config.chain_id,
                            "symbol": "ETH" if chain_id == ChainID.ETHEREUM_MAIN else config.name.split()[0]
                        }
                    except Exception as e:
                        account_info["balances"][config.name] = {"error": str(e)}
            
            return json.dumps(account_info, indent=2)
            
        except Exception as e:
            logger.error(f"Error getting account info: {e}")
            return f"Error getting account info: {str(e)}"

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/VolumeFi/mcpPADEX'

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