Skip to main content
Glama

recompute_merkle_root

Read-onlyIdempotent

Recompute a dokimo-merkle-v1 root locally from a leaf and proof path to verify an evidence package; if the result differs from the stated root, the package was tampered with.

Instructions

Recompute a dokimo-merkle-v1 root locally — no network call, no anchor check.

Hash leaf in the leaf domain (H(0x00 ‖ leaf)) and replay proof_path — a list of [sibling_hash, side] where side is "L" or "R" — hashing internal nodes as H(0x01 ‖ left ‖ right). Compare the returned root to the root in an evidence package yourself; if it differs, the package was tampered with.

Returns {recomputed_root, merkle_scheme, steps}.

Input Schema

NameRequiredDescriptionDefault
leafYesThe raw leaf value (e.g. a JSON string like '{"k":"total_assets","v":"..."}'). Hashed in the leaf domain as H(0x00 ‖ leaf).
proof_pathYesOrdered Merkle proof path: a list of [sibling_hash_hex, side] pairs, where side is "L" if the sibling is on the left or "R" if on the right. Empty list for a single-leaf tree.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.4/5.0
Behavior4/5

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

Annotations already declare readOnlyHint, idempotentHint and openWorldHint=false, but the description adds meaningful context beyond them: the operation is purely local, performs no anchor check, and its output is only useful when compared against the package root. It does not discuss failure modes for malformed proof paths, which keeps it short of a 5.

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 is front-loaded in the first sentence, followed by mechanics and then the return shape, so an agent can stop reading early. The middle paragraph is dense but every clause (domains, side semantics, tamper comparison) does work; a return-shape line plus a hashing explanation is close to the minimum.

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, yet the description explicitly names the return object ({recomputed_root, merkle_scheme, steps}), and annotations cover the safety profile for this read-only, closed-world tool. Nothing an agent needs to invoke it or interpret the result 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% and the field descriptions already document the leaf-domain hash, the [sibling_hash, side] pair shape and the empty-list case. The description nonetheless adds information not in the schema — internal nodes are hashed as H(0x01 ‖ left ‖ right) — which clarifies how proof_path is replayed.

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 first clause gives a specific verb and resource ('Recompute a dokimo-merkle-v1 root locally') and immediately scopes it with 'no network call, no anchor check', which separates it from verify_evidence_package. An agent can pick this tool without opening either schema.

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 states the operative workflow clearly: recompute, then compare the returned root against the root in an evidence package yourself to detect tampering. It does not explicitly name verify_evidence_package as the alternative for anchor-based verification, only negating that capability, so the routing is implied rather than spelled out.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.