Skip to Content

Sarek MCP Tools

The server exposes three tools, advertised through tools/list. Names are snake_case and action-oriented. Every input is validated against a strict schema before anything reaches Sarek: unknown fields are rejected, and malformed input comes back as an actionable error instead of a failed upstream call.

sarek_stamp

Stamps a pre-computed SHA3-256 hash on-chain and returns a verifiable proof.

This tool takes a hash, not raw data. The agent hashes its data locally first so that raw data never leaves its environment in cleartext.

Parameters

NameTypeRequiredDescription
hashstringYesThe SHA3-256 hash of your data as 64 lowercase hex characters. This is the data to be stamped on-chain.

Returns

FieldTypeDescription
tx_hashstringOn-chain transaction hash of the stamp.
ldgpstringBase64-encoded .ldgp proof for the stamped hash.
mmr_rootstringThe root that was stamped on-chain.
block_numbernumberBlock the stamp landed in, when known.
on_chainbooleanWhether the stamp is confirmed on-chain.

Example

// input { "hash": "9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08" }
// result { "tx_hash": "0x4a7c2f...e91b", "ldgp": "VEVSSFVB...base64...", "mmr_root": "c1d2e3...f0", "block_number": 10789522, "on_chain": true }

Errors

Sending anything other than a 64-character lowercase hex hash returns an actionable validation error telling the agent to hash its data locally first, without ever contacting Sarek. Re-stamping a hash that already exists returns The resource already exists.

sarek_stamp is the one write operation. It is marked idempotent (the same hash resolves to the same stamp) and is not read-only.

sarek_verify

Verifies a .ldgp proof against the on-chain record and returns a layered result.

Parameters

NameTypeRequiredDescription
ldgpstringYesThe base64-encoded .ldgp proof, exactly as returned by sarek_stamp or sarek_get_proof.
datastringNoBase64-encoded raw data. When provided, adds the data-integrity layer: Sarek checks that this data hashes to the proof leaf.
hashstringNoA leaf hash (64 lowercase hex) to check for membership in the proof. This is an existing leaf to look for, not data to be stamped.

Returns

FieldTypeDescription
validbooleanOverall verdict across all checked layers.
layersobjectPer-layer breakdown (see below).
leafstringThe leaf hash the proof resolves to, when known.
mmr_rootstringThe root the proof resolves to, when known.

The layers object contains:

FieldTypeDescription
data_integritybooleanRaw data hashes to the proof leaf. Present only when data was supplied.
tree_integritybooleanThe proof’s path reconstructs the stamped root.
on_chainbooleanThe root is anchored on-chain.
on_chain_leafbooleanThe specific leaf is provably included on-chain, when known.
block_numbernumberBlock the stamp was anchored in, when known.
block_datestringISO timestamp of the anchoring block, when known.

Example

// input { "ldgp": "VEVSSFVB...base64...", "data": "TG9hbiAjNDgyMSBhcHByb3ZlZA==" }
// result { "valid": true, "layers": { "data_integrity": true, "tree_integrity": true, "on_chain": true, "on_chain_leaf": true, "block_number": 10789522, "block_date": "2026-06-12T00:00:00.000Z" }, "leaf": "9f86d081...0a08", "mmr_root": "c1d2e3...f0" }

See Verification for what each layer proves and when valid is true.

Errors

A malformed or non-base64 ldgp returns a validation error before any upstream call. sarek_verify is read-only and idempotent.

sarek_get_proof

Fetches the .ldgp proof for a previously stamped hash, base64-encoded and ready to pass to sarek_verify.

Parameters

NameTypeRequiredDescription
hashstringYesThe 64 lowercase hex SHA3-256 hash of a stamped leaf.

Returns

FieldTypeDescription
hashstringThe leaf hash the proof belongs to.
ldgpstringBase64-encoded binary .ldgp proof.

Example

// input { "hash": "9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08" }
// result { "hash": "9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08", "ldgp": "VEVSSFVB...base64..." }

Errors

A hash that was never stamped returns The requested resource was not found. sarek_get_proof is read-only and idempotent.

Last updated on