Skip to main content
Glama

x402 Toolbox

ABI-encode values (or full calldata for a function signature)

abi_encode
Read-onlyIdempotent

ABI-encode values (or full calldata for a function signature). Encodes values per the Solidity ABI: all integer sizes (range-checked), address, bool, bytesN, bytes, string, fixed and dynamic arrays and tuples (nested). With a function signature, returns calldata with the selector. Integers may be decimal or 0x strings. Price: $0.003 USDC per call via x402 (eip155:8453).

Input Schema

NameRequiredDescriptionDefault
typesNoAlternatively a list of types
valuesYesValues in order; tuples as arrays
signatureNoFunction signature, e.g. transfer(address,uint256)

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.4/5.0
Behavior4/5

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

Annotations already declare readOnly/idempotent/non-destructive, so the description is free to add real behavioral detail: integer range-checking, accepted integer literal forms (decimal or 0x), nesting support, and a concrete price/rail ($0.003 USDC via x402 on eip155:8453). That cost disclosure is genuinely useful and consistent with openWorldHint.

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?

Four tight sentences, front-loaded with purpose then capability then return behavior then cost. 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.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

No output schema, and the description does describe the signature-mode return (calldata with selector) while leaving the values-only return implicit as ABI-encoded hex. Combined with full schema coverage and annotations, an agent has what it needs, though the values-mode return could be stated.

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 baseline is 3; the description goes beyond it by clarifying that integers accept decimal or 0x strings and that tuples are supplied as arrays, resolving ambiguity the schema does not.

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?

States a specific verb (ABI-encode) and both operating modes: encoding a value list, or producing full calldata when a function signature is supplied. The verb/resource pairing makes it trivially separable from abi_decode and calldata_decode.

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?

Clear context for both modes — 'with a function signature, returns calldata with the selector' tells the agent when to add the signature. It does not, however, explicitly rule out or route to abi_decode / calldata_decode for the reverse direction.

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.