helius_get_minimum_balance_for_rent_exemption
Calculate the minimum SOL balance needed for rent exemption on Solana based on data size and commitment level.
Instructions
Get the minimum balance required for rent exemption
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| dataSize | Yes | ||
| commitment | No |
Implementation Reference
- src/handlers/helius.ts:227-234 (handler)The main handler function that executes the tool logic by calling the Helius connection's getMinimumBalanceForRentExemption method with the provided dataSize and commitment.
export const getMinimumBalanceForRentExemptionHandler = async (input: GetMinimumBalanceForRentExemptionInput): Promise<ToolResultSchema> => { try { const minBalance = await (helius as any as Helius).connection.getMinimumBalanceForRentExemption(input.dataSize, input.commitment); return createSuccessResponse(`Minimum balance for rent exemption: ${minBalance}`); } catch (error) { return createErrorResponse(`Error getting minimum balance: ${error instanceof Error ? error.message : String(error)}`); } } - src/tools.ts:177-188 (schema)The MCP tool definition including the input schema for validation of dataSize (required number) and optional commitment level.
{ name: "helius_get_minimum_balance_for_rent_exemption", description: "Get the minimum balance required for rent exemption", inputSchema: { type: "object", properties: { dataSize: { type: "number" }, commitment: { type: "string", enum: ["confirmed", "finalized", "processed"] } }, required: ["dataSize"] } }, - src/tools.ts:563-563 (registration)Mapping of the tool name to its handler function in the central handlers dictionary used for tool execution.
"helius_get_minimum_balance_for_rent_exemption": getMinimumBalanceForRentExemptionHandler, - src/handlers/helius.types.ts:114-117 (schema)TypeScript interface defining the input shape for the handler function, matching the MCP schema.
export type GetMinimumBalanceForRentExemptionInput = { dataSize: number; commitment?: "confirmed" | "finalized" | "processed"; }