Skip to main content
Glama

chain_abi_encode

Read-only

ABI encode function call — Build EVM transaction calldata offline: Solidity ABI-encode a function call from its signature and arguments. Returns the 4-byte selector, full calldata (selector + args), encoded args and 32-byte words. signature= (e.g. transfer(address,uint256)) and args= (comma-separated, or a JSON array for arrays / strings with commas) required. Supports address, bool, uintN/intN (range-checked, negatives in two's complement), bytesN, bytes, string and T[] of static types; no tuples. 422 on bad types/values. Price: $0.002 USDC (Base, via x402).

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": {
      "signature": "<signature>",
      "args": "<args>"
    },
    "name": "chain_abi_encode"
  }
}

Input Schema

NameRequiredDescriptionDefault
argsYes0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913,1000000
signatureYestransfer(address,uint256)

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.1/5.0
Behavior5/5

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

Goes well beyond the annotations by disclosing the return payload (selector, full calldata, encoded args, 32-byte words), the exact error behavior (422 on bad types/values), the supported type matrix including range-checking and two's-complement negatives, the tuple limitation, and a concrete price ($0.002 USDC via x402 on Base). Cost and payment mechanism are behavioral facts an agent cannot get from readOnlyHint/openWorldHint alone.

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?

Front-loaded with the core action and tightly packed; the return values, input rules, type support, error code, and price each earn their sentence. It is dense to the point of being run-on in places (types and tuple caveat squeezed into one clause), but there is essentially no filler.

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?

There is no output schema, and the description compensates fully by naming the returned fields. For a two-parameter encoder, it also covers error conditions, type restrictions, parsing rules for args, and payment cost — everything an agent needs to call it correctly and interpret the result.

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?

Schema coverage is already 100%, so the baseline is 3, but the description adds real meaning: it specifies that args are comma-separated by default and must be a JSON array for array types or strings containing commas, and it clarifies that signature is a canonical Solidity signature rather than a selector. That goes beyond the bare example strings in the schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb and resource ('ABI encode function call') and adds scope ('Build EVM transaction calldata offline'), which lets an agent distinguish it from execution tools like chain_call and from the reverse operation chain_decode_calldata. It does not explicitly name the sibling it complements, so it stops short of full differentiation.

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?

'Offline' implies this is the non-broadcasting path for calldata construction, and 'no tuples' plus '422 on bad types/values' hints at acceptable inputs. However, there is no explicit when-to-use vs when-not (e.g., use chain_call to execute, use chain_decode_calldata to reverse), so the routing must be inferred.

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