Skip to main content
Glama

helius_get_multiple_accounts

Retrieve detailed information for multiple Solana accounts simultaneously, including balances and transaction data, using the Helius API.

Instructions

Get information about multiple Solana accounts

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
publicKeysYes
commitmentNo

Implementation Reference

  • The main handler function that validates input public keys, fetches multiple account information via Helius RPC connection.getMultipleAccountsInfo, and returns success or error response.
    export const getMultipleAccountsHandler = async (input: GetMultipleAccountsInput): Promise<ToolResultSchema> => {
      try {
        const publicKeys = [];
        for (const pk of input.publicKeys) {
          const result = validatePublicKey(pk);
          if (!(result instanceof PublicKey)) {
            return result; // Return the error response if any public key is invalid
          }
          publicKeys.push(result);
        }
        
        const accounts = await (helius as any as Helius).connection.getMultipleAccountsInfo(publicKeys, input.commitment);
        return createSuccessResponse(`Multiple accounts: ${JSON.stringify(accounts, null, 2)}`);
      } catch (error) {
        return createErrorResponse(`Error getting multiple accounts: ${error instanceof Error ? error.message : String(error)}`);
      }
    }
  • JSON Schema defining the input for the tool: array of publicKeys (required) and optional commitment level.
    {
      name: "helius_get_multiple_accounts",
      description: "Get information about multiple Solana accounts",
      inputSchema: {
        type: "object",
        properties: {
          publicKeys: { 
            type: "array",
            items: { type: "string" }
          },
          commitment: { type: "string", enum: ["confirmed", "finalized", "processed"] }
        },
        required: ["publicKeys"]
      }
  • src/tools.ts:564-564 (registration)
    Maps the tool name 'helius_get_multiple_accounts' to its handler function in the central handlers dictionary.
    "helius_get_multiple_accounts": getMultipleAccountsHandler,
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure but offers minimal information. It doesn't specify what type of 'information' is returned (balance, metadata, program data?), whether there are rate limits, authentication requirements, or error conditions. The description states a read operation but provides no behavioral context beyond the basic action.

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, clear sentence that efficiently communicates the core functionality. There's no wasted language or unnecessary elaboration. It's appropriately sized for a tool with two parameters and straightforward purpose.

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?

For a tool with 2 parameters (one with enum values), no annotations, and no output schema, the description is insufficient. It doesn't explain what information is returned, how the commitment parameter affects results, or provide any context about the Solana-specific behavior. The agent would need to guess about return format and operational details.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

With 0% schema description coverage, the schema provides no parameter documentation. The description mentions 'multiple Solana accounts' which hints at the publicKeys parameter, but doesn't explain the commitment parameter at all. The description adds minimal value beyond what's inferable from parameter names, failing to compensate for the schema coverage gap.

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 action ('Get information') and target resource ('multiple Solana accounts'), making the purpose immediately understandable. However, it doesn't differentiate from sibling tools like 'helius_get_account_info' (singular) or 'helius_get_program_accounts' (program-specific), leaving some ambiguity about when to choose this specific multi-account tool.

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 that also retrieve account information (helius_get_account_info, helius_get_assets_by_owner, helius_get_token_accounts, etc.), there's no indication whether this is for general account data, specific account types, or batch operations. The agent must infer usage from the 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/dcSpark/mcp-server-helius'

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