Skip to main content
Glama
tywenk

Model Context Protocol Server for Solana Client

by tywenk

get_balance

Query the Solana blockchain to retrieve the balance of a specific account using its Pubkey. Provides the balance in a clear response format for easy integration and verification.

Instructions

Returns the balance of the account of provided Pubkey.

Args: address (str): Pubkey of account to query

Returns: str: Account balance response in the format "Balance of {address}: {balance}"

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
addressYes

Implementation Reference

  • The handler function for the 'get_balance' tool, decorated with @mcp.tool() which registers it in the MCP server. It queries the Solana RPC for the balance of the given address pubkey.
    @mcp.tool()
    async def get_balance(address: str) -> str:
        """Returns the balance of the account of provided Pubkey.
    
        Args:
            address (str): Pubkey of account to query
    
        Returns:
            str: Account balance response in the format "Balance of {address}: {balance}"
        """
        async with AsyncClient(rpc_url) as client:
            balance = await client.get_balance(Pubkey.from_string(address))
            return f"Balance of {address}: {balance}"
Behavior3/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It states the tool returns a balance, implying a read-only operation, but doesn't specify if it requires authentication, has rate limits, or details error conditions. The return format is described, which adds some context, but lacks information on network behavior or potential side effects.

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

Conciseness5/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 clear 'Args' and 'Returns' sections. Every sentence adds value: the first states what the tool does, the second explains the parameter, and the third specifies the return format. No redundant or verbose language is present.

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

Completeness3/5

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

Given no annotations and no output schema, the description provides basic completeness for a simple query tool. It covers the purpose, parameter meaning, and return format, but lacks details on error handling, network behavior, or performance considerations. For a balance-checking tool in a blockchain context, this is adequate but leaves gaps an agent might need to infer.

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

Parameters4/5

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

Schema description coverage is 0%, so the description must compensate. It explains the single parameter 'address' as 'Pubkey of account to query,' clarifying that it's a public key string for account identification. This adds meaningful semantics beyond the schema's generic 'Address' title and 'string' type, though it doesn't detail format constraints or examples.

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 balance of the account of provided Pubkey.' It specifies the verb ('returns') and resource ('balance'), distinguishing it from siblings like 'get_account_info' (which likely returns more comprehensive account data) or 'get_token_account_balance' (which focuses on token-specific balances). However, it doesn't explicitly contrast with these alternatives in the description text itself.

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 siblings like 'get_account_info' (which might include balance plus other info) or 'get_token_account_balance' (for token accounts), nor does it specify prerequisites or exclusions. The agent must infer usage from the purpose 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