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 10 free; failed calls free. Reads or computes only and changes nothing; each call is charged, so repeats are not free.

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": {
      "values": "<values>"
    },
    "name": "merkle_tree"
  }
}

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?

Annotations declare readOnly, non-destructive, non-idempotent, and the description explains exactly why repeats aren't free ('each call is charged, so repeats are not free') and confirms 'changes nothing.' It adds cost model, free-tier and failed-call behavior, hard size limits, and the hashing/encoding conventions — none of which the annotations carry.

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?

Purpose and compatibility come first, limits and pricing last, with no filler sentences. It is dense and single-block rather than scannable, and the pricing clause is long, but every clause carries information an agent needs before paying for a call.

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 covers the return shape (root plus proof per entry, loadable by StandardMerkleTree.load) and verification path (MerkleProof.verify). Combined with limits and cost, an agent has everything needed to call it correctly.

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: default types are inferred from rows (address,uint256 or address), double-keccak leaves with sorted pairs, and raw bytes32 leaves are accepted. The proofFor cap of 256 entries also contextualizes that parameter beyond its schema text.

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 opening states a concrete verb and resource: 'Build a Merkle tree ... get the root and a proof per entry.' The OpenZeppelin-compatible framing and the 'reads or computes only' clause make it obviously distinct from the verification sibling without needing to name it.

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 usage context, and the caps ('Up to 2,000 values; proofs for the first 256 or the one you ask for') tell the agent when the tool is and isn't sufficient. It stops short of naming when to switch to merkle_verify for checking an existing proof, so no explicit alternative routing.

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