get_token_supply
Retrieve the total supply of an SPL Token by providing the mint public key on the Solana blockchain using the MCP server's tools.
Instructions
Returns the total supply of an SPL Token type.
Args: mint (str): Public key of token mint
Returns: str: Token supply information
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| mint | Yes |
Implementation Reference
- src/server.py:607-620 (handler)The handler function for the 'get_token_supply' tool. It is registered via the @mcp.tool() decorator and implements the logic to retrieve the total supply of an SPL token using the Solana RPC AsyncClient.@mcp.tool() async def get_token_supply(mint: str) -> str: """Returns the total supply of an SPL Token type. Args: mint (str): Public key of token mint Returns: str: Token supply information """ async with AsyncClient(rpc_url) as client: supply = await client.get_token_supply(Pubkey.from_string(mint)) return f"Token supply: {supply}"
- src/server.py:607-607 (registration)The @mcp.tool() decorator registers the get_token_supply function as an MCP tool.@mcp.tool()