Skip to main content
Glama
laszlopere

mcp-bytesmith

eth_tx_codec

Encode signed Ethereum transaction fields into a raw tx, or decode a raw tx to extract fields, type, hash, and sender address. Supports legacy, EIP-2930, EIP-1559, and EIP-4844 formats.

Instructions

Serialize signed tx fields into a raw transaction, or decode a raw tx.

action=encode (needs fields) serializes the supplied, already-signed fields (it does not sign) -> {type, raw:'0x...', hash}. fields is an object; the type is taken from a type key or inferred from which fields are present (maxFeePerGas -> 1559, blobVersionedHashes -> 4844, accessList -> 2930, else legacy). Numbers accept int / decimal / 0x-hex; to/data are 0x-hex. action=decode (needs data, a 0x-hex raw tx) -> {type, fields, hash, from}, recovering from from the signature; numeric fields come back as decimal strings, addresses EIP-55 checksummed.

Example: eth_tx_codec("encode", fields={"nonce":0,"gasPrice":"0x09184e72a000", "gasLimit":"0x2710","to":"0x00..00","value":0,"data":"0x"}) -> type=0, raw="0xe5808609184e72a00082271094...808080".

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
actionYes'encode' signed fields into a raw tx, or 'decode' a raw tx.
dataNo0x-prefixed raw transaction bytes to decode (required for action=decode): a legacy RLP list or an EIP-2718 typed envelope.
fieldsNoAlready-signed tx fields object (required for action=encode); does NOT sign. The type comes from a `type` key or is inferred (maxFeePerGas->1559, blobVersionedHashes->4844, accessList->2930, else legacy). Numbers accept int/decimal/0x-hex; `to`/`data` are 0x-hex. A stringified JSON object is accepted.
Behavior4/5

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

With no annotations, the description carries full disclosure burden. It clearly states that encode does not sign, decode recovers the 'from' address, and specifies number formats and address checksumming. It does not explicitly declare non-destructiveness or statelessness, but the codec nature implies read-only behavior. Additional details about type inference add transparency.

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 concise with two substantive paragraphs and a concrete example. Every sentence contributes useful information; there is no redundancy or filler. The example illustrates typical usage, aiding understanding without unnecessary length.

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 lack of output schema and complexity (two actions, field inference, multiple formats), the description provides complete coverage. It explains both actions, return formats for each ({type, raw, hash} for encode, {type, fields, hash, from} for decode), and includes an example. No gaps are apparent.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Despite 100% schema coverage, the description adds significant semantic value beyond the schema. It explains how to structure the 'fields' object for encode, the inference rules for transaction type, accepted number formats (int/decimal/0x-hex), and that 'data' is required for decode. This enriches the schema's basic parameter descriptions.

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: 'Serialize signed tx fields into a raw transaction, or decode a raw tx.' It specifies the two actions (encode/decode) and the resources involved, making it distinct from sibling tools that handle other codec tasks (e.g., abi_codec, rlp_codec).

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?

The description explains how to use the tool with action=encode or decode and the required parameters. However, it does not explicitly state when to use this tool over alternatives like rlp_codec or abi_codec, nor does it provide contraindications. The usage context is implied for Ethereum transactions but lacks direct comparison.

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/laszlopere/mcp-bytesmith'

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