Skip to main content
Glama

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

NameRequiredDescriptionDefault
abiYesFragments of the contract ABI (JSON objects or human-readable strings).
dataYes0x-prefixed hex, whole bytes; up to 20000 bytes.
modeNoDefault call: data is selector plus arguments.
topicsNomode event: 0x topics, topic0 first.
functionNomode return: function name or signature.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A3.9/5.0
Behavior4/5

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

With zero annotations the description carries the whole burden, and it does disclose substantive behavior: ethers as the decode engine, support for tuples, nested and dynamic arrays, bytes and strings, and built-in handling of Error(string) and Panic(uint256) reverts. The strict re-encode check that flags trailing bytes and dirty padding is exactly the kind of failure-mode detail that matters, though the sentence is cut off before explaining what the flag returns or what happens when multiple ABI fragments match.

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

Conciseness3/5

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

The purpose is front-loaded, but the opening clause and the em-dash clause restate the same four data kinds almost verbatim, and the text terminates mid-word ('and no'), leaving an idea dangling. It is not padded so much as self-duplicating and truncated.

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

Completeness3/5

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

For a five-parameter decoder with no annotations and no output schema, the definition explains the input side well but says nothing about the shape of a successful decode response or how a failed decode is reported. The truncated ending specifically removes the part about what the strict re-encode check produces, which is the information an agent most needs to interpret results.

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% and the schema already spells out the mode-dependent semantics of topics and function, so the baseline applies. The description's enumeration of the four data kinds loosely mirrors the four mode values but adds no format, constraint, or interaction detail beyond what the schema states.

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 concrete verb and resource set: decodes EVM calldata, return data, revert data, and event logs against a caller-supplied ABI. The scope is enumerated precisely enough that an agent can tell exactly what inputs belong here, and the sibling catalog contains nothing overlapping.

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?

The phrase 'for agents inspecting a transaction before signing or after it fails' gives a real decision context for reaching for this tool. It stops short of explicit exclusions or named alternatives, but no sibling plausibly competes, so the omission costs little.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources