Skip to main content
Glama
tywenk

Model Context Protocol Server for Solana Client

by tywenk

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
NameRequiredDescriptionDefault
sizeYes

Implementation Reference

  • 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}"

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/tywenk/mcp-sol'

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