calldata-decode
Decode EVM calldata, return data, revert data or event logs against an ABI — Decodes hex calldata (selector plus arguments), function return data, revert data or an event log against a caller-supplied ABI using ethers, for agents inspecting a transaction before signing or after it fails. Handles tuples, nested and dynamic arrays, bytes and strings, and the built-in Error(string) and Panic(uint256) reverts; a strict re-encode check flags trailing bytes, dirty padding and no
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"abi": "<abi>",
"data": "<data>"
},
"name": "calldata-decode"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| abi | Yes | Fragments of the contract ABI (JSON objects or human-readable strings). | |
| data | Yes | 0x-prefixed hex, whole bytes; up to 20000 bytes. | |
| mode | No | Default call: data is selector plus arguments. | |
| topics | No | mode event: 0x topics, topic0 first. | |
| function | No | mode return: function name or signature. |