Skip to main content
Glama
tywenk

Model Context Protocol Server for Solana Client

by tywenk

get_account_info

Retrieve detailed account information for a specified public key on the Solana blockchain, including data encoding options like base58, base64, or jsonParsed.

Instructions

Returns all account info for the specified public key.

Args: pubkey (str): Pubkey of account to query encoding (str): Encoding for Account data ("base58", "base64", or "jsonParsed")

Returns: str: Account information

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
encodingNobase64
pubkeyYes

Implementation Reference

  • The handler function decorated with @mcp.tool(), which registers and implements the get_account_info tool. It fetches account information from the Solana RPC endpoint using AsyncClient based on the provided pubkey and encoding.
    @mcp.tool() async def get_account_info(pubkey: str, encoding: str = "base64") -> str: """Returns all account info for the specified public key. Args: pubkey (str): Pubkey of account to query encoding (str): Encoding for Account data ("base58", "base64", or "jsonParsed") Returns: str: Account information """ async with AsyncClient(rpc_url) as client: info = await client.get_account_info( Pubkey.from_string(pubkey), encoding=encoding ) return f"Account info: {info}"

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