helius_get_recent_performance_samples
Retrieve recent performance samples from the Solana blockchain to analyze network throughput and validator efficiency.
Instructions
Get recent performance samples
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "helius_get_recent_performance_samples"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No |
Implementation Reference
- src/handlers/helius.ts:301-308 (handler)Handler function that calls connection.getRecentPerformanceSamples(input.limit) and returns the result as a JSON string.
export const getRecentPerformanceSamplesHandler = async (input: GetRecentPerformanceSamplesInput): Promise<ToolResultSchema> => { try { const samples = await (helius as any as Helius).connection.getRecentPerformanceSamples(input.limit); return createSuccessResponse(`Recent performance samples: ${JSON.stringify(samples, null, 2)}`); } catch (error) { return createErrorResponse(`Error getting performance samples: ${error instanceof Error ? error.message : String(error)}`); } } - src/handlers/helius.types.ts:143-145 (schema)Input type definition for GetRecentPerformanceSamples, with an optional limit property.
export type GetRecentPerformanceSamplesInput = { limit?: number; } - src/tools.ts:254-264 (registration)Tool registration in the tools array: name, description, and inputSchema with optional limit.
{ name: "helius_get_recent_performance_samples", description: "Get recent performance samples", inputSchema: { type: "object", properties: { limit: { type: "number" } }, required: [] } }, - src/tools.ts:569-569 (registration)Handler mapping in the handlers dictionary connecting the tool name to getRecentPerformanceSamplesHandler.
"helius_get_recent_performance_samples": getRecentPerformanceSamplesHandler, - src/handlers/helius.ts:32-35 (helper)Import of GetRecentPerformanceSamplesInput from helius.types.ts, used by the handler.
} from "./helius.types.js"; import { PublicKey, Commitment, VersionedMessage, LAMPORTS_PER_SOL } from "@solana/web3.js"; import { ToolResultSchema } from "../types.js"; import { createErrorResponse, createSuccessResponse, validatePublicKey } from "./utils.js";