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
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No |
Implementation Reference
- src/server.py:243-256 (handler)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()
- src/server.py:244-252 (schema)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}" """