Skip to main content
Glama

helius_get_multiple_accounts

Retrieve detailed information about multiple Solana accounts, including balances and token data, using a single API request. Simplify blockchain data management on the Solana network with streamlined account insights.

Instructions

Get information about multiple Solana accounts

Input Schema

NameRequiredDescriptionDefault
commitmentNo
publicKeysYes

Input Schema (JSON Schema)

{ "properties": { "commitment": { "enum": [ "confirmed", "finalized", "processed" ], "type": "string" }, "publicKeys": { "items": { "type": "string" }, "type": "array" } }, "required": [ "publicKeys" ], "type": "object" }

Implementation Reference

  • The handler function that validates the input publicKeys array, converts them to PublicKey objects, fetches multiple account information using the Helius connection's getMultipleAccountsInfo method, and returns a formatted success response or error.
    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)}`); } }
  • The input schema definition for the tool, specifying an 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)
    Registration of the handler function in the central handlers dictionary mapping tool names to their implementations.
    "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