Skip to main content
Glama
buildwithgrove

Grove's MCP Server for Pocket Network

get_sui_all_balances

Retrieve all coin balances for a Sui blockchain address to monitor assets across mainnet or testnet networks.

Instructions

Get all coin balances for a Sui address

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
addressYesSui address
networkNoNetwork type (defaults to mainnet)

Implementation Reference

  • Tool registration defining name, description, and input schema for get_sui_all_balances.
    {
      name: 'get_sui_all_balances',
      description: 'Get all coin balances for a Sui address',
      inputSchema: {
        type: 'object',
        properties: {
          address: {
            type: 'string',
            description: 'Sui address',
          },
          network: {
            type: 'string',
            enum: ['mainnet', 'testnet'],
            description: 'Network type (defaults to mainnet)',
          },
        },
        required: ['address'],
      },
    },
  • Executes the tool by calling suiService.getAllBalances and returning formatted JSON response.
    case 'get_sui_all_balances': {
      const address = args?.address as string;
      const network = (args?.network as 'mainnet' | 'testnet') || 'mainnet';
    
      const result = await suiService.getAllBalances(address, network);
    
      return {
        content: [
          {
            type: 'text',
            text: JSON.stringify(result, null, 2),
          },
        ],
        isError: !result.success,
      };
    }
  • Helper method implementing getAllBalances via RPC call to suix_getAllBalances.
    async getAllBalances(
      address: string,
      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_getAllBalances',
        [address]
      );
    }

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