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}"
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"size": "<size>"
},
"name": "get_minimum_balance_for_rent_exemption"
}
}Input 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}"