Skip to main content
Glama
Zetrix-Chain

Zetrix MCP Server

Official
by Zetrix-Chain

zetrix_get_ledger

Retrieve block or ledger information from the Zetrix blockchain with optional details including validator lists, consensus values, and fee configurations.

Instructions

Get block/ledger information with optional details

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
seqNoBlock sequence number (optional)
withValidatorNoInclude validator list (optional)
withConsValueNoInclude consensus value (optional)
withFeeNoInclude fee configuration (optional)

Implementation Reference

  • Core handler implementation: Makes HTTP GET request to Zetrix RPC /getLedger endpoint with optional seq, with_validator, with_consvalue, with_fee parameters and returns ledger data.
    async getLedger(
      seq?: number,
      withValidator?: boolean,
      withConsValue?: boolean,
      withFee?: boolean
    ): Promise<ZetrixLedger> {
      try {
        const params: any = {};
        if (seq) params.seq = seq;
        if (withValidator) params.with_validator = withValidator;
        if (withConsValue) params.with_consvalue = withConsValue;
        if (withFee) params.with_fee = withFee;
    
        const response = await this.client.get("/getLedger", { params });
    
        if (response.data.error_code !== 0) {
          throw new Error(
            response.data.error_desc || `API Error: ${response.data.error_code}`
          );
        }
    
        return response.data.result;
      } catch (error) {
        if (axios.isAxiosError(error)) {
          throw new Error(`Failed to get ledger: ${error.message}`);
        }
        throw error;
      }
    }
  • src/index.ts:229-253 (registration)
    Tool registration in the MCP tools list, including name, description, and input schema.
    {
      name: "zetrix_get_ledger",
      description: "Get block/ledger information with optional details",
      inputSchema: {
        type: "object",
        properties: {
          seq: {
            type: "number",
            description: "Block sequence number (optional)",
          },
          withValidator: {
            type: "boolean",
            description: "Include validator list (optional)",
          },
          withConsValue: {
            type: "boolean",
            description: "Include consensus value (optional)",
          },
          withFee: {
            type: "boolean",
            description: "Include fee configuration (optional)",
          },
        },
      },
    },
  • MCP server dispatch handler: Extracts arguments and calls ZetrixClient.getLedger, formats response for MCP protocol.
    case "zetrix_get_ledger": {
      const result = await zetrixClient.getLedger(
        args?.seq as number | undefined,
        args?.withValidator as boolean | undefined,
        args?.withConsValue as boolean | undefined,
        args?.withFee as boolean | undefined
      );
      return {
        content: [
          {
            type: "text",
            text: JSON.stringify(result, null, 2),
          },
        ],
      };
    }
  • TypeScript interface defining the structure of ledger response data.
    export interface ZetrixLedger {
      header: {
        seq: number;
        hash: string;
        previous_hash: string;
        account_tree_hash: string;
        close_time: number;
        consensus_value_hash: string;
        fees_hash: string;
        tx_count: number;
        validators_hash: string;
        version: number;
      };
      transactions?: any[];
      validators?: any[];
      consensus_value?: any;
      fees?: any;
    }
Behavior2/5

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

With no annotations provided, the description carries full burden but only states what the tool does without behavioral details. It doesn't disclose if it's read-only, has rate limits, authentication needs, or what format the information is returned in, leaving significant gaps.

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, efficient sentence that front-loads the core purpose ('Get block/ledger information') and adds necessary qualification ('with optional details'). There is no wasted verbiage.

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 no annotations and no output schema, the description is incomplete. It doesn't explain return values, error conditions, or behavioral traits, which is inadequate for a tool with multiple parameters and siblings in a complex domain like blockchain.

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

Parameters3/5

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

Schema description coverage is 100%, so the schema fully documents all 4 parameters. The description adds minimal value by implying parameters control optional details, but doesn't provide additional meaning beyond what's in the schema, meeting the baseline for high coverage.

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 verb ('Get') and resource ('block/ledger information'), making the purpose understandable. It distinguishes from siblings like 'zetrix_get_block' by mentioning 'optional details' but doesn't explicitly differentiate beyond that.

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?

No guidance is provided on when to use this tool versus alternatives like 'zetrix_get_block' or 'zetrix_get_latest_block'. The description mentions 'optional details' but doesn't specify contexts or prerequisites for usage.

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