Skip to main content
Glama

zetrix_get_transaction

Retrieve detailed transaction information from the Zetrix blockchain using a transaction hash to verify status, confirmations, and data.

Instructions

Get transaction details by transaction hash

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
hashYesThe transaction hash

Implementation Reference

  • Core handler function that performs HTTP GET to Zetrix API /getTransactionHistory endpoint with transaction hash, handles errors, parses response, constructs and returns ZetrixTransaction object with details like blockNumber, sourceAddress, feeLimit, etc.
    async getTransaction(hash: string): Promise<ZetrixTransaction> { try { const response = await this.client.get("/getTransactionHistory", { params: { hash }, }); if (response.data.error_code !== 0) { throw new Error( response.data.error_desc || `API Error: ${response.data.error_code}` ); } const tx = response.data.result.transactions[0]; const txData = tx.transaction || tx; return { hash: tx.hash || hash, blockNumber: tx.ledger_seq || 0, timestamp: tx.close_time || 0, sourceAddress: txData.source_address || "", feeLimit: txData.fee_limit || "0", gasPrice: txData.gas_price || "0", nonce: txData.nonce || 0, operations: txData.operations, status: tx.error_code === 0 ? "success" : "failed", }; } catch (error) { if (axios.isAxiosError(error)) { throw new Error(`Failed to get transaction: ${error.message}`); } throw error; } }
  • MCP server tool handler case that validates input arguments, calls ZetrixClient.getTransaction, serializes result to JSON and returns as text content.
    case "zetrix_get_transaction": { if (!args) { throw new Error("Missing arguments"); } const result = await zetrixClient.getTransaction(args.hash as string); return { content: [ { type: "text", text: JSON.stringify(result, null, 2), }, ], }; }
  • Tool definition including name, description, and input schema requiring a 'hash' string parameter for validation in MCP ListTools and CallTool requests.
    { name: "zetrix_get_transaction", description: "Get transaction details by transaction hash", inputSchema: { type: "object", properties: { hash: { type: "string", description: "The transaction hash", }, }, required: ["hash"], }, },
  • TypeScript interface defining the structure of the transaction object returned by getTransaction.
    export interface ZetrixTransaction { hash: string; blockNumber: number; timestamp: number; sourceAddress: string; feeLimit: string; gasPrice: string; nonce: number; operations?: any[]; status: 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