Skip to main content
Glama
buildwithgrove

Grove's MCP Server for Pocket Network

get_solana_balance

Retrieve SOL token balance for any Solana address on mainnet or testnet networks using Grove's blockchain data access.

Instructions

Get SOL balance for a Solana address

Input Schema

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

Implementation Reference

  • Handler execution logic for the 'get_solana_balance' tool within the handleSolanaTool switch statement, which extracts input parameters, calls SolanaService.getBalance, and formats the 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,
      };
    }
  • Tool registration definition for 'get_solana_balance', returned by registerSolanaHandlers and included in the server's tools list.
    {
      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'],
      },
    },
  • Core implementation in SolanaService.getBalance: retrieves Solana RPC service, calls 'getBalance' RPC method, converts lamports to SOL, and returns formatted 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;
    }
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It states what the tool does but doesn't describe behavioral traits like rate limits, error conditions, response format, or whether it's a read-only operation. The description is minimal and lacks context about what the tool returns or how it behaves.

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 extremely concise with a single sentence that directly states the tool's purpose. There's zero wasted language, and it's front-loaded with the essential information. Every word earns its place in this minimal description.

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 and no output schema, the description is insufficiently complete. For a blockchain balance query tool, users need to know what format the balance is returned in (e.g., lamports vs SOL), error conditions for invalid addresses, and whether the tool supports specific network configurations beyond what's in the schema.

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?

The schema description coverage is 100%, so the schema already documents both parameters thoroughly. The description doesn't add any additional meaning beyond what's in the schema - it doesn't explain parameter relationships, constraints, or usage examples. Baseline 3 is appropriate when the schema does the heavy lifting.

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 tool's purpose: 'Get SOL balance for a Solana address' specifies the verb ('Get'), resource ('SOL balance'), and target ('Solana address'). It distinguishes from siblings like 'get_solana_account_info' or 'get_solana_token_balance' by focusing specifically on native SOL balance, though it doesn't explicitly mention this distinction.

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. It doesn't mention sibling tools like 'get_solana_token_balance' for token balances or 'get_historical_balance' for historical data, nor does it specify prerequisites or use cases beyond the basic functionality.

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

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