Skip to main content
Glama

Decode event logs to typed JSON (paid $0.003)

decode_log

Decode EVM event logs into human-readable JSON using a transaction hash or raw log inputs. Resolves ABIs automatically and returns event names, signatures, and typed arguments.

Instructions

PAID $0.003 (x402, USDC on Base). FLAGSHIP: decode EVM event LOGS to human-readable JSON. Give {chain, tx_hash} to decode every log in a transaction, OR {chain, address, topics[], data} for a single log; optional {abi}. Returns each event's name, canonical signature and named/typed args — correctly handling tuple/array/nested params, anonymous events, and indexed vs non-indexed. Resolves the ABI via Sourcify/Blockscout + 4byte event signatures when none is supplied. Without payment returns the x402 challenge; pass x_payment to settle.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
abiNoOptional contract ABI (JSON array or JSON string). If omitted, the ABI is resolved from the verified source (Sourcify/Blockscout) or 4byte.directory.
dataNoLog data field (0x hex) holding the non-indexed args.
chainYesEVM chain: ethereum | base | arbitrum | optimism | polygon | bsc.
topicsNoLog topics array (topic0 is the event signature hash for non-anonymous events).
addressNoContract address of a single log (used with topics + data).
tx_hashNoTransaction hash (0x + 64 hex) — decodes every event log in the tx.
x_paymentNox402 payment payload (base64) for this PAID decode. If supplied it is forwarded as the X-PAYMENT header to settle the call and return the real result instead of a 402 challenge. Omit to get the price challenge first.
Behavior5/5

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

No annotations are present, so the description carries the full burden. It thoroughly discloses payment requirements (x402 challenge, x_payment settlement), ABI resolution behavior (Sourcify/Blockscout + 4byte), and edge-case handling (tuples, arrays, anonymous events, indexed vs non-indexed). This is exceptionally transparent.

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 dense but front-loaded with the crucial 'PAID' flag. Each sentence adds necessary information: payment, input modes, return details, ABI resolution, and 402 behavior. No filler or repetition.

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?

There is no output schema and no annotations, so the description must fully explain behavior and return values. It does so: it describes the return fields (name, canonical signature, named/typed args), covers complex ABI cases, explains payment flow, and identifies the ABI resolution path. This is complete for a moderately complex paid tool.

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%, so baseline is 3. The description adds value by explaining how parameters combine (tx_hash vs address+topics+data), what 'data' means (non-indexed args), and the x_payment flow (omitting returns 402 challenge, supplying settles via X-PAYMENT header). This goes beyond schema descriptions without being redundant.

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 the tool's purpose: decode EVM event logs into typed JSON. It specifies two input modes (tx_hash or address+topics+data) and what it returns (event name, signature, args), distinguishing it from sibling tools like decode_calldata by explicitly targeting event logs.

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?

Usage guidance is clear: it tells you exactly when to pass tx_hash vs address/topics/data, and when abi is optional. It does not explicitly mention alternatives or exclusion cases, but the 'FLAGSHIP' framing and event-log focus imply when to choose it over decode_calldata.

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/zvmzaretsky/onchain-decode-mcp'

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