get_token_accounts_by_delegate
Retrieve all SPL Token accounts managed by a specific delegate, including details on associated mints, for accurate token delegation tracking on Solana.
Instructions
Returns all SPL Token accounts by approved delegate.
Args: delegate (str): Public key of delegate owner mint (str): Token mint address
Returns: str: Token accounts information
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| delegate | Yes | ||
| mint | Yes |
Implementation Reference
- src/server.py:571-586 (handler)The handler function decorated with @mcp.tool(), implementing the logic to fetch SPL token accounts by delegate using Solana RPC client.@mcp.tool() async def get_token_accounts_by_delegate(delegate: str, mint: str) -> str: """Returns all SPL Token accounts by approved delegate. Args: delegate (str): Public key of delegate owner mint (str): Token mint address Returns: str: Token accounts information """ async with AsyncClient(rpc_url) as client: accounts = await client.get_token_accounts_by_delegate( Pubkey.from_string(delegate), TokenAccountOpts(Pubkey.from_string(mint)) ) return f"Token accounts by delegate: {accounts}"
- src/server.py:571-571 (registration)The @mcp.tool() decorator registers the get_token_accounts_by_delegate function as an MCP tool.@mcp.tool()