Skip to main content
Glama
Zetrix-Chain

Zetrix MCP Server

Official
by Zetrix-Chain

zetrix_get_latest_block

Retrieve current block data from the Zetrix blockchain to monitor network status and access transaction information.

Instructions

Get the latest block information from Zetrix blockchain

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Core handler implementation: Queries Zetrix RPC /getLedger endpoint (without seq param) to fetch latest block data, processes response into ZetrixBlock interface.
    async getLatestBlock(): Promise<ZetrixBlock> {
      try {
        // Get latest ledger without seq parameter
        const response = await this.client.get("/getLedger");
    
        if (response.data.error_code !== 0) {
          throw new Error(
            response.data.error_desc || `API Error: ${response.data.error_code}`
          );
        }
    
        const block = response.data.result.header;
        return {
          blockNumber: block.seq,
          closeTime: block.close_time || 0,
          hash: block.hash || "",
          prevHash: block.previous_hash || "",
          txCount: block.tx_count || 0,
          transactions: response.data.result.transactions,
        };
      } catch (error) {
        if (axios.isAxiosError(error)) {
          throw new Error(`Failed to get latest block: ${error.message}`);
        }
        throw error;
      }
    }
  • MCP server tool handler: switch case that invokes ZetrixClient.getLatestBlock() and formats response for MCP protocol.
    case "zetrix_get_latest_block": {
      const result = await zetrixClient.getLatestBlock();
      return {
        content: [
          {
            type: "text",
            text: JSON.stringify(result, null, 2),
          },
        ],
      };
    }
  • Tool schema definition and registration in tools[] array used by MCP ListToolsRequestHandler.
    {
      name: "zetrix_get_latest_block",
      description: "Get the latest block information from Zetrix blockchain",
      inputSchema: {
        type: "object",
        properties: {},
      },
    },
  • TypeScript interface defining the return type structure for block data.
    export interface ZetrixBlock {
      blockNumber: number;
      closeTime: number;
      hash: string;
      prevHash: string;
      txCount: number;
      transactions?: any[];
    }
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries full burden. It states it 'gets' information, implying a read-only operation, but doesn't disclose behavioral traits like rate limits, authentication requirements, network dependencies, or what specific information is returned (e.g., block number, timestamp, transactions). For a blockchain query tool, this leaves significant gaps in understanding its behavior.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, clear sentence that efficiently conveys the core purpose without any fluff. It's front-loaded with the main action and resource, making it easy to parse quickly. Every word earns its place, achieving optimal conciseness.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's simplicity (0 parameters) but lack of annotations and output schema, the description is incomplete. It doesn't explain what 'block information' includes (e.g., fields returned), potential errors, or dependencies. For a blockchain tool where output details matter, this leaves the agent with insufficient context to use it effectively.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The tool has 0 parameters, and schema description coverage is 100% (empty schema). The description doesn't need to explain parameters, so it appropriately avoids redundant information. A baseline of 4 is applied since no parameters exist, and the description doesn't add unnecessary details.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('Get') and resource ('latest block information from Zetrix blockchain'), making the purpose immediately understandable. However, it doesn't explicitly differentiate from sibling tools like 'zetrix_get_block' (which likely retrieves a specific block), leaving some ambiguity about when to choose this tool over that one.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. With sibling tools like 'zetrix_get_block' (for specific blocks) and 'zetrix_get_ledger' (possibly for broader ledger data), there's no indication of when this tool is preferred or what distinguishes it from similar queries.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

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/Zetrix-Chain/zetrix-mcp-server'

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