Skip to main content
Glama
Zetrix-Chain

Zetrix MCP Server

Official
by Zetrix-Chain

zetrix_ws_status

Check WebSocket connection status for real-time blockchain updates on the Zetrix network.

Instructions

Check WebSocket connection status

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Handler implementation for the 'zetrix_ws_status' tool. Retrieves the WebSocket client instance and returns its connection status along with the WS URL.
    case "zetrix_ws_status": {
      const wsClient = getWebSocketClient();
      const isConnected = wsClient.isConnected();
      return {
        content: [
          {
            type: "text",
            text: JSON.stringify({
              connected: isConnected,
              wsUrl: ZETRIX_WS_URL || WS_NETWORK_URLS[ZETRIX_NETWORK],
            }, null, 2),
          },
        ],
      };
    }
  • Tool schema definition for 'zetrix_ws_status', including name, description, and empty input schema (no parameters required).
    {
      name: "zetrix_ws_status",
      description: "Check WebSocket connection status",
      inputSchema: {
        type: "object",
        properties: {},
      },
    },
  • Core helper method 'isConnected()' in ZetrixWebSocketClient class that checks if WebSocket is open and registered, providing the actual status logic used by the tool.
    isConnected(): boolean {
      return this.ws?.readyState === WebSocket.OPEN && this.isRegistered;
    }
  • Singleton factory function 'getWebSocketClient()' that lazily initializes and returns the shared ZetrixWebSocketClient instance used by the tool.
    function getWebSocketClient(): ZetrixWebSocketClient {
      if (!zetrixWsClient) {
        const wsUrl = ZETRIX_WS_URL || WS_NETWORK_URLS[ZETRIX_NETWORK];
        zetrixWsClient = new ZetrixWebSocketClient(wsUrl);
      }
      return zetrixWsClient;
    }
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 of behavioral disclosure. 'Check' implies a read-only operation, but it doesn't specify whether this requires authentication, has rate limits, returns real-time or cached data, or what happens if no WebSocket connection exists. For a tool with zero annotation coverage, this leaves significant behavioral gaps, though it correctly indicates a non-destructive action.

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, front-loaded sentence ('Check WebSocket connection status') with zero wasted words. It efficiently conveys the core purpose without redundancy or fluff, making it easy for an AI agent to parse and understand quickly.

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

Completeness3/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, no output schema, no annotations), the description is minimally adequate. It states what the tool does but lacks context on usage, behavioral traits, or output format. For a status-checking tool, more details on what 'status' includes (e.g., connected/disconnected, latency metrics) would enhance completeness, but it meets basic requirements.

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%, so no parameter documentation is needed. The description doesn't add parameter information, which is appropriate. A baseline of 4 is applied for zero-parameter tools, as the description focuses on purpose without unnecessary parameter 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 'Check WebSocket connection status' clearly states the verb ('Check') and resource ('WebSocket connection status'), making the purpose immediately understandable. It distinguishes from siblings like 'zetrix_ws_connect' or 'zetrix_ws_disconnect' by focusing on status checking rather than connection management. However, it lacks specificity about what aspects of status are checked (e.g., connectivity, latency, session details), preventing a perfect score.

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. It doesn't mention prerequisites (e.g., requires an established WebSocket connection), exclusions, or comparisons to siblings like 'zetrix_check_health' (which might check broader system health). Usage is implied only by the name and purpose, with no explicit context for selection.

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