helius_get_account_info
Retrieve detailed account information for any Solana address using a specified commitment level. Enables blockchain data access for wallet balances, tokens, and NFTs via the Helius API and MCP Helius server.
Instructions
Get account information for a Solana address
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| commitment | No | ||
| publicKey | Yes |
Input Schema (JSON Schema)
{
"properties": {
"commitment": {
"enum": [
"confirmed",
"finalized",
"processed"
],
"type": "string"
},
"publicKey": {
"type": "string"
}
},
"required": [
"publicKey"
],
"type": "object"
}
Implementation Reference
- src/handlers/helius.ts:179-190 (handler)The main handler function that validates the public key and fetches account information using the Helius Solana connection.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:139-148 (schema)JSON schema definition for the tool, including name, description, and input validation schema.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/handlers/helius.types.ts:96-99 (schema)TypeScript type definition for the input parameters of the handler.export type GetAccountInfoInput = { publicKey: string; commitment?: "confirmed" | "finalized" | "processed"; }
- src/tools.ts:560-560 (registration)Registration of the tool name to its handler function in the handlers dictionary."helius_get_account_info": getAccountInfoHandler,