get_token_largest_accounts
Retrieve the 20 largest accounts for a specified SPL Token on Solana. Input the token mint address to analyze token distribution and identify top holders.
Instructions
Returns the 20 largest accounts of a particular SPL Token type.
Args: mint (str): Pubkey of token mint to query
Returns: str: Largest token accounts in the format "Largest token accounts: {accounts}"
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| mint | Yes |
Implementation Reference
- src/server.py:327-327 (registration)Registration of the tool using @mcp.tool() decorator.@mcp.tool()
- src/server.py:328-339 (handler)The main handler function that implements the logic for the get_token_largest_accounts tool. It takes a mint pubkey as string input, uses AsyncClient to call get_token_largest_accounts on the Solana RPC, and returns a formatted string with the results.async def get_token_largest_accounts(mint: str) -> str: """Returns the 20 largest accounts of a particular SPL Token type. Args: mint (str): Pubkey of token mint to query Returns: str: Largest token accounts in the format "Largest token accounts: {accounts}" """ async with AsyncClient(rpc_url) as client: accounts = await client.get_token_largest_accounts(Pubkey.from_string(mint)) return f"Largest token accounts: {accounts}"
- src/server.py:328-339 (schema)Input schema: mint (str). Output: str (formatted largest accounts info). Defined via type hints and docstring.async def get_token_largest_accounts(mint: str) -> str: """Returns the 20 largest accounts of a particular SPL Token type. Args: mint (str): Pubkey of token mint to query Returns: str: Largest token accounts in the format "Largest token accounts: {accounts}" """ async with AsyncClient(rpc_url) as client: accounts = await client.get_token_largest_accounts(Pubkey.from_string(mint)) return f"Largest token accounts: {accounts}"