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()
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states this is a read operation ('Returns'), but doesn't cover critical aspects like whether it requires authentication, rate limits, pagination behavior, error conditions, or what format the returned information is in. For a tool with zero annotation coverage, this leaves significant gaps in understanding how it behaves.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is appropriately sized and front-loaded with the main purpose in the first sentence. The Args and Returns sections are structured clearly, though the return description ('Token accounts information') is vague. There's no wasted text, making it efficient overall.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the complexity of a blockchain tool with 2 parameters, no annotations, and no output schema, the description is incomplete. It lacks details on return format, error handling, authentication needs, and how it differs from sibling tools. For a tool in this context, more comprehensive information is needed to guide effective use.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the schema provides no parameter documentation. The description adds minimal value by listing the parameters ('delegate' and 'mint') with brief explanations, but these are basic and don't clarify format (e.g., public key encoding), constraints, or examples. It doesn't compensate adequately for the lack of schema coverage.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose with a specific verb ('Returns') and resource ('all SPL Token accounts by approved delegate'). It distinguishes itself from siblings like 'get_token_accounts_by_owner' by specifying the delegate-based filtering. However, it doesn't explicitly mention what makes it unique beyond the name, slightly reducing clarity.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention when to prefer it over similar tools like 'get_token_accounts_by_owner' or 'get_token_account_balance', nor does it specify prerequisites or exclusions. Usage is implied by the purpose but not explicitly stated.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Related Tools

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