get_balance
Query the Solana blockchain to retrieve the balance of a specific account using its Pubkey. Provides the balance in a clear response format for easy integration and verification.
Instructions
Returns the balance of the account of provided Pubkey.
Args: address (str): Pubkey of account to query
Returns: str: Account balance response in the format "Balance of {address}: {balance}"
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| address | Yes |
Implementation Reference
- src/server.py:15-27 (handler)The handler function for the 'get_balance' tool, decorated with @mcp.tool() which registers it in the MCP server. It queries the Solana RPC for the balance of the given address pubkey.@mcp.tool() async def get_balance(address: str) -> str: """Returns the balance of the account of provided Pubkey. Args: address (str): Pubkey of account to query Returns: str: Account balance response in the format "Balance of {address}: {balance}" """ async with AsyncClient(rpc_url) as client: balance = await client.get_balance(Pubkey.from_string(address)) return f"Balance of {address}: {balance}"