Skip to main content
Glama
5ajaki

Veri5ight MCP Server

by 5ajaki

ethereum_getRecentTransactions

Retrieve the most recent transactions for a specified Ethereum address using the Veri5ight MCP Server. Input an address and optional limit to fetch transaction details.

Instructions

Get recent transactions for an Ethereum address

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
addressYesEthereum address or ENS name
limitNoNumber of transactions to return (default: 3)

Implementation Reference

  • The main handler function that implements the logic for ethereum_getRecentTransactions. It fetches recent blocks, filters transactions for the given address, resolves ENS names, and returns formatted transaction details.
    private async handleGetRecentTransactions(request: any) {
      try {
        const address = request.params.arguments?.address;
        const limit = request.params.arguments?.limit || 3;
    
        if (!address) {
          throw new Error("Address is required");
        }
    
        // Get latest block number
        const latestBlock = await this.provider.getBlockNumber();
        const transactions: ethers.TransactionResponse[] = [];
    
        // Scan recent blocks for transactions
        for (let i = 0; i < 10 && transactions.length < limit; i++) {
          const block = (await this.provider.getBlock(
            latestBlock - i,
            true
          )) as ethers.Block & {
            transactions: ethers.TransactionResponse[];
          };
          if (!block || !block.transactions) continue;
    
          const addressTxs = block.transactions.filter(
            (tx: ethers.TransactionResponse) =>
              tx.from?.toLowerCase() === address.toLowerCase() ||
              tx.to?.toLowerCase() === address.toLowerCase()
          );
    
          transactions.push(...(addressTxs as ethers.TransactionResponse[]));
          if (transactions.length >= limit) break;
        }
    
        // Process transactions with ENS resolution
        const processedTxs = await Promise.all(
          transactions.map(async (tx: ethers.TransactionResponse) => {
            // Lookup ENS names in parallel
            const [fromENS, toENS] = await Promise.all([
              tx.from
                ? this.provider.lookupAddress(tx.from).catch(() => null)
                : null,
              tx.to ? this.provider.lookupAddress(tx.to).catch(() => null) : null,
            ]);
    
            return {
              hash: tx.hash,
              from: fromENS || tx.from,
              to: toENS || tx.to || "Contract Creation",
              value: ethers.formatEther(tx.value),
            };
          })
        );
    
        return {
          content: [
            {
              type: "text",
              text:
                `Recent transactions for ${address}:\n` +
                processedTxs
                  .map(
                    (tx, i) =>
                      `${i + 1}. Hash: ${tx.hash}\n` +
                      `   From: ${tx.from}\n` +
                      `   To: ${tx.to}\n` +
                      `   Value: ${tx.value} ETH`
                  )
                  .join("\n\n"),
            },
          ],
        };
      } catch (error: unknown) {
        console.error("Error getting recent transactions:", error);
        const errorMessage =
          error instanceof Error ? error.message : "Unknown error occurred";
        return {
          content: [
            {
              type: "text",
              text: `Error getting recent transactions: ${errorMessage}`,
            },
          ],
        };
      }
    }
  • Tool specification including name, description, and input schema definition used in the list tools response.
    {
      name: "ethereum_getRecentTransactions",
      description: "Get recent transactions for an Ethereum address",
      inputSchema: {
        type: "object",
        properties: {
          address: {
            type: "string",
            description: "Ethereum address or ENS name",
          },
          limit: {
            type: "number",
            description: "Number of transactions to return (default: 3)",
          },
        },
        required: ["address"],
      },
    },
  • src/index.ts:152-153 (registration)
    Switch case in the CallToolRequest handler that registers and dispatches to the ethereum_getRecentTransactions handler function.
    case "ethereum_getRecentTransactions":
      return await this.handleGetRecentTransactions(request);
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure but only states what the tool does without adding context. It does not mention rate limits, error handling, data freshness, or whether it queries a specific blockchain network (e.g., mainnet, testnet), leaving significant gaps in understanding its operational traits.

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?

The description is a single, clear sentence that efficiently conveys the core functionality without unnecessary words. It is front-loaded and appropriately sized for the tool's complexity, making it easy to parse and understand quickly.

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

Completeness2/5

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

Given the lack of annotations and output schema, the description is incomplete for a tool that fetches blockchain data. It does not cover return values (e.g., transaction format, timestamps), error cases, or network specifics, which are critical for an AI agent to use this tool effectively in context with its siblings.

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

Parameters3/5

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

The input schema has 100% description coverage, clearly documenting both parameters ('address' and 'limit') with their types and defaults. The description does not add meaning beyond this, such as explaining ENS name resolution or transaction ordering, so it meets the baseline for adequate but not enhanced parameter semantics.

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

Purpose4/5

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

The description clearly states the tool's purpose with a specific verb ('Get') and resource ('recent transactions for an Ethereum address'), making it immediately understandable. However, it does not explicitly differentiate from sibling tools like 'ethereum_getTransactionInfo' (which might get details of a specific transaction), leaving room for ambiguity in sibling distinction.

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

Usage Guidelines2/5

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

The description provides no guidance on when to use this tool versus alternatives, such as the sibling 'ethereum_getTransactionInfo' for detailed info on a single transaction. It lacks context about use cases, prerequisites, or exclusions, offering minimal usage direction beyond the basic purpose.

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

Related 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/5ajaki/veri5ight'

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