Skip to main content
Glama

Decode EVM Calldata

evm_decode_calldata
Read-onlyIdempotent

Decode Ethereum transaction calldata into a function signature and typed arguments. Uses Foundry cast or online signature database for unknown selectors.

Instructions

Decode hex calldata into a function signature and typed argument values using Foundry cast.

If you know the function signature, pass it for a fully offline, deterministic decode (cast calldata-decode). Without a signature, the 4-byte selector is resolved via the openchain.xyz signature database (cast 4byte-decode) — requires network access.

Args:

  • calldata (string): Hex-encoded calldata (0x-prefixed, at least the 4-byte selector)

  • signature (string, optional): Known function signature, e.g. "transfer(address,uint256)"

Returns: JSON object: { "success": boolean, "signature": string, // Resolved or provided function signature "values": string[] // Decoded argument values, one per parameter }

Examples:

  • "What does this pending tx do?" → calldata = "0xa9059cbb000...", no signature

  • "Decode this transfer call" → calldata + signature = "transfer(address,uint256)"

Error Handling:

  • Returns isError=true if cast is not installed, the calldata is malformed, or the selector is unknown

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
calldataYesHex-encoded calldata (0x-prefixed)
signatureNoKnown function signature for offline decoding, e.g. 'transfer(address,uint256)'

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
valuesNo
successYes
signatureNo
Behavior5/5

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

Annotations already declare it as read-only, idempotent, non-destructive. The description adds deep behavioral context: the backend (Foundry cast), the two modes of operation, and error handling (isError for missing cast, malformed calldata, unknown selector). No contradictions 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.

Conciseness5/5

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

The description is well-structured with clear sections (purpose, args, returns, examples, error handling). Each sentence adds value, no fluff. Appropriate length for the tool's complexity.

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?

Given the tool's complexity (2 params, clear annotations, output schema), the description covers all necessary aspects: how it works, error handling, return format, and examples. The output schema is included, so no gap there.

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?

Schema coverage is 100%, but the description significantly enhances semantics by explaining the offline vs online modes, the requirement for 0x-prefixed calldata with at least 4 bytes, and providing examples. The description adds meaning beyond the schema.

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 hex calldata into a function signature and typed argument values using Foundry cast. It specifies the verb, resource, and output, and clearly distinguishes from sibling tools which focus on gas analysis, compilation, storage, etc.

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 description explicitly explains when to use each mode: with a known signature for offline decoding, or without for online lookup via the signature database. It provides examples and notes network requirements. However, it does not explicitly mention when not to use this tool, though the sibling tools are sufficiently different to avoid confusion.

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/0xendale/evm-agent-toolkit'

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