Skip to main content
Glama
tywenk

Model Context Protocol Server for Solana Client

by tywenk

get_multiple_accounts

Retrieve account information for multiple Solana public keys in a single request. Specify encoding to decode account data efficiently.

Instructions

Returns the account information for a list of public keys.

Args: pubkeys (list[str]): List of account public keys encoding (str): Encoding for the account data

Returns: str: Multiple accounts information

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
encodingNobase64
pubkeysYes

Implementation Reference

  • The main handler function for the 'get_multiple_accounts' MCP tool. It is registered via the @mcp.tool() decorator. The function signature provides the input schema (pubkeys: list[str], encoding: str = 'base64'), fetches account data from Solana RPC for multiple pubkeys, and returns formatted account information.
    @mcp.tool()
    async def get_multiple_accounts(pubkeys: list[str], encoding: str = "base64") -> str:
        """Returns the account information for a list of public keys.
    
        Args:
            pubkeys (list[str]): List of account public keys
            encoding (str): Encoding for the account data
    
        Returns:
            str: Multiple accounts information
        """
        async with AsyncClient(rpc_url) as client:
            pks = [Pubkey.from_string(pk) for pk in pubkeys]
            accounts = await client.get_multiple_accounts(pks, encoding=encoding)
            return f"Multiple accounts info: {accounts}"
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 it 'returns' information, implying a read-only operation, but doesn't clarify authentication needs, rate limits, error conditions, or what 'account information' entails (e.g., data format, completeness). For a tool with no annotation coverage, this leaves significant gaps in understanding its behavior.

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 well-structured and front-loaded with the core purpose, followed by Args and Returns sections. It uses minimal sentences efficiently, though the 'Returns: str: Multiple accounts information' is vague and could be more specific. There's no wasted text, making it appropriately concise for its complexity.

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 no annotations, 0% schema coverage, and no output schema, the description is incomplete. It lacks details on behavioral traits (e.g., read-only nature, potential errors), parameter constraints, and the structure of returned data. For a tool with 2 parameters and significant context gaps, it should provide more guidance to ensure correct agent usage.

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

Parameters3/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 descriptions. The description adds basic semantics: 'pubkeys (list[str]): List of account public keys' and 'encoding (str): Encoding for the account data.' This clarifies the purpose of both parameters, but doesn't detail encoding options (e.g., base64 vs. json) or pubkey format constraints. It partially compensates for the schema gap, earning a baseline score.

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: 'Returns the account information for a list of public keys.' It specifies the verb ('returns') and resource ('account information'), and distinguishes it from sibling tools like get_account_info (singular) and get_balance (balance-specific). However, it doesn't explicitly differentiate from other account-related tools like get_program_accounts or get_token_accounts_by_owner.

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 get_multiple_accounts over get_account_info (for single accounts) or other account retrieval tools, nor does it specify prerequisites or exclusions. The agent must infer usage from the name and parameters alone.

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