Skip to main content
Glama

zetrix_ws_subscribe_tx

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

Instructions

Subscribe to transaction notifications for specific addresses

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
addressesYesArray of account addresses to subscribe to

Implementation Reference

  • src/index.ts:390-403 (registration)
    MCP tool registration defining the name, description, and input schema for zetrix_ws_subscribe_tx
    { 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"], }, },
  • MCP server request handler for tool calls to zetrix_ws_subscribe_tx, validates args and delegates to ZetrixWebSocketClient
    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), }, ], }; }
  • Core tool logic: sends WebSocket subscription request (CHAIN_SUBSCRIBE_TX) for transaction notifications on specified addresses
    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); }); }
  • TypeScript interface defining the WebSocket subscription request structure used by the tool handler
    export interface ChainSubscribeTxRequest { type: ChainMessageType.CHAIN_SUBSCRIBE_TX; address: string[]; }

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