zetrix_get_transaction_cache
Retrieve pending blockchain transactions that have not yet been executed, allowing users to monitor unconfirmed activity on the Zetrix network.
Instructions
Get pending transactions not yet executed
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| hash | No | Transaction hash (optional) | |
| limit | No | Number of pending transactions to return (optional) |
Implementation Reference
- src/zetrix-client.ts:446-467 (handler)Core handler function that executes the tool logic by making an HTTP GET request to the Zetrix RPC endpoint '/getTransactionCache' with optional hash and limit parameters, handling errors and returning the result.async getTransactionCache(hash?: string, limit?: number): Promise<any> { try { const params: any = {}; if (hash) params.hash = hash; if (limit) params.limit = limit; const response = await this.client.get("/getTransactionCache", { params }); 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 cache: ${error.message}`); } throw error; } }
- src/index.ts:212-228 (schema)Tool schema definition including input schema for hash and limit parameters.{ name: "zetrix_get_transaction_cache", description: "Get pending transactions not yet executed", inputSchema: { type: "object", properties: { hash: { type: "string", description: "Transaction hash (optional)", }, limit: { type: "number", description: "Number of pending transactions to return (optional)", }, }, }, },
- src/index.ts:940-953 (registration)MCP tool dispatch/registration in the CallToolRequestSchema handler switch statement, invoking the ZetrixClient method.case "zetrix_get_transaction_cache": { const result = await zetrixClient.getTransactionCache( args?.hash as string | undefined, args?.limit as number | undefined ); return { content: [ { type: "text", text: JSON.stringify(result, null, 2), }, ], }; }
- src/index.ts:768-770 (registration)General registration of all tools via ListToolsRequestSchema handler, which returns the tools array containing this tool.server.setRequestHandler(ListToolsRequestSchema, async () => { return { tools }; });