helius_get_account_info
Retrieve Solana account details including balance and data for any wallet address using the Helius API.
Instructions
Get account information for a Solana address
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| publicKey | Yes | ||
| commitment | No |
Implementation Reference
- src/handlers/helius.ts:179-191 (handler)The main handler function that validates the input public key, fetches account information from the Helius RPC connection, and returns a formatted success or error response.export const getAccountInfoHandler = async (input: GetAccountInfoInput): Promise<ToolResultSchema> => { const publicKeyResult = validatePublicKey(input.publicKey); if (!(publicKeyResult instanceof PublicKey)) { return publicKeyResult; } try { const accountInfo = await (helius as any as Helius).connection.getAccountInfo(publicKeyResult, input.commitment); return createSuccessResponse(`Account info: ${JSON.stringify(accountInfo, null, 2)}`); } catch (error) { return createErrorResponse(`Error getting account info: ${error instanceof Error ? error.message : String(error)}`); } }
- src/tools.ts:138-149 (schema)The tool definition including name, description, and input schema for validating parameters: publicKey (required) and optional commitment.{ name: "helius_get_account_info", description: "Get account information for a Solana address", inputSchema: { type: "object", properties: { publicKey: { type: "string" }, commitment: { type: "string", enum: ["confirmed", "finalized", "processed"] } }, required: ["publicKey"] } },
- src/tools.ts:560-560 (registration)Registration of the tool name to its handler function in the handlers dictionary."helius_get_account_info": getAccountInfoHandler,