Skip to main content
Glama

helius_get_token_supply

Retrieve the supply details of a specific token on the Solana blockchain by providing its address. This tool is part of the MCP Helius server, which enables access to Solana blockchain data.

Instructions

Get the supply of a token

Input Schema

NameRequiredDescriptionDefault
tokenAddressYes

Input Schema (JSON Schema)

{ "properties": { "tokenAddress": { "type": "string" } }, "required": [ "tokenAddress" ], "type": "object" }

Implementation Reference

  • The main handler function implementing the logic for helius_get_token_supply tool by calling getTokenSupply on the Solana connection via Helius SDK.
    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)}`); } }
  • The input schema definition for the helius_get_token_supply tool, specifying the required tokenAddress parameter.
    { 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)
    Registration of the tool name to its handler function in the global handlers dictionary.
    "helius_get_token_supply": getTokenSupplyHandler,

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