Skip to main content
Glama

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

TableJSON Schema
NameRequiredDescriptionDefault
chainNoTarget chain. Defaults to AZETH_CHAIN env var or "baseSepolia". Accepts "base", "baseSepolia", "ethereumSepolia", "ethereum" (and aliases like "base-sepolia", "eth-sepolia", "sepolia", "eth", "mainnet").
limitNoMaximum number of transactions to return. Defaults to 10.
smartAccountNoSmart account address, name, or "#N" (account index). If omitted, uses your first smart account.

Implementation Reference

  • 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`); }
      }
  • 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.'),
    }),
  • 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.'),
        }),
      },
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations provided, so description carries full disclosure burden. Successfully adds critical behavioral context: server dependency ('Returns empty results if the server is unavailable'), auth mechanism ('account is determined by AZETH_PRIVATE_KEY'), and return structure ('Array of transaction records with hash, from, to...').

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Excellent structure with clear sections (purpose, usage triggers, returns, operational notes, examples). Every sentence earns its place. Front-loaded with specific verb, zero redundancy, appropriate length for complexity.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

No output schema exists, but description adequately documents return format. Covers failure modes (server availability), authentication context, and parameter behavior. Complete for a read-only history retrieval tool with 3 optional parameters.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, establishing baseline 3. Description adds value through concrete examples showing syntax patterns ('#2' for account indexing) and parameter combinations, clarifying usage beyond raw schema definitions.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

Clear specific verb ('Get') + resource ('transaction history') + scope ('Azeth smart account'). Effectively distinguishes from siblings like azeth_accounts (list accounts), azeth_balance (check balance), and azeth_transfer (send funds) by focusing on historical record retrieval.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Explicit 'Use this when' section lists three concrete scenarios: reviewing past transactions, verifying payments, and auditing activity. Lacks explicit 'when not to use' or named alternatives, but provides clear contextual guidance for selection.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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/azeth-protocol/mcp-azeth'

If you have feedback or need assistance with the MCP directory API, please join our Discord server