Skip to main content
Glama
buildwithgrove

Grove's MCP Server for Pocket Network

get_solana_fee_for_message

Calculate Solana transaction fees for base64-encoded messages on mainnet or testnet networks to estimate costs before execution.

Instructions

Estimate fee for a serialized Solana message (base64)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
messageYesSerialized message in base64
networkNoNetwork type (defaults to mainnet)

Implementation Reference

  • Tool registration definition including name, description, and input schema for 'get_solana_fee_for_message'
    {
      name: 'get_solana_fee_for_message',
      description: 'Estimate fee for a serialized Solana message (base64)',
      inputSchema: {
        type: 'object',
        properties: {
          message: {
            type: 'string',
            description: 'Serialized message in base64',
          },
          network: {
            type: 'string',
            enum: ['mainnet', 'testnet'],
            description: 'Network type (defaults to mainnet)',
          },
        },
        required: ['message'],
      },
    },
  • Dispatcher handler case in handleSolanaTool function that calls SolanaService.getFeeForMessage with parsed arguments
    case 'get_solana_fee_for_message': {
      const message = args?.message as string;
      const network = (args?.network as 'mainnet' | 'testnet') || 'mainnet';
    
      const result = await solanaService.getFeeForMessage(message, network);
    
      return {
        content: [
          {
            type: 'text',
            text: JSON.stringify(result, null, 2),
          },
        ],
        isError: !result.success,
      };
    }
  • Core implementation in SolanaService.getFeeForMessage that retrieves Solana RPC service and calls getFeeForMessage RPC method
    async getFeeForMessage(
      message: string,
      network: 'mainnet' | 'testnet' = 'mainnet'
    ): Promise<EndpointResponse> {
      const service = this.blockchainService.getServiceByBlockchain('solana', network);
    
      if (!service) {
        return {
          success: false,
          error: `Solana service not found for ${network}`,
        };
      }
    
      return this.blockchainService.callRPCMethod(
        service.id,
        'getFeeForMessage',
        [message]
      );
    }

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/buildwithgrove/mcp-pocket'

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