Skip to main content
Glama

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
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • 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 }; }
  • 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 }; });

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/ExpertVagabond/solana-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server