zetrix_get_transaction_cache
Retrieve pending blockchain transactions that have not yet been executed, allowing users to monitor unconfirmed activity and track transaction status 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 implementation of the tool: Makes HTTP GET request to Zetrix API /getTransactionCache endpoint with optional hash and limit params, validates response, handles errors, and returns pending transaction cache data.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 (registration)Tool registration in the MCP tools list, including name, description, and input schema definition.{ 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 (handler)MCP server request handler case that receives tool call arguments, invokes ZetrixClient.getTransactionCache, formats response as MCP content, and returns it.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), }, ], }; }