Skip to main content
Glama

ScorpTech x402 Tools

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. Returns JSON with: mode, canonicalSignature, selector, data, byteLength, words, params. Price: $0.003 USDC per successful call (x402, Base or 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.6/5.0
Behavior5/5

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

Beyond the annotations (readOnly, idempotent, non-destructive), the description discloses that computation is offline, enumerates the exact return members (mode, canonicalSignature, selector, data, byteLength, words, params), and surfaces a real operational constraint the agent must know: a $0.003 USDC x402 charge per successful call and an equivalent HTTPS endpoint. Payment requirements are exactly the kind of behavior annotations cannot express.

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?

Dense and front-loaded — purpose first, then supported types, then modes, then returns, then price/endpoint. The only slack is the near-duplicate return summary ('Returns hex, 32-byte words and length' followed by the JSON field list), which could be merged.

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 by naming every returned field. With three parameters, one enum, and full schema coverage, an agent has everything needed to construct a correct call without further exploration.

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, but the description adds meaning on top: it clarifies that tuple/struct, fixed and dynamic array, bytes, string and signed-int arguments are all accepted, and notes that mode=params/packed take just a type list rather than a full signature. That resolves ambiguity the schema alone leaves open.

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 opens with a specific verb and resource: 'Build EVM calldata offline' — selector plus ABI-encoded arguments from a human-readable signature. It gives concrete signature examples including a nested tuple, which separates it cleanly from the other *_encode siblings (gray, hash, morse) that encode entirely different payloads.

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 spells out the three modes and when each applies: mode=params for abi.encode without a selector, mode=packed for abi.encodePacked plus keccak256 'as used for hashes and signatures'. That is genuine when-to-use guidance, but there are no explicit exclusions or named alternatives, so it stops short of a 5.

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