Skip to main content
Glama
pokt-network

Grove Public Endpoints MCP Server

Official
by pokt-network

get_solana_balance

Retrieve the SOL balance for any Solana address on mainnet or testnet networks using Grove's public blockchain endpoints.

Instructions

Get SOL balance for a Solana address

Input Schema

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

Implementation Reference

  • Defines the input schema, description, and registration of the get_solana_balance tool in the tools array returned by registerSolanaHandlers
    {
      name: 'get_solana_balance',
      description: 'Get SOL balance for a Solana address',
      inputSchema: {
        type: 'object',
        properties: {
          address: {
            type: 'string',
            description: 'Solana address',
          },
          network: {
            type: 'string',
            enum: ['mainnet', 'testnet'],
            description: 'Network type (defaults to mainnet)',
          },
        },
        required: ['address'],
      },
    },
  • Executes the get_solana_balance tool by parsing arguments, calling SolanaService.getBalance, and returning formatted JSON response
    case 'get_solana_balance': {
      const address = args?.address as string;
      const network = (args?.network as 'mainnet' | 'testnet') || 'mainnet';
    
      const result = await solanaService.getBalance(address, network);
    
      return {
        content: [
          {
            type: 'text',
            text: JSON.stringify(result, null, 2),
          },
        ],
        isError: !result.success,
      };
    }
  • Implements the getBalance logic: retrieves Solana RPC service, calls 'getBalance' RPC method, converts lamports to SOL, and returns structured response
    async getBalance(
      address: 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}`,
        };
      }
    
      const result = await this.blockchainService.callRPCMethod(
        service.id,
        'getBalance',
        [address]
      );
    
      if (result.success && result.data?.value !== undefined) {
        const lamports = result.data.value;
        const sol = lamports / 1e9; // 1 SOL = 1 billion lamports
    
        return {
          success: true,
          data: {
            address,
            lamports,
            sol,
          },
          metadata: result.metadata,
        };
      }
    
      return result;
    }
  • src/index.ts:88-101 (registration)
    Registers the Solana tools (including get_solana_balance schema) by including registerSolanaHandlers in the tools array provided to listTools handler
    const tools: Tool[] = [
      ...registerBlockchainHandlers(server, blockchainService),
      ...registerDomainHandlers(server, domainResolver),
      ...registerTransactionHandlers(server, advancedBlockchain),
      ...registerTokenHandlers(server, advancedBlockchain),
      ...registerMultichainHandlers(server, advancedBlockchain),
      ...registerContractHandlers(server, advancedBlockchain),
      ...registerUtilityHandlers(server, advancedBlockchain),
      ...registerEndpointHandlers(server, endpointManager),
      ...registerSolanaHandlers(server, solanaService),
      ...registerCosmosHandlers(server, cosmosService),
      ...registerSuiHandlers(server, suiService),
      ...registerDocsHandlers(server, docsManager),
    ];
  • Routes tool execution to the appropriate handler, including handleSolanaTool for get_solana_balance
    let result =
      (await handleBlockchainTool(name, args, blockchainService)) ||
      (await handleDomainTool(name, args, domainResolver)) ||
      (await handleTransactionTool(name, args, advancedBlockchain)) ||
      (await handleTokenTool(name, args, advancedBlockchain)) ||
      (await handleMultichainTool(name, args, advancedBlockchain)) ||
      (await handleContractTool(name, args, advancedBlockchain)) ||
      (await handleUtilityTool(name, args, advancedBlockchain)) ||
      (await handleEndpointTool(name, args, endpointManager)) ||
      (await handleSolanaTool(name, args, solanaService)) ||
      (await handleCosmosTool(name, args, cosmosService)) ||
      (await handleSuiTool(name, args, suiService)) ||
      (await handleDocsTool(name, args, docsManager));
Behavior2/5

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

No annotations are provided, so the description carries full burden. It states what the tool does but doesn't disclose behavioral traits like whether it's a read-only operation, potential rate limits, error conditions, authentication requirements, or what the return format looks like. For a financial query tool with zero annotation coverage, this is a significant gap.

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 that states exactly what the tool does with zero wasted words. It's appropriately sized for a simple query tool and front-loads the essential information immediately.

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

Completeness3/5

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

For a simple read operation with 2 parameters and 100% schema coverage, the description is minimally adequate. However, with no annotations and no output schema, the description should ideally provide more behavioral context about what the tool returns and any operational constraints. It's complete enough to understand what the tool does but lacks depth for optimal agent usage.

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 100%, so the schema already documents both parameters thoroughly. The description doesn't add any parameter semantics beyond what's in the schema - it mentions 'Solana address' which matches the schema's description, but provides no additional context about address format, validation, or the network parameter's implications.

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 resource ('SOL balance for a Solana address'), making the purpose immediately understandable. It distinguishes from siblings like 'get_solana_token_balance' by specifying SOL rather than tokens, but doesn't explicitly differentiate from 'get_historical_balance' or 'compare_balances' which might also involve balances.

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?

The description provides no guidance on when to use this tool versus alternatives. With many sibling tools involving balances (e.g., 'get_solana_token_balance', 'get_historical_balance', 'compare_balances'), there's no indication of when this specific SOL balance tool is preferred or what distinguishes it from other balance-related operations.

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/pokt-network/mcp'

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