azeth_history
Retrieve transaction history for Azeth smart accounts to review past payments, verify transfers, and audit on-chain activity.
Instructions
Get recent transaction history for your Azeth smart account.
Use this when: You need to review past transactions, verify a payment was sent, or audit account activity.
Returns: Array of transaction records with hash, from, to, value, block number, and timestamp.
Note: Full indexed history requires the Azeth server to be running. Returns empty results if the server is unavailable. The account is determined by the AZETH_PRIVATE_KEY environment variable.
Example: { "limit": 5 } or { "smartAccount": "#2", "limit": 20 }
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| chain | No | Target chain. Defaults to AZETH_CHAIN env var or "baseSepolia". Accepts "base", "baseSepolia", "ethereumSepolia", "ethereum" (and aliases like "base-sepolia", "eth-sepolia", "sepolia", "eth", "mainnet"). | |
| limit | No | Maximum number of transactions to return. Defaults to 10. | |
| smartAccount | No | Smart account address, name, or "#N" (account index). If omitted, uses your first smart account. |
Implementation Reference
- src/tools/account.ts:348-412 (handler)The handler for the azeth_history tool.
async (args) => { let client; try { client = await createClient(args.chain); // Resolve smartAccount: address, name, "#N", or undefined let forAccount: `0x${string}` | undefined; if (args.smartAccount) { try { forAccount = await resolveSmartAccount(args.smartAccount, client); } catch (resolveErr) { return handleError(resolveErr); } } const history = await client.getHistory({ limit: args.limit ?? 10 }, forAccount); // Resolve token symbols and decimals for formatting const chain = resolveChain(args.chain); const tokens = TOKENS[chain]; const ZERO_ADDR = '0x0000000000000000000000000000000000000000'; return success({ smartAccount: client.smartAccount ?? 'not-deployed', transactions: history.map((tx) => { // Determine token symbol and decimals for formatting const tokenAddr = tx.token?.toLowerCase() ?? null; let symbol = 'ETH'; let decimals = 18; if (tokenAddr && tokenAddr !== ZERO_ADDR) { if (tokenAddr === tokens.USDC.toLowerCase()) { symbol = 'USDC'; decimals = 6; } else if (tokenAddr === tokens.WETH.toLowerCase()) { symbol = 'WETH'; decimals = 18; } else { symbol = 'TOKEN'; } } const valueFormatted = `${formatTokenAmount(tx.value, decimals, decimals === 6 ? 2 : 6)} ${symbol}`; const timestampISO = tx.timestamp > 0 ? new Date(tx.timestamp * 1000).toISOString() : null; return { hash: tx.hash, from: tx.from, to: tx.to, value: tx.value.toString(), valueFormatted, token: tx.token ?? ZERO_ADDR, tokenSymbol: symbol, blockNumber: tx.blockNumber.toString(), timestamp: tx.timestamp, timestampISO, }; }), }); } catch (err) { return handleError(err); } finally { try { await client?.destroy(); } catch (e) { process.stderr.write(`[azeth-mcp] destroy error: ${e instanceof Error ? e.message : String(e)}\n`); } } - src/tools/account.ts:342-346 (schema)The input schema validation for azeth_history.
inputSchema: z.object({ chain: z.string().optional().describe('Target chain. Defaults to AZETH_CHAIN env var or "baseSepolia". Accepts "base", "baseSepolia", "ethereumSepolia", "ethereum" (and aliases like "base-sepolia", "eth-sepolia", "sepolia", "eth", "mainnet").'), limit: z.coerce.number().int().min(1).max(100).optional().describe('Maximum number of transactions to return. Defaults to 10.'), smartAccount: z.string().optional().describe('Smart account address, name, or "#N" (account index). If omitted, uses your first smart account.'), }), - src/tools/account.ts:327-347 (registration)Registration of the azeth_history tool.
server.registerTool( 'azeth_history', { description: [ 'Get recent transaction history for your Azeth smart account.', '', 'Use this when: You need to review past transactions, verify a payment was sent, or audit account activity.', '', 'Returns: Array of transaction records with hash, from, to, value, block number, and timestamp.', '', 'Note: Full indexed history requires the Azeth server to be running. Returns empty results if the server is unavailable.', 'The account is determined by the AZETH_PRIVATE_KEY environment variable.', '', 'Example: { "limit": 5 } or { "smartAccount": "#2", "limit": 20 }', ].join('\n'), inputSchema: z.object({ chain: z.string().optional().describe('Target chain. Defaults to AZETH_CHAIN env var or "baseSepolia". Accepts "base", "baseSepolia", "ethereumSepolia", "ethereum" (and aliases like "base-sepolia", "eth-sepolia", "sepolia", "eth", "mainnet").'), limit: z.coerce.number().int().min(1).max(100).optional().describe('Maximum number of transactions to return. Defaults to 10.'), smartAccount: z.string().optional().describe('Smart account address, name, or "#N" (account index). If omitted, uses your first smart account.'), }), },