Skip to main content
Glama

get_token_supply

Retrieve the total supply of a Solana SPL token using its mint address to verify circulating tokens and monitor token economics.

Instructions

Get the total supply of a token

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
tokenMintYesToken mint address

Implementation Reference

  • Core handler function that implements the get_token_supply tool logic. Ensures connection, fetches mint account data using Solana's getMint RPC call, computes human-readable supply, 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 }; }
  • Input schema definition for the get_token_supply tool, specifying that it requires a 'tokenMint' string parameter.
    inputSchema: { type: "object", properties: { tokenMint: { type: "string", description: "Token mint address" } }, required: ["tokenMint"] }
  • src/index.ts:444-457 (registration)
    Registration of the get_token_supply tool in the MCP tools array, including name, description, and input schema.
    { 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"] } },
  • Dispatch logic in the main CallToolRequestSchema handler that routes 'get_token_supply' calls to the specific handler function.
    case "get_token_supply": result = await handleGetTokenSupply(args); break;

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/ExpertVagabond/solana-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server