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,
Behavior1/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description must fully disclose behavioral traits. It only states the action without any details on permissions, rate limits, response format, or potential side effects. For a tool that likely queries blockchain data, this omission is significant, as it doesn't inform the agent about network dependencies or error handling.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, direct sentence with no wasted words, making it highly concise and front-loaded. Every word contributes to stating the tool's purpose efficiently, which is ideal for brevity.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the lack of annotations and output schema, the description is incomplete for a tool that likely returns numeric or structured data. It doesn't cover what the supply value represents, units, or how to interpret results, leaving critical gaps for an AI agent to use the tool effectively in context with its siblings.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has 1 parameter with 0% description coverage, so the description must compensate. It mentions 'token' but doesn't explain what 'tokenAddress' represents (e.g., a Solana token mint address), its format, or validation rules. This adds minimal semantic value beyond the schema, failing to adequately address the coverage gap.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb 'Get' and the resource 'supply of a token', making the purpose understandable. It distinguishes itself from siblings like 'helius_get_balance' or 'helius_get_token_account_balance' by focusing specifically on token supply. However, it lacks specificity about what type of token supply (e.g., total, circulating) or context, preventing a perfect score.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance is provided on when to use this tool versus alternatives. With many sibling tools for querying token-related data (e.g., 'helius_get_token_account_balance', 'helius_get_token_largest_accounts'), the description fails to specify scenarios where token supply is needed over other metrics, leaving usage ambiguous.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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