Skip to main content
Glama
Zetrix-Chain

Zetrix MCP Server

Official
by Zetrix-Chain

zetrix_ws_disconnect

Disconnect from WebSocket connections to stop receiving real-time blockchain updates from the Zetrix network.

Instructions

Disconnect from WebSocket

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Handler function that executes the zetrix_ws_disconnect tool by getting the WebSocket client singleton and calling its disconnect method.
    case "zetrix_ws_disconnect": {
      const wsClient = getWebSocketClient();
      wsClient.disconnect();
      return {
        content: [
          {
            type: "text",
            text: "WebSocket disconnected successfully",
          },
        ],
      };
    }
  • src/index.ts:404-411 (registration)
    Tool registration entry in the tools array, including name, description, and input schema (empty object). This is used by ListToolsRequestSchema.
    {
      name: "zetrix_ws_disconnect",
      description: "Disconnect from WebSocket",
      inputSchema: {
        type: "object",
        properties: {},
      },
    },
  • Singleton helper function to get or create the ZetrixWebSocketClient instance used by the tool.
    let zetrixWsClient: ZetrixWebSocketClient | null = null;
    
    function getWebSocketClient(): ZetrixWebSocketClient {
      if (!zetrixWsClient) {
        const wsUrl = ZETRIX_WS_URL || WS_NETWORK_URLS[ZETRIX_NETWORK];
        zetrixWsClient = new ZetrixWebSocketClient(wsUrl);
      }
      return zetrixWsClient;
    }
  • Core disconnect implementation in ZetrixWebSocketClient class that closes the WebSocket connection, nullifies the reference, and resets registration status.
    disconnect() {
      if (this.ws) {
        this.ws.close();
        this.ws = null;
        this.isRegistered = false;
      }
    }
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. 'Disconnect from WebSocket' implies a state-changing operation, but it doesn't describe whether this is destructive (e.g., terminates active connections), has side effects (e.g., affects other tools), requires specific permissions, or provides any feedback. For a tool with zero annotation coverage, this is a significant gap in transparency.

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: 'Disconnect from WebSocket'. It is front-loaded with the core action, has zero waste, and is appropriately sized for a tool with no parameters. Every word earns its place by directly conveying the tool's purpose without redundancy.

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 has no parameters, no annotations, and no output schema, the description is incomplete for contextual understanding. It doesn't explain what 'WebSocket' means in this server's context, what state changes occur, or what the agent should expect after invocation. For a tool that likely interacts with network connections, more context is needed to guide proper usage.

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 there are no parameters to document. The description doesn't need to add parameter semantics beyond the schema, which already fully covers the empty input. A baseline of 4 is appropriate as the description doesn't contradict or add unnecessary details about non-existent parameters.

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 'Disconnect from WebSocket' clearly states the action (disconnect) and target resource (WebSocket), making the purpose immediately understandable. It distinguishes itself from sibling tools like 'zetrix_ws_connect' by specifying the opposite operation. However, it doesn't explicitly mention what 'WebSocket' refers to in the context of the Zetrix server, leaving some ambiguity about the scope.

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 specify prerequisites (e.g., must be connected first), conditions for disconnection, or what happens after disconnection. Given siblings like 'zetrix_ws_connect' and 'zetrix_ws_status', explicit usage context would help an agent decide when disconnection is appropriate.

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