Skip to main content
Glama

helius_get_minimum_balance_for_rent_exemption

Calculate the minimum balance needed for rent exemption on Solana based on data size and commitment level using Helius API.

Instructions

Get the minimum balance required for rent exemption

Input Schema

NameRequiredDescriptionDefault
commitmentNo
dataSizeYes

Input Schema (JSON Schema)

{ "properties": { "commitment": { "enum": [ "confirmed", "finalized", "processed" ], "type": "string" }, "dataSize": { "type": "number" } }, "required": [ "dataSize" ], "type": "object" }

Implementation Reference

  • The main handler function that implements the tool's core logic by calling the Solana RPC method getMinimumBalanceForRentExemption on the Helius connection and handling the response.
    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)}`); } }
  • Defines the tool's name, description, and input schema for validation.
    { 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)
    Maps the tool name to its handler function in the central handlers dictionary.
    "helius_get_minimum_balance_for_rent_exemption": getMinimumBalanceForRentExemptionHandler,
  • TypeScript type definition for the handler's input parameter.
    export type GetMinimumBalanceForRentExemptionInput = { dataSize: number; commitment?: "confirmed" | "finalized" | "processed"; }

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/dcSpark/mcp-server-helius'

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