Skip to main content
Glama

explain_tx

Read-onlyIdempotent

Analyze any confirmed blockchain transaction and get a straightforward narrative explaining what it did, including events, token transfers, balance changes, and failure causes.

Instructions

Narrative analysis of a single confirmed transaction. AGENT BEHAVIOR: when the user pastes a tx hash (or an Etherscan / Arbiscan / Polygonscan / Basescan / Optimistic-Etherscan / Tronscan / Solscan URL containing one) and asks 'why did this fail / what does this do / what happened', call THIS tool — do NOT WebFetch the explorer or a Tenderly/Phalcon dashboard URL. Those pages are JS SPAs that render an empty shell when fetched server-side; this tool decodes the same data structurally and returns a verbatim-relayable narrative. Walks what actually happened: top-level method/instruction call, decoded ERC-20/TRC-20 Transfer + Approval events (or Solana SPL balance deltas), per-token balance changes for the wallet, fee paid, and a heuristics block flagging surprises (failed status, unlimited approval, dust outflow, transfer-to-zero burn, high-gas vs. moved value, unexpected no-state-change). Returns BOTH a structured envelope and a pre-rendered narrative string for verbatim relay (control via format). Distinct from get_transaction_status (just confirmation status) and the prepare→preview→send pipeline (forward-looking). Useful for debugging ("why did this swap return less than the quote?"), learning ("what does this contract call actually do?"), forensics ("what addresses did this tx touch?"), and address-poisoning triage. v1 covers EVM (Ethereum/Arbitrum/Polygon/Base/Optimism), TRON, and Solana — Bitcoin is deferred. v1 reads top-level execution only; internal calls / CPI / DeFi compositions surface via balance & event effects rather than as separate step rows. Pricing is current spot via DefiLlama (not historical at tx time). Optional wallet arg recomputes balance/approval changes from THAT wallet's perspective — defaults to tx sender. Read-only — no signing, no broadcast.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
hashYesTransaction identifier. EVM: 32-byte hex (with or without `0x`). TRON: 32-byte bare hex. Solana: 64-byte signature as base58 (86–88 chars).
chainYesWhich chain the tx lives on. Required because EVM / TRON / Solana post-mortems use different RPC paths and payload shapes.
walletNoOptional. When supplied, balance + approval changes are computed FROM THIS WALLET'S PERSPECTIVE — outflows are negative, inflows positive. When omitted, defaults to the tx sender (the canonical perspective). Pass an explicit wallet for recipient-side narratives.
formatNo"structured" returns the JSON envelope only. "narrative" returns only the pre-rendered string. "both" (default) returns both — agents typically use the narrative for verbatim relay and the structured for follow-up questions.both
Behavior5/5

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

The description discloses comprehensive behavioral traits beyond annotations: it walks top-level method/events, decodes events, shows balance changes, fee, and heuristics. It also notes limitations (v1 coverage, top-level only, current spot pricing) and confirms read-only, no signing/broadcast. No contradiction with annotations.

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

Conciseness4/5

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

The description is dense with valuable information and well-structured (purpose, agent behavior, details, distinctions, use cases, limitations). However, it is somewhat verbose, but every sentence contributes meaning.

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

Completeness5/5

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

Despite having no output schema, the description thoroughly explains what the tool returns (structured envelope and pre-rendered narrative). It covers supported chains, limitations, pricing, and parameter behavior, making it complete for an agent to understand.

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

Parameters5/5

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

All 4 parameters are fully described in the schema (100% coverage). The description adds context for wallet (defaults to sender, computes perspective) and format (both structured and narrative returns), going beyond schema details.

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?

The description clearly states that this tool provides 'narrative analysis of a single confirmed transaction', listing specific decoded elements and use cases. It distinguishes itself from siblings like get_transaction_status and the prepare→preview→send pipeline, ensuring no overlap.

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

Usage Guidelines5/5

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

The description explicitly tells when to call this tool (when a user pastes a tx hash and asks why it failed/what it does) and what NOT to do (do not WebFetch explorer pages because they are JS SPAs). It also distinguishes from related tools, providing clear alternatives.

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/szhygulin/recon-crypto-mcp'

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