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

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