Skip to main content
Glama
5ajaki

Veri5ight MCP Server

by 5ajaki

ethereum_getTransactionInfo

Retrieve detailed Ethereum transaction data, including status, gas usage, and block details, by providing the transaction hash through Veri5ight MCP Server.

Instructions

Get detailed information about an Ethereum transaction

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
hashYesTransaction hash

Implementation Reference

  • The handler function that retrieves detailed Ethereum transaction information, including status, from/to addresses with ENS resolution, value, gas details, input data, and event logs using the ethers provider.
      private async handleGetTransactionInfo(request: any) {
        try {
          const hash = request.params.arguments?.hash;
          if (!hash) {
            throw new Error("Transaction hash is required");
          }
    
          // Log the network we're connected to
          const network = await this.provider.getNetwork();
          console.error(
            `Looking up transaction on network: ${network.name} (chainId: ${network.chainId})`
          );
    
          // Get transaction and receipt in parallel
          const [tx, receipt] = await Promise.all([
            this.provider.getTransaction(hash).catch((error) => {
              console.error(`Error fetching transaction: ${error.message}`);
              return null;
            }),
            this.provider.getTransactionReceipt(hash).catch((error) => {
              console.error(`Error fetching receipt: ${error.message}`);
              return null;
            }),
          ]);
    
          if (!tx) {
            throw new Error(`Transaction not found. Please verify:
    1. The transaction hash is correct
    2. The transaction exists on network ${network.name}
    3. Your node is fully synced`);
          }
    
          // Resolve 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,
          ]);
    
          // Format values
          const value = tx.value ? ethers.formatEther(tx.value) : "0";
          const gasPrice = tx.gasPrice
            ? ethers.formatUnits(tx.gasPrice, "gwei")
            : "unknown";
          const status = receipt
            ? receipt.status === 1
              ? "Success"
              : "Failed"
            : "Pending";
          const gasUsed = receipt ? receipt.gasUsed.toString() : "unknown";
    
          // Get any contract interaction data
          let methodInfo = "";
          if (tx.data && tx.data !== "0x") {
            try {
              methodInfo = `\n• Input Data: ${tx.data}`;
            } catch (error) {
              console.error("Error decoding transaction data:", error);
            }
          }
    
          // Format event logs with ENS resolution
          let eventLogs = "";
          if (receipt && receipt.logs.length > 0) {
            eventLogs = "\n\nEvent Logs:";
            for (const log of receipt.logs) {
              try {
                const contractENS = await this.provider
                  .lookupAddress(log.address)
                  .catch(() => null);
                eventLogs += `\n• From Contract: ${contractENS || log.address}`;
                eventLogs += `\n  Topics: ${log.topics.join(", ")}`;
                if (log.data && log.data !== "0x") {
                  eventLogs += `\n  Data: ${log.data}`;
                }
              } catch (error) {
                console.error("Error processing log:", error);
              }
            }
          }
    
          return {
            content: [
              {
                type: "text",
                text: `Transaction Information for ${hash}:
    • Status: ${status}
    • From: ${fromENS || tx.from}
    • To: ${toENS || tx.to || "Contract Creation"}
    • Value: ${value} ETH
    • Gas Price: ${gasPrice} Gwei
    • Gas Used: ${gasUsed}
    • Block Number: ${tx.blockNumber || "Pending"}${methodInfo}${eventLogs}`,
              },
            ],
          };
        } catch (error: unknown) {
          console.error("Error getting transaction info:", error);
          const errorMessage =
            error instanceof Error ? error.message : "Unknown error occurred";
          return {
            content: [
              {
                type: "text",
                text: `Error getting transaction info: ${errorMessage}`,
              },
            ],
          };
        }
      }
  • Tool schema definition including name, description, and input schema requiring a transaction hash.
    {
      name: "ethereum_getTransactionInfo",
      description:
        "Get detailed information about an Ethereum transaction",
      inputSchema: {
        type: "object",
        properties: {
          hash: {
            type: "string",
            description: "Transaction hash",
          },
        },
        required: ["hash"],
      },
    },
  • src/index.ts:160-161 (registration)
    Switch case registration that routes calls to the ethereum_getTransactionInfo handler.
    case "ethereum_getTransactionInfo":
      return await this.handleGetTransactionInfo(request);
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states the tool 'gets' information, implying a read-only operation, but doesn't specify if it's safe, requires authentication, has rate limits, or what the return format looks like (e.g., JSON structure, error handling). For a tool with no annotations, this is a significant gap in transparency.

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, efficient sentence with zero waste—it directly states the tool's purpose without unnecessary words. It's appropriately sized and front-loaded, making it easy for an agent to parse 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 complexity of Ethereum transactions and the lack of annotations and output schema, the description is incomplete. It doesn't explain what 'detailed information' includes (e.g., block number, gas used, status), potential errors (e.g., invalid hash), or behavioral traits. For a tool with no structured output and no annotations, more context is needed to be fully helpful.

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, with the 'hash' parameter clearly documented as 'Transaction hash'. The description adds no additional meaning beyond this, such as hash format (e.g., 0x-prefixed hex) or examples. Given the high schema coverage, the baseline score of 3 is appropriate, as the schema does the heavy lifting.

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 verb ('Get') and resource ('detailed information about an Ethereum transaction'), making the purpose unambiguous. However, it doesn't differentiate this from sibling tools like 'ethereum_getRecentTransactions' or 'ethereum_getContractInfo', which also retrieve transaction-related data, so it doesn't reach the highest clarity level.

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. It doesn't mention prerequisites (e.g., needing a transaction hash), exclusions, or comparisons to siblings like 'ethereum_getRecentTransactions' for recent transactions or 'ethereum_getContractInfo' for contract details. This leaves the agent without context for tool 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

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