Skip to main content
Glama
laszlopere

mcp-bytesmith

eth_revert_decode

Decode a failed call's revert data into a human-readable reason.

Instructions

Decode a failed call's revert data into a human-readable reason.

Returns {kind, ...} where kind selects the rest of the payload: 'empty' (no revert data at all) -> {reason}; 'error' (Error(string), the require/revert message) -> {selector, signature, reason}; 'panic' (Panic(uint256), a compiler check) -> {selector, signature, code, meaning}; 'custom' (a user-declared error, needs signature) -> {selector, signature, selector_matches, args} with args as {name, type, value} exactly as eth_calldata reports them; 'unknown' (an unrecognized selector and no signature given) -> {selector, reason}. A signature whose selector is not the one in data still decodes, but selector_matches is false and reason says so.

Example: eth_revert_decode("0x08c379a0...") -> kind="error", reason="ERC20: transfer amount exceeds balance".

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
dataYesThe 0x-prefixed revert data returned by a failed call: a 4-byte error selector followed by its ABI-encoded arguments. An empty '0x' is a revert that carried no reason.
signatureNoA custom error's human-readable signature, e.g. 'InsufficientBalance(uint256 available, uint256 required)'. Only needed for user-declared errors — Error(string) and Panic(uint256) are recognized without it.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.4.1

TDQS

A4/5.0
Behavior4/5

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

With no annotations, the description carries the full burden and does it well: it discloses every result branch (empty/error/panic/custom/unknown), the selector-mismatch behavior where decoding still succeeds but selector_matches is false, and a worked example. It does not say how malformed or non-hex input is handled, which is the remaining gap.

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?

Front-loaded with the purpose, then a structured kind-by-kind breakdown, then a concrete example. Dense but well organized; a few phrases (e.g. 'exactly as eth_calldata reports them') are slightly redundant, but nothing is wasted wholesale.

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, so the description must specify the return shape — and it does so exhaustively for all five kinds plus the selector-mismatch case, which is everything an agent needs to interpret results from a pure decode tool.

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?

Schema description coverage is 100%, so the baseline is 3. The description mostly reiterates the schema's account of `signature` (needed only for custom errors) and `data`, adding only marginal detail about the signature/selector relationship, so it does not meaningfully exceed the structured fields.

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?

States a specific verb+resource (decode a failed call's revert data) and immediately enumerates the discriminated result kinds, making it distinguishable from siblings like eth_calldata and eth_log_decode. An agent can tell what this tool does without opening the schema.

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

Usage Guidelines3/5

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

Usage is only implied by the task-domain scoping (revert data from a failed call) and by the note that `signature` is needed for user-declared errors. It never explicitly states when to reach for this versus eth_calldata or abi_codec, nor any preconditions for obtaining the revert data.

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