Skip to main content
Glama

Merkle tree, merkle root and proofs

merkle_tree
Read-only

Build a Merkle tree for an allowlist or airdrop and get the root and a proof per entry, OpenZeppelin-compatible: values ABI-encoded by types (address,uint256 for airdrops), double-keccak leaves, sorted pairs, so proofs verify with MerkleProof.verify and the dump loads in StandardMerkleTree.load. Up to 2,000 values; proofs for the first 256 or the one you ask for. Ready bytes32 leaves work too. Use to set up a claim contract or check a list. Price $0.01/call via x402 USDC or a card key (/credits), first 25 free; failed calls free. Reads or computes only and changes nothing; each call is charged, so repeats are not free.

Input Schema

NameRequiredDescriptionDefault
typesNoSolidity types of each row's fields, comma-separated (default: read from the rows: address,uint256 or address or bytes32 leaves)
valuesYesThe entries: a JSON array of rows ([["0xabc…","100"],…]) or one row per line, fields comma-separated
proofForNoOnly the proof for this entry: its 0-based index or its first field (an address)

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?

Goes well beyond the annotations: it discloses hard limits (2,000 values, proofs for the first 256 unless proofFor is given), the exact hashing/encoding scheme, output compatibility with StandardMerkleTree.load, and the billing model including that failed calls are free. It also confirms the read-only nature ("Reads or computes only and changes nothing") and explains why idempotentHint=false matters in practice (each call is charged).

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?

Everything stated is useful and the payoff-affecting facts (compatibility, limits, pricing) are front-loaded. The main weakness is density — one very long run-on sentence with heavy parenthetical packing makes it harder to scan than a couple of short sentences would.

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 carries the burden of explaining return values and does so: root, proof per entry, proof cap of 256 unless proofFor is supplied. Combined with the limits, encoding rules, and billing, an agent has everything needed to call this correctly and to know the cost of doing so.

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 real meaning: it explains that values are ABI-encoded by types with address,uint256 as the airdrop default, that raw bytes32 leaves are accepted, and that proofFor selects either an index or a first-field address. It stops short of describing how types is inferred or what happens on rows that conflict with declared types.

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 and resource ("Build a Merkle tree for an allowlist or airdrop") and immediately names the concrete outputs (root and a proof per entry). It also pins down the exact flavor of tree (OpenZeppelin-compatible, double-keccak, sorted pairs), which cleanly separates it from the sibling merkle_verify that only checks proofs.

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?

"Use to set up a claim contract or check a list" gives a clear when-to-use context. It does not explicitly route the agent away from merkle_verify or state exclusions, so it falls short of a full when/when-not treatment, but the intended context is unambiguous.

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