Skip to main content
Glama

Abi Encode

abi_encode
Read-onlyIdempotent

Build EVM calldata offline: function selector + ABI-encoded arguments from a human signature such as transfer(address,uint256) or exactInputSingle((address,address,uint24,address,uint256,uint256,uint160)). Tuples/structs, fixed and dynamic arrays, bytes, strings and signed ints supported. mode=params gives abi.encode without a selector, mode=packed gives abi.encodePacked plus its keccak256 (as used for hashes and signatures). Returns hex, 32-byte words and length. Price: $0.003 USDC per successful call (x402, Solana). Same tool over HTTPS: GET https://scorptech.it.com/api/x402/v1/abi-encode

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>"
    },
    "name": "abi_encode"
  }
}

Input Schema

NameRequiredDescriptionDefault
argsNoArguments as a JSON array (nested arrays for arrays/tuples; big integers as strings; bytes as 0x-hex)
modeNocall = selector + abi.encode, params = abi.encode only, packed = abi.encodePackedcall
signatureYesFunction signature, e.g. transfer(address,uint256); param names allowed; for mode=params/packed just the type list, e.g. (address,uint256)

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.7/5.0
Behavior5/5

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

Beyond the annotations, it discloses substantive behavior: a paid endpoint ($0.003 USDC per successful call via x402 on Solana), the return payload (hex, 32-byte words, length), and an alternate HTTPS GET endpoint. The payment/auth requirement in particular is information an agent cannot get from the schema or 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?

Purpose is front-loaded, followed by supported types, mode semantics, return shape, and pricing/access details; every sentence carries information an agent needs to call this correctly. No filler or restatement of the title.

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?

With no output schema, the description still specifies the return values, and it covers payment, modes, and complex-type support, while annotations already carry the safe/read-only profile. Nothing material for correct invocation is missing.

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 100%, so the baseline is 3. The description adds value beyond the schema by noting that packed mode also returns keccak256 (not stated in the enum description) and by showing a nested-tuple signature example that clarifies how structs/arrays should be expressed.

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 names a specific verb and resource ('Build EVM calldata offline: function selector + ABI-encoded arguments') and illustrates it with both a simple signature and a nested-tuple example. An agent can immediately tell this is the encoding counterpart to decoder-style siblings such as evm_selector_decode or eip712_hash.

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?

It clearly explains the three mode choices and when each applies (call for selector + encode, params for bare abi.encode, packed for encodePacked plus keccak256 'as used for hashes and signatures'). It stops short of naming a competing sibling or stating explicit exclusions, so it gives strong context but not full when-not 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