get_token_supply
Retrieve the total circulating supply of any SPL token on the Solana blockchain by providing its mint address. Use this tool to verify token availability and track distribution metrics.
Instructions
Get the total supply of a token
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| tokenMint | Yes | Token mint address |
Implementation Reference
- src/index.ts:1123-1141 (handler)The handler function that implements get_token_supply: fetches mint info using getMint, computes human-readable supply by dividing raw supply by 10^decimals, and returns detailed mint information.async function handleGetTokenSupply(args: any) { const { tokenMint } = args; ensureConnection(); const tokenMintPubkey = new PublicKey(tokenMint); const mintInfo = await getMint(connection, tokenMintPubkey); const supply = Number(mintInfo.supply) / Math.pow(10, mintInfo.decimals); return { tokenMint, supply, rawSupply: mintInfo.supply.toString(), decimals: mintInfo.decimals, mintAuthority: mintInfo.mintAuthority ? mintInfo.mintAuthority.toString() : null, freezeAuthority: mintInfo.freezeAuthority ? mintInfo.freezeAuthority.toString() : null, isInitialized: mintInfo.isInitialized }; }
- src/index.ts:444-457 (schema)Tool definition including name, description, and input schema requiring 'tokenMint' string.{ name: "get_token_supply", description: "Get the total supply of a token", inputSchema: { type: "object", properties: { tokenMint: { type: "string", description: "Token mint address" } }, required: ["tokenMint"] } },
- src/index.ts:1348-1350 (registration)Switch case in the main CallToolRequestSchema handler that dispatches to the get_token_supply handler function.case "get_token_supply": result = await handleGetTokenSupply(args); break;