get_network_info
Retrieve current Solana blockchain network details including status, version, and active endpoints for monitoring and connection management.
Instructions
Get current network information
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/index.ts:820-833 (handler)The handler function that implements the core logic for the 'get_network_info' tool. It ensures the connection is initialized, fetches the Solana network version and epoch information, and returns details about the current network including RPC URL, version, epoch, slot index, and slots per epoch.async function handleGetNetworkInfo() { ensureConnection(); const version = await connection.getVersion(); const epochInfo = await connection.getEpochInfo(); return { network: currentNetwork, rpcUrl: NETWORKS[currentNetwork as keyof typeof NETWORKS], version: version["solana-core"], epoch: epochInfo.epoch, slotIndex: epochInfo.slotIndex, slotsInEpoch: epochInfo.slotsInEpoch }; }
- src/index.ts:263-270 (schema)The schema definition for the 'get_network_info' tool, specifying its name, description, and empty input schema (no parameters required). This is part of the tools array returned by ListToolsRequest.{ name: "get_network_info", description: "Get current network information", inputSchema: { type: "object", properties: {} } },
- src/index.ts:1321-1323 (registration)The registration/dispatch case in the main tool switch statement within the CallToolRequestSchema handler, which routes calls to 'get_network_info' to the handleGetNetworkInfo function.case "get_network_info": result = await handleGetNetworkInfo(); break;
- src/index.ts:1273-1275 (registration)The registration of the ListToolsRequest handler, which returns the full tools array including the 'get_network_info' tool definition.server.setRequestHandler(ListToolsRequestSchema, async () => { return { tools }; });