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}"

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