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,

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