Skip to main content
Glama
Zetrix-Chain

Zetrix MCP Server

Official
by Zetrix-Chain

zetrix_get_transaction_blob

Serialize Zetrix blockchain transaction data into hexadecimal format for secure transmission and processing.

Instructions

Serialize transaction data into hexadecimal format

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
transactionYesTransaction object with source_address, nonce, fee_limit, gas_price, operations

Implementation Reference

  • Core handler function in ZetrixClient that serializes transaction data by calling the RPC endpoint /getTransactionBlob and handles errors.
    async getTransactionBlob(transaction: any): Promise<ZetrixTransactionBlob> {
      try {
        const response = await this.client.post("/getTransactionBlob", transaction);
    
        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 transaction blob: ${error.message}`);
        }
        throw error;
      }
    }
  • src/index.ts:268-281 (registration)
    MCP tool registration defining the name, description, and input schema.
    {
      name: "zetrix_get_transaction_blob",
      description: "Serialize transaction data into hexadecimal format",
      inputSchema: {
        type: "object",
        properties: {
          transaction: {
            type: "object",
            description: "Transaction object with source_address, nonce, fee_limit, gas_price, operations",
          },
        },
        required: ["transaction"],
      },
    },
  • Input schema for validating the transaction object parameter.
    inputSchema: {
      type: "object",
      properties: {
        transaction: {
          type: "object",
          description: "Transaction object with source_address, nonce, fee_limit, gas_price, operations",
        },
      },
      required: ["transaction"],
    },
  • MCP server dispatch handler that receives the tool call and delegates to ZetrixClient.getTransactionBlob.
    case "zetrix_get_transaction_blob": {
      if (!args) {
        throw new Error("Missing arguments");
      }
      const result = await zetrixClient.getTransactionBlob(args.transaction);
      return {
        content: [
          {
            type: "text",
            text: JSON.stringify(result, null, 2),
          },
        ],
      };

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