Skip to main content
Glama

zetrix_test_transaction

Evaluate transaction fees before submitting to the Zetrix blockchain to verify costs and validate transaction parameters without network execution.

Instructions

Evaluate transaction fees without blockchain submission

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
itemsYesArray of test transaction items

Implementation Reference

  • Core implementation of the zetrix_test_transaction tool: sends POST /testTransaction to Zetrix RPC endpoint with input 'items' array and returns the test result (actual_fee, hash, logs, etc.)
    async testTransaction(items: any[]): Promise<ZetrixTestTransactionResult> { try { const response = await this.client.post("/testTransaction", { items }); 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 test transaction: ${error.message}`); } throw error; } }
  • MCP server CallToolRequest handler for 'zetrix_test_transaction': validates args, calls ZetrixClient.testTransaction, formats response as JSON text content
    case "zetrix_test_transaction": { if (!args) { throw new Error("Missing arguments"); } const result = await zetrixClient.testTransaction(args.items as any[]); return { content: [ { type: "text", text: JSON.stringify(result, null, 2), }, ], }; }
  • src/index.ts:341-354 (registration)
    Registers the tool with MCP server.setRequestHandler(ListToolsRequestSchema), defining name, description, and inputSchema (requires 'items' array)
    { name: "zetrix_test_transaction", description: "Evaluate transaction fees without blockchain submission", inputSchema: { type: "object", properties: { items: { type: "array", description: "Array of test transaction items", }, }, required: ["items"], }, },
  • TypeScript interface defining the output schema for testTransaction result (actual_fee, hash, logs, query_rets, stat, txs)
    export interface ZetrixTestTransactionResult { actual_fee: string; hash: string; logs: any; query_rets: any[]; stat: any; txs: any[]; }

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