Skip to main content
Glama

helius_get_priority_fee_estimate

Retrieve transaction priority fee estimates on the Solana blockchain using the Helius API. Specify account keys and customize options like priority level to optimize fee calculations for efficient transaction processing.

Instructions

Get priority fee estimate for a transaction

Input Schema

NameRequiredDescriptionDefault
accountKeysNo
optionsNo

Input Schema (JSON Schema)

{ "properties": { "accountKeys": { "items": { "type": "string" }, "type": "array" }, "options": { "properties": { "includeAllPriorityFeeLevels": { "type": "boolean" }, "priorityLevel": { "enum": [ "default", "high", "max" ], "type": "string" } }, "type": "object" } }, "type": "object" }

Implementation Reference

  • The main handler function that implements the tool logic by calling the Helius SDK's getPriorityFeeEstimate RPC method, handling input validation implicitly through types, and formatting the response.
    export const getPriorityFeeEstimateHandler = async (input: GetPriorityFeeEstimateInput): Promise<ToolResultSchema> => { try { // This function has parameter type mismatches const result = await (helius as any as Helius).rpc.getPriorityFeeEstimate({ accountKeys: input.accountKeys, options: { priorityLevel: input.options?.priorityLevel as PriorityLevel, includeAllPriorityFeeLevels: input.options?.includeAllPriorityFeeLevels } }); return createSuccessResponse(`Priority fee estimate: ${JSON.stringify(result.priorityFeeEstimate, null, 2)} priorityFeeLevels: ${JSON.stringify(result.priorityFeeLevels ?? [], null, 2)} `); } catch (error) { return createErrorResponse(`Error getting priority fee estimate: ${error instanceof Error ? error.message : String(error)}`); } }
  • Defines the MCP tool metadata, including name, description, and input schema for validation in the tools array.
    { name: 'helius_get_priority_fee_estimate', description: 'Get priority fee estimate for a transaction', inputSchema: { type: 'object', properties: { accountKeys: { type: 'array', items: { type: 'string' } }, options: { type: 'object', properties: { priorityLevel: { type: 'string', enum: ['default', 'high', 'max'] }, includeAllPriorityFeeLevels: { type: 'boolean' } } } } } },
  • src/tools.ts:585-585 (registration)
    Registers the tool name to its handler function (helius.getPriorityFeeEstimateHandler) in the handlers dictionary.
    "helius_get_priority_fee_estimate": helius.getPriorityFeeEstimateHandler,
  • TypeScript interface defining the expected input shape for the handler, matching the MCP inputSchema.
    export type GetPriorityFeeEstimateInput = { accountKeys?: string[]; options?: { priorityLevel?: "default" | "high" | "max"; includeAllPriorityFeeLevels?: boolean; }; }

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