Skip to main content
Glama

helius_get_fee_for_message

Calculate transaction fees for Solana blockchain messages using base64-encoded data to estimate costs before execution.

Instructions

Get the fee for a serialized message

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
messageYesBase64 encoded message string
commitmentNo

Implementation Reference

  • The core handler function for 'helius_get_fee_for_message'. Deserializes base64-encoded message to VersionedMessage, computes fee using Helius RPC connection.getFeeForMessage, and formats response.
    export const getFeeForMessageHandler = async (input: GetFeeForMessageInput): Promise<ToolResultSchema> => {
      try {
        const messageBytes = Buffer.from(input.message, 'base64');
        const versionedMessage = VersionedMessage.deserialize(messageBytes);
        const fee = await (helius as any as Helius).connection.getFeeForMessage(versionedMessage, input.commitment);
        return createSuccessResponse(`Fee for message: ${JSON.stringify(fee, null, 2)}`);
      } catch (error) {
        return createErrorResponse(`Error getting fee for message: ${error instanceof Error ? error.message : String(error)}`);
      }
    }
  • Input schema definition for the tool, specifying base64 message and optional commitment level.
    {
      name: 'helius_get_fee_for_message',
      description: 'Get the fee for a serialized message',
      inputSchema: {
        type: 'object',
        properties: {
          message: { type: 'string', description: 'Base64 encoded message string' },
          commitment: { type: 'string', enum: ['confirmed', 'finalized', 'processed'] }
        },
        required: ['message']
      }
    },
  • src/tools.ts:589-589 (registration)
    Maps the tool name 'helius_get_fee_for_message' to its handler function in the handlers dictionary.
    "helius_get_fee_for_message": getFeeForMessageHandler,
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden. It states 'Get the fee' which implies a read-only operation, but doesn't disclose behavioral traits such as whether it requires authentication, rate limits, error conditions, or what the return format looks like. For a tool with no annotation coverage, this leaves significant gaps in understanding its behavior.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence with zero waste. It's front-loaded and appropriately sized for the tool's apparent simplicity, making it easy to parse quickly.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given no annotations, no output schema, and partial schema coverage, the description is incomplete. It doesn't address key contextual aspects like return values, error handling, or integration with sibling tools. For a tool that likely interacts with blockchain fees, more detail on behavior and usage is needed to be fully helpful.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 50%, with one parameter ('message') documented as 'Base64 encoded message string' and the other ('commitment') having an enum but no description. The description adds no additional meaning beyond the schema, such as explaining what a 'serialized message' entails or how the commitment affects the fee. Baseline is 3 since the schema provides partial coverage, but the description doesn't compensate for the gaps.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb 'Get' and the resource 'fee for a serialized message', making the purpose understandable. However, it doesn't differentiate from sibling tools like 'helius_get_priority_fee_estimate' or 'helius_get_transaction' which might also involve fees or messages, leaving room for ambiguity in a crowded namespace.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance is provided on when to use this tool versus alternatives. With many sibling tools related to fees, transactions, and assets, the description lacks context on prerequisites, typical use cases, or comparisons to tools like 'helius_get_priority_fee_estimate' for fee estimation or 'helius_get_transaction' for transaction details.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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