Skip to main content
Glama

Decode a function call's calldata (paid $0.002)

decode_calldata

Decode EVM calldata into a function signature and typed arguments, resolving the selector via provided ABI, verified source, or 4byte.directory.

Instructions

PAID $0.002 (x402, USDC on Base). Decode a contract function call. Give {chain, to?, data, abi?}; get the 4-byte selector resolved to a function signature (via provided ABI, the verified contract source, or 4byte.directory) plus fully decoded, typed arguments (tuples/arrays/nested included). Without payment returns the x402 challenge.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
toNoContract address the call targets (optional; enables verified-ABI resolution).
abiNoOptional contract ABI (JSON array or JSON string). If omitted, the ABI is resolved from the verified source (Sourcify/Blockscout) or 4byte.directory.
dataYesCalldata (0x hex, at least the 4-byte selector).
chainYesEVM chain: ethereum | base | arbitrum | optimism | polygon | bsc.
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.
Behavior4/5

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

No annotations are provided, so the description carries the burden. It discloses the paid nature ($0.002), the x402 challenge when unpaid, and the resolution order (ABI, verified source, 4byte.directory). It also highlights nested argument support, which is behavioral context beyond a simple decode.

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 three sentences with no fluff. The payment warning is front-loaded, followed by purpose and behavior.

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

Completeness4/5

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

With no output schema, the description explains the result includes selector signature and typed arguments. It covers payment behavior and resolution order but does not explicitly describe the response JSON shape or error cases, which would make it fully complete.

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?

All 5 parameters have schema descriptions (100% coverage), so the baseline is 3. The description adds a compact input template ('Give {chain, to?, data, abi?}') but does not substantively explain parameter 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 decodes a contract function call, resolving the 4-byte selector and producing typed arguments. It distinguishes itself from siblings like decode_log (events) and selector_lookup by focusing on calldata decoding.

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?

No explicit guidance on when to use this vs sibling tools is given. The description implies usage by explaining input format and payment behavior, but does not mention alternatives or exclusions.

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