Skip to main content
Glama
tywenk

Model Context Protocol Server for Solana Client

by tywenk

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
NameRequiredDescriptionDefault
delegateYes
mintYes

Implementation Reference

  • 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()

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/tywenk/mcp-sol'

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