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
| Name | Required | Description | Default |
|---|---|---|---|
| tokenAddress | Yes |
Input Schema (JSON Schema)
{
"properties": {
"tokenAddress": {
"type": "string"
}
},
"required": [
"tokenAddress"
],
"type": "object"
}
Implementation Reference
- src/handlers/helius.ts:96-113 (handler)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)}`); } }
- src/tools.ts:68-77 (schema)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,