Skip to main content
Glama
buildwithgrove

Grove's MCP Server for Pocket Network

get_sui_reference_gas_price

Retrieve the reference gas price for Sui blockchain transactions to estimate network fees. Specify network (mainnet/testnet) for accurate cost calculations.

Instructions

Get reference gas price for Sui transactions

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
networkNoNetwork type (defaults to mainnet)

Implementation Reference

  • Tool registration including name, description, and input schema for get_sui_reference_gas_price
    {
      name: 'get_sui_reference_gas_price',
      description: 'Get reference gas price for Sui transactions',
      inputSchema: {
        type: 'object',
        properties: {
          network: {
            type: 'string',
            enum: ['mainnet', 'testnet'],
            description: 'Network type (defaults to mainnet)',
          },
        },
      },
    },
  • Handler logic for executing the get_sui_reference_gas_price tool, extracts network param, calls SuiService, and formats response
    case 'get_sui_reference_gas_price': {
      const network = (args?.network as 'mainnet' | 'testnet') || 'mainnet';
    
      const result = await suiService.getReferenceGasPrice(network);
    
      return {
        content: [
          {
            type: 'text',
            text: JSON.stringify(result, null, 2),
          },
        ],
        isError: !result.success,
      };
    }
  • Core implementation in SuiService that performs the RPC call to suix_getReferenceGasPrice via blockchainService
    async getReferenceGasPrice(
      network: 'mainnet' | 'testnet' = 'mainnet'
    ): Promise<EndpointResponse> {
      const service = this.blockchainService.getServiceByBlockchain('sui', network);
    
      if (!service) {
        return {
          success: false,
          error: `Sui service not found for ${network}`,
        };
      }
    
      return this.blockchainService.callRPCMethod(service.id, 'suix_getReferenceGasPrice', []);
    }

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