Skip to main content
Glama
Zetrix-Chain

Zetrix MCP Server

Official
by Zetrix-Chain

zetrix_ws_subscribe_tx

Subscribe to real-time transaction notifications for specific Zetrix blockchain addresses to monitor account activity and receive instant updates.

Instructions

Subscribe to transaction notifications for specific addresses

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
addressesYesArray of account addresses to subscribe to

Implementation Reference

  • MCP server tool handler for 'zetrix_ws_subscribe_tx': validates arguments, gets WebSocket client, calls subscribeTransactions, and returns result.
    case "zetrix_ws_subscribe_tx": {
      if (!args) {
        throw new Error("Missing arguments");
      }
      const wsClient = getWebSocketClient();
      const result = await wsClient.subscribeTransactions(
        args.addresses as string[]
      );
      return {
        content: [
          {
            type: "text",
            text: JSON.stringify(result, null, 2),
          },
        ],
      };
    }
  • Tool definition including name, description, and input schema requiring 'addresses' array.
    {
      name: "zetrix_ws_subscribe_tx",
      description: "Subscribe to transaction notifications for specific addresses",
      inputSchema: {
        type: "object",
        properties: {
          addresses: {
            type: "array",
            description: "Array of account addresses to subscribe to",
          },
        },
        required: ["addresses"],
      },
    },
  • Core implementation of transaction subscription: sends CHAIN_SUBSCRIBE_TX WebSocket message, awaits successful response with timeout.
    subscribeTransactions(addresses: string[]): Promise<ChainResponse> {
      return new Promise((resolve, reject) => {
        if (!this.isRegistered) {
          reject(new Error("WebSocket not registered. Call registerAndConnect first."));
          return;
        }
    
        const request: ChainSubscribeTxRequest = {
          type: ChainMessageType.CHAIN_SUBSCRIBE_TX,
          address: addresses,
        };
    
        const timeout = setTimeout(() => {
          reject(new Error("Subscription timeout"));
        }, 10000);
    
        const onMessage = (response: ChainResponse) => {
          if (response.error_code === 0) {
            clearTimeout(timeout);
            resolve(response);
          }
        };
    
        this.once("message", onMessage);
        this.sendMessage(request);
      });
    }
Behavior2/5

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

No annotations are provided, so the description carries the full burden. It mentions subscribing to notifications but doesn't disclose behavioral traits such as whether this is a persistent subscription, how notifications are delivered, rate limits, authentication needs, or error handling. This leaves significant gaps for a tool that likely involves real-time updates.

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, direct sentence with no wasted words. It's front-loaded and efficiently conveys the core action, making it easy to parse quickly.

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 complexity of a WebSocket subscription tool with no annotations and no output schema, the description is incomplete. It doesn't explain what happens after subscription (e.g., notification format, how to receive updates), potential side effects, or integration with other WebSocket tools, leaving the agent with insufficient context for effective use.

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?

The input schema has 100% description coverage, with the 'addresses' parameter clearly documented. The description adds minimal value beyond this, as it only restates that addresses are involved without providing additional context like format examples or constraints. Baseline 3 is appropriate given the high schema 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 ('subscribe') and resource ('transaction notifications for specific addresses'), making the purpose evident. However, it doesn't differentiate from sibling tools like 'zetrix_ws_connect' or 'zetrix_ws_submit_transaction', which are also WebSocket-related, so it lacks sibling distinction.

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 explicit guidance on when to use this tool versus alternatives is provided. It doesn't mention prerequisites (e.g., needing a WebSocket connection via 'zetrix_ws_connect'), exclusions, or comparisons to other subscription or transaction tools in the sibling list.

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