helius_get_token_supply
Retrieve the total circulating supply of any Solana token by providing its address. Use this tool to verify token availability and monitor distribution metrics on the blockchain.
Instructions
Get the supply of a token
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| tokenAddress | Yes |
Implementation Reference
- src/handlers/helius.ts:96-113 (handler)The main handler function that implements the logic for fetching token supply using Helius SDK and Solana RPC.export const getTokenSupplyHandler = async (input: GetTokenSupplyInput): Promise<ToolResultSchema> => { const tokenAddressResult = validatePublicKey(input.tokenAddress); if (!(tokenAddressResult instanceof PublicKey)) { return tokenAddressResult; } try { const tokenSupply = await (helius as any as Helius).connection.getTokenSupply(tokenAddressResult); if (!tokenSupply) { return createErrorResponse(`Token supply not found for address: ${tokenAddressResult.toString()}`); } return createSuccessResponse(`Token supply: Value: ${tokenSupply.value} Context Slot: ${tokenSupply.context.slot} `); } catch (error) { return createErrorResponse(`Error getting token supply: ${error instanceof Error ? error.message : String(error)}`); } }
- src/tools.ts:68-78 (schema)Defines the input schema and metadata for the 'helius_get_token_supply' tool.{ name: "helius_get_token_supply", description: "Get the supply of a token", inputSchema: { type: "object", properties: { tokenAddress: { type: "string" } }, required: ["tokenAddress"] } },
- src/tools.ts:553-553 (registration)Registers the tool name to its handler function in the handlers dictionary."helius_get_token_supply": getTokenSupplyHandler,
- src/tools.ts:7-30 (registration)Imports the getTokenSupplyHandler from handlers/helius.tsgetTokenSupplyHandler, getTokenLargestAccountsHandler, getLatestBlockhashHandler, getTokenAccountBalanceHandler, getSlotHandler, getTransactionHandler, getAccountInfoHandler, getProgramAccountsHandler, getSignaturesForAddressHandler, getMinimumBalanceForRentExemptionHandler, getMultipleAccountsHandler, getInflationRewardHandler, getEpochInfoHandler, getEpochScheduleHandler, getLeaderScheduleHandler, getRecentPerformanceSamplesHandler, getVersionHandler, getPriorityFeeEstimateHandler, pollTransactionConfirmationHandler, sendJitoBundleHandler, getBundleStatusesHandler, getFeeForMessageHandler, executeJupiterSwapHandler } from "./handlers/helius.js";
- src/handlers/helius.ts:5-5 (schema)Imports the TypeScript type for the input, used for type safety in the handler.GetTokenSupplyInput,