Skip to main content
Glama
tywenk

Model Context Protocol Server for Solana Client

by tywenk

get_recent_performance_samples

Retrieve recent Solana blockchain performance samples in reverse slot order, with a customizable limit up to 720 samples. Useful for monitoring and analyzing network performance.

Instructions

Returns a list of recent performance samples, in reverse slot order.

Args: limit (Optional[int], optional): Number of samples to return (maximum 720). Defaults to None.

Returns: str: Performance samples in the format "Performance samples: {samples}"

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitNo

Implementation Reference

  • The handler function decorated with @mcp.tool(), which registers and implements the get_recent_performance_samples tool. It queries the Solana RPC for recent performance samples using the provided limit and returns a formatted string response.
    @mcp.tool()
    async def get_recent_performance_samples(limit: Optional[int] = None) -> str:
        """Returns a list of recent performance samples, in reverse slot order.
    
        Args:
            limit (Optional[int], optional): Number of samples to return (maximum 720). Defaults to None.
    
        Returns:
            str: Performance samples in the format "Performance samples: {samples}"
        """
        async with AsyncClient(rpc_url) as client:
            samples = await client.get_recent_performance_samples(limit)
            return f"Performance samples: {samples}"
  • src/server.py:243-243 (registration)
    The @mcp.tool() decorator registers the get_recent_performance_samples function as an MCP tool.
    @mcp.tool()
  • Input schema defined by type hint 'limit: Optional[int] = None' and output '-> str'. Docstring provides detailed description and constraints.
    async def get_recent_performance_samples(limit: Optional[int] = None) -> str:
        """Returns a list of recent performance samples, in reverse slot order.
    
        Args:
            limit (Optional[int], optional): Number of samples to return (maximum 720). Defaults to None.
    
        Returns:
            str: Performance samples in the format "Performance samples: {samples}"
        """
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. It mentions the return format ('Performance samples: {samples}') and ordering ('reverse slot order'), which adds some behavioral context. However, it lacks critical details: whether this is a read-only operation, potential rate limits, authentication needs, or what 'performance samples' represent (e.g., metrics, timestamps). For a tool with no annotations, this is insufficient.

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 concise. It starts with the core purpose, then details the parameter and return format in separate sections. Every sentence adds value: the first defines the tool, the second explains the parameter, and the third specifies the return format. No wasted words.

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 (performance data retrieval), lack of annotations, and no output schema, the description is incomplete. It doesn't explain what 'performance samples' are, their structure, or how they relate to blockchain concepts (e.g., slots). Without this context, an agent may struggle to use the tool effectively or interpret results.

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?

The description adds meaningful semantics beyond the schema. The schema has 0% description coverage and only shows 'limit' as an optional integer. The description clarifies that 'limit' is 'Number of samples to return (maximum 720)', specifying the purpose and constraint. With 1 parameter and low schema coverage, this adequately compensates.

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 a list of recent performance samples, in reverse slot order.' It specifies the verb ('returns'), resource ('performance samples'), and ordering ('reverse slot order'), which distinguishes it from generic 'get' tools. However, it doesn't explicitly differentiate from sibling tools like 'get_block' or 'get_slot', which also retrieve blockchain data.

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 what 'performance samples' are, their use cases, or how this tool differs from other data retrieval tools in the sibling list (e.g., 'get_block', 'get_transaction'). This leaves the agent without context for tool selection.

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