Skip to main content
Glama

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
NameRequiredDescriptionDefault
tokenAddressYes

Implementation Reference

  • 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)}`); } }
  • 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.ts
    getTokenSupplyHandler, 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";
  • Imports the TypeScript type for the input, used for type safety in the handler.
    GetTokenSupplyInput,

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