Skip to main content
Glama

Decode Transaction

decode_transaction
Read-only

Decode a transaction's calldata into a human-readable function name and arguments, and return transaction status (1=success, 0=revert), gas used, and block number. Uses a supplied ABI when provided, otherwise 4byte.directory. Supports Ethereum mainnet and Base.

Use when: Use when one known transaction must be explained — what function was called, with what arguments, and whether it succeeded. For wallet-wide activity patterns use get_wallet_history instead.

Limitations: 4byte.directory matching can be ambiguous or absent for custom contracts; supply an ABI for precise decoding. One transaction per call; Ethereum mainnet and Base only.

Alternatives: get_transaction, get_wallet_history

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
tx_hashYesTransaction hash (0x… 64 hex chars)
abi_jsonNoOptional ABI JSON array for decoding. If omitted, 4byte.directory is used.
chain_idNoChain ID (1=Ethereum, 8453=Base)

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
noteNodecoded_args values are raw ABI-decoded types; uint256 amounts have not been decimals-formatted — do not call read_contract or get_erc20_balance to interpret them unless the user explicitly asks. Addresses (from_address, to_address, decoded_args) are plain hex — do not call resolve_ens to label them unless the user explicitly asks.
statusNo1=success, 0=revert, None=pending
tx_hashYes
chain_idYes
gas_usedYes
value_ethYes
to_addressYes
block_numberYes
decoded_argsYes
from_addressYes
raw_calldataYes
decode_sourceYes
function_nameYes
function_selectorYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed5 schema fields changed
    • removedInput schema / additionalProperties
      Removed value: -false
    • addedInput schema / properties / abi_json / title
      Added value: +"Abi Json"
    • addedInput schema / properties / chain_id / title
      Added value: +"Chain Id"
    • addedInput schema / properties / tx_hash / title
      Added value: +"Tx Hash"
    • addedInput schema / title
      Added value: +"mcp_decode_transactionArguments"
  2. First observed

TDQS

A4.3/5.0
Behavior4/5

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

Annotations declare readOnlyHint=true, and the description adds useful behavioral context: it uses a supplied ABI when provided, otherwise falls back to 4byte.directory, and notes that 4byte.directory matching can be ambiguous or absent for custom contracts. It also states the one-transaction-per-call limit and supported chains. This goes beyond the annotation without contradicting it.

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?

The description is well-structured with clear sections: what it does, when to use, limitations, and alternatives. It's slightly longer than necessary but every section earns its place, and the core purpose is front-loaded.

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?

The description covers the tool's purpose, usage context, limitations, and alternatives. An output schema exists, so return values don't need to be explained. The only minor gap is that it doesn't explicitly state what happens when decoding fails or when no ABI is supplied and 4byte.directory has no match, but the limitations section partially covers this.

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 schema already documents all three parameters. The description adds context about the ABI fallback behavior and chain support, but doesn't add significant new meaning beyond what the schema provides. Baseline 3 is appropriate.

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 states a specific verb and resource: decode a transaction's calldata into a human-readable function name and arguments, plus return status, gas used, and block number. It clearly distinguishes itself from siblings like get_transaction and get_wallet_history by focusing on calldata decoding and transaction explanation.

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

Usage Guidelines5/5

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

The description explicitly says 'Use when' one known transaction must be explained, and names the alternative get_wallet_history for wallet-wide patterns. It also lists alternatives get_transaction and get_wallet_history, giving clear routing guidance.

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