Skip to main content
Glama
boray
by boray

get-network-state

Retrieve current Mina blockchain network state data for monitoring and analysis.

Instructions

Get the current state of the Mina network

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • src/index.ts:116-133 (registration)
    Registers the "get-network-state" MCP tool with no input parameters. The handler fetches network state via GraphQL client and returns it as JSON text.
    server.tool(
      "get-network-state",
      "Get the current state of the Mina network",
      {},
      async () => {
        try {
          const result = await minaClient.queryNetworkState();
          return {
            content: [{
              type: "text",
              text: JSON.stringify(result, null, 2)
            }]
          };
        } catch (error) {
          throw new Error(`Failed to get network state: ${error}`);
        }
      }
    );
  • The MCP tool handler function that executes the logic: queries network state and formats response.
    async () => {
      try {
        const result = await minaClient.queryNetworkState();
        return {
          content: [{
            type: "text",
            text: JSON.stringify(result, null, 2)
          }]
        };
      } catch (error) {
        throw new Error(`Failed to get network state: ${error}`);
      }
    }
  • Core implementation: performs GraphQL query to retrieve Mina network state (canonical and pending max block heights).
    async queryNetworkState(): Promise<{ networkState: NetworkStateOutput }> {
      const query = `
        query {
          networkState {
            maxBlockHeight {
              canonicalMaxBlockHeight
              pendingMaxBlockHeight
            }
          }
        }
      `;
    
      return this.client.request(query);
    }
  • TypeScript interface defining the structure of the network state output data.
    export interface NetworkStateOutput {
      maxBlockHeight: MaxBlockHeightInfo;
    }
  • TypeScript interface for max block height information used in network state.
    export interface MaxBlockHeightInfo {
      canonicalMaxBlockHeight: number;
      pendingMaxBlockHeight: number;
    }
Install Server

Other 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/boray/mcp-mina-archive-node'

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