get_minimum_balance_for_rent_exemption
Calculate the minimum balance needed for Solana accounts to be rent-exempt, based on specified data size, ensuring efficient blockchain interactions.
Instructions
Returns minimum balance required to make account rent exempt.
Args: size (int): Account data length
Returns: str: Minimum balance in the format "Minimum balance for rent exemption: {balance}"
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| size | Yes |
Implementation Reference
- src/server.py:213-226 (handler)The handler function decorated with @mcp.tool() registers and implements the tool. It creates an AsyncClient to the Solana RPC, calls get_minimum_balance_for_rent_exemption with the provided size, and formats the result as a string.@mcp.tool() async def get_minimum_balance_for_rent_exemption(size: int) -> str: """Returns minimum balance required to make account rent exempt. Args: size (int): Account data length Returns: str: Minimum balance in the format "Minimum balance for rent exemption: {balance}" """ async with AsyncClient(rpc_url) as client: balance = await client.get_minimum_balance_for_rent_exemption(size) return f"Minimum balance for rent exemption: {balance}"