Skip to main content
Glama
@odatano/nightgate-mcp

@odatano/nightgate-mcp

Official
by ODATANO

prepare_document_proof

Prepares a structured document for blockchain attestation by computing canonical JSON, payload hash, Merkle root, and per-field inclusion proofs.

Instructions

Turn a structured document into everything the proof tools need: canonical JSON and its payloadHash (what anchor_document anchors), a Merkle contentRoot over an ORDERED list of up to 32 proof fields (16 on a 16-slot attestation-vault), and per-field inclusion paths ready for the proveField* calls of submit_vault_call. kind "uint" (default) scales a numeric value; kind "bytes" enters a STRING field as the digest of the exact string, feeding the equality/membership proofs. Keep the field order stable across anchor and proof: it is part of the tree identity. Compute-only and synchronous, nothing is stored server-side. Leaves are SALTED: the response carries a per-field salt (feed it back as fieldSalt / claim salt), the full opening (salt seed + every slot, needed for the cross-root proofs) and schemaId (anchor it alongside the root). STORE the opening with the document: losing the salt seed makes the anchored root unprovable, publishing it makes leaf hashes guessable. Pass saltSeed to reproduce an EXISTING anchored root byte-for-byte; omit it for a fresh document. The returned fields carry witness material (scaled values / digests / salts): treat as sensitive. Store canonicalDocument at your storageRef; re-serializing with different key order will not re-hash equal.

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": {
      "document": "<document>",
      "proofFields": "<proofFields>"
    },
    "name": "prepare_document_proof"
  }
}

Input Schema

NameRequiredDescriptionDefault
documentYesThe full document as a JSON object; all of it goes into payloadHash
saltSeedNoReuse a stored salt seed to reproduce an already-anchored root; omit for a fresh document (random seed)
proofFieldsYesORDERED list of fields to make provable (leaf index = position). Up to 32 on the default attestation-vault-32, up to 16 with compiledArtifactRef attestation-vault
compiledArtifactRefNoContract artifact ref, defaults to 'attestation-vault-32'; 'attestation-vault' for a 16-slot vault

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv0.23.0
    • changedInput schema / properties / proofFields / description
      Previous value: -"ORDERED list of fields to make provable (leaf index = position). Up to 16 on the default vault, up to 32 with compiledArtifactRef attestation-vault-32"New value: +"ORDERED list of fields to make provable (leaf index = position). Up to 32 on the default attestation-vault-32, up to 16 with compiledArtifactRef attestation-vault"
  2. Changed9 schema fields changedv0.18.3
    • removedInput schema / additionalProperties
      Removed value: -false
    • changedInput schema / properties / compiledArtifactRef / description
      Previous value: -"Contract artifact ref, defaults to 'attestation-vault'"New value: +"Contract artifact ref, defaults to 'attestation-vault-32'; 'attestation-vault' for a 16-slot vault"
    • addedInput schema / properties / document / propertyNames
      Added value: +{
      +  "type": "string"
      +}
    • changedInput schema / properties / proofFields / description
      Previous value: -"ORDERED list of fields to make provable (leaf index = position)"New value: +"ORDERED list of fields to make provable (leaf index = position). Up to 16 on the default vault, up to 32 with compiledArtifactRef attestation-vault-32"
    • removedInput schema / properties / proofFields / items / additionalProperties
      Removed value: -false
    • addedInput schema / properties / proofFields / items / properties / kind
      Added value: +{
      +  "description": "Leaf kind: 'uint' (default, numeric scaled value) or 'bytes' (string value entered as digest of the exact string)",
      +  "enum": [
      +    "uint",
      +    "bytes"
      +  ],
      +  "type": "string"
      +}
    • changedInput schema / properties / proofFields / items / properties / scale / description
      Previous value: -"Value scale (default 1000: milli-units)"New value: +"Value scale (default 1000: milli-units); only valid for kind 'uint'"
    • changedInput schema / properties / proofFields / maxItems
      Previous value: -16New value: +32
    • addedInput schema / properties / saltSeed
      Added value: +{
      +  "description": "Reuse a stored salt seed to reproduce an already-anchored root; omit for a fresh document (random seed)",
      +  "pattern": "^[0-9a-fA-F]{64}$",
      +  "type": "string"
      +}
  3. First observedv0.1.0

TDQS

A3.9/5.0
Behavior3/5

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

No annotations are supplied, so the description carries the full load. It does this well on the operational side—declares compute-only, synchronous, no server-side storage—and warns that leaves are salted, the opening must be stored, and publishing the seed makes hashes guessable. Remaining gaps are the return shape details (how inclusion paths are keyed) which no output schema covers.

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?

Dense but front-loaded: the product (hashes, root, paths) comes first, then the kind semantics, then the salt/opening warnings. Nearly every clause carries operational information, though the salt paragraph runs long and could be tightened.

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?

For a 4-parameter compute tool with no output schema, the description covers inputs, determinism guarantees, secret-handling, and downstream consumers. It never lists the response keys in structured form, so an agent still has to discover the exact return shape (opening, salt, schemaId, fields) from prose rather than schema.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/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, and the description largely restates schema facts (kind uint/bytes, saltSeed reproduction). It does add genuinely new meaning: field order is part of tree identity and must be stable across anchor and proof, and re-serializing the canonicalDocument in a different key order will not re-hash equal.

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 ('turn a structured document into...') and enumerates exactly what is produced: canonical JSON, payloadHash, Merkle contentRoot, and per-field inclusion paths. It names the consuming siblings (anchor_document, proveField* of submit_vault_call), so an agent can place it in the workflow without opening the 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?

Explicitly frames this as the compute step that feeds anchor_document and submit_vault_call, and gives concrete conditions: pass saltSeed to reproduce an existing anchored root, omit it for a fresh document. It does not contrast against the similarly-named prepare_membership_set, so the boundary between the two prep tools is left implicit.

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