Skip to main content
Glama
buildwithgrove

Grove's MCP Server for Pocket Network

get_solana_program_accounts

Retrieve accounts owned by a Solana program using program ID with optional filters for data size or memory comparison. Access blockchain data through Grove's MCP Server for Pocket Network.

Instructions

Get accounts owned by a Solana program with optional filters

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
programIdYesProgram ID (public key)
filtersNoOptional RPC filters (memcmp, dataSize, etc.)
networkNoNetwork type (defaults to mainnet)

Implementation Reference

  • Tool definition and schema registration in the array returned by registerSolanaHandlers
    {
      name: 'get_solana_program_accounts',
      description: 'Get accounts owned by a Solana program with optional filters',
      inputSchema: {
        type: 'object',
        properties: {
          programId: {
            type: 'string',
            description: 'Program ID (public key)',
          },
          filters: {
            type: 'array',
            description: 'Optional RPC filters (memcmp, dataSize, etc.)',
            items: { type: 'object' },
          },
          network: {
            type: 'string',
            enum: ['mainnet', 'testnet'],
            description: 'Network type (defaults to mainnet)',
          },
        },
        required: ['programId'],
      },
    },
  • Execution handler in handleSolanaTool function that processes tool arguments and calls SolanaService
    case 'get_solana_program_accounts': {
      const programId = args?.programId as string;
      const filters = args?.filters as any[] | undefined;
      const network = (args?.network as 'mainnet' | 'testnet') || 'mainnet';
    
      const result = await solanaService.getProgramAccounts(programId, filters, network);
    
      return {
        content: [
          {
            type: 'text',
            text: JSON.stringify(result, null, 2),
          },
        ],
        isError: !result.success,
      };
    }
  • Core implementation of get_solana_program_accounts tool logic in SolanaService, preparing RPC parameters and calling the RPC method
    async getProgramAccounts(
      programId: string,
      filters?: any[],
      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 params: any = [
        programId,
        {
          encoding: 'jsonParsed',
        },
      ];
    
      if (filters && filters.length > 0) {
        params[1].filters = filters;
      }
    
      return this.blockchainService.callRPCMethod(service.id, 'getProgramAccounts', params);
    }
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It mentions 'optional filters' but doesn't explain what these filters entail (e.g., memcmp, dataSize), how they affect results, or any constraints like rate limits, permissions, or response format. For a read operation with no annotation coverage, this leaves significant gaps in understanding tool behavior.

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 front-loads the core purpose without unnecessary details. It avoids redundancy and wastes no words, making it easy to parse quickly.

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 the lack of annotations and output schema, the description is incomplete. It doesn't address behavioral aspects like what the return data looks like, error conditions, or network-specific nuances. For a tool with three parameters and no structured output information, more context is needed to guide effective use.

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 description adds minimal value beyond the input schema, which has 100% coverage. It mentions 'optional filters' but doesn't elaborate on their semantics or usage. Since the schema already documents all parameters thoroughly, the description meets the baseline but doesn't enhance parameter understanding significantly.

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 accounts owned by a Solana program with optional filters'. It specifies the verb ('Get'), resource ('accounts owned by a Solana program'), and scope ('with optional filters'). However, it doesn't explicitly differentiate from sibling tools like 'get_solana_account_info' or 'get_solana_balance', which reduces clarity in the broader context.

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 lacks context about prerequisites, exclusions, or comparisons to sibling tools such as 'get_solana_account_info' or 'get_solana_balance', leaving the agent to infer usage based on the tool name alone.

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