Skip to main content
Glama
@odatano/nightgate-mcp

@odatano/nightgate-mcp

Official
by ODATANO

anchor_document

Anchor a document hash on Midnight in one call: submit an attestation with a sponsor paying the fee and wait for on-chain confirmation. Retry with an idempotency key to resume pending jobs.

Instructions

Anchor a document hash on Midnight in one call: builds the attest transaction here with the caller seed, a sponsor pays the fee, and the tool waits until it landed (about 1 to 2 minutes; the first call also downloads the prover keys). The record belongs to this seed (attesterId). Only the hash and the hash of the metadata go on-chain; keep the document yourself. With contentRoot and schemaId from prepare_document_proof it also anchors the content root, which the field claims of submit_vault_call need. Returns { status, attesterId, payloadHash, contractAddress, metadataJson, txHash, transactionHash, timings, check }; check is the verify_attestation call that shows the record on-chain. If the call was cut off or came back pending, run it again with the same arguments: it picks up the job it started and submits nothing new (the answer says deduplicated). With an idempotencyKey that also holds after a restart of this server. A second, separate call with the same arguments needs a new idempotencyKey.

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": {
      "sha256": "<sha256>"
    },
    "name": "anchor_document"
  }
}

Input Schema

NameRequiredDescriptionDefault
sha256Yessha256 of the document (64 hex); it becomes the payloadHash
metadataNoPublic metadata; its sha256 is anchored with the hash. Default none
schemaIdNoSchema id from prepare_document_proof (64 hex); needs contentRoot
contentRootNoContent root from prepare_document_proof (64 hex); needs schemaId
idempotencyKeyNoDedupes retries of the same anchor
contractAddressNoAttestationVault address (64 hex); default NIGHTGATE_SANDBOX_VAULT, else the shared sandbox vault of the network (preprod, preview)
compiledArtifactRefNoVault lineage, default 'attestation-vault-32' (the sandbox vaults); 'attestation-vault' for a 16-slot vault

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv0.22.0
    • changedInput schema / properties / contractAddress / description
      Previous value: -"AttestationVault address (64 hex); default the shared sandbox vault of the network (preprod, preview)"New value: +"AttestationVault address (64 hex); default NIGHTGATE_SANDBOX_VAULT, else the shared sandbox vault of the network (preprod, preview)"
  2. Changed18 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: +"Vault lineage, default 'attestation-vault-32' (the sandbox vaults); 'attestation-vault' for a 16-slot vault"
    • addedInput schema / properties / compiledArtifactRef / enum
      Added value: +[
      +  "attestation-vault",
      +  "attestation-vault-32"
      +]
    • addedInput schema / properties / contentRoot
      Added value: +{
      +  "description": "Content root from prepare_document_proof (64 hex); needs schemaId",
      +  "pattern": "^[0-9a-fA-F]{64}$",
      +  "type": "string"
      +}
    • removedInput schema / properties / contentType
      Removed value: -{
      -  "description": "MIME type, informational",
      -  "type": "string"
      -}
    • changedInput schema / properties / contractAddress / description
      Previous value: -"AttestationVault deployment to anchor into"New value: +"AttestationVault address (64 hex); default the shared sandbox vault of the network (preprod, preview)"
    • removedInput schema / properties / contractAddress / minLength
      Removed value: -1
    • addedInput schema / properties / contractAddress / pattern
      Added value: +"^[0-9a-fA-F]{64}$"
    • changedInput schema / properties / idempotencyKey / description
      Previous value: -"Dedupes retries of the same anchor request"New value: +"Dedupes retries of the same anchor"
    • changedInput schema / properties / metadata / description
      Previous value: -"Public metadata object; its hash is anchored alongside"New value: +"Public metadata; its sha256 is anchored with the hash. Default none"
    • addedInput schema / properties / metadata / propertyNames
      Added value: +{
      +  "type": "string"
      +}
    • addedInput schema / properties / schemaId
      Added value: +{
      +  "description": "Schema id from prepare_document_proof (64 hex); needs contentRoot",
      +  "pattern": "^[0-9a-fA-F]{64}$",
      +  "type": "string"
      +}
    • removedInput schema / properties / sessionId
      Removed value: -{
      -  "description": "Wallet session id that signs and submits",
      -  "format": "uuid",
      -  "type": "string"
      -}
    • changedInput schema / properties / sha256 / description
      Previous value: -"sha256 of the document content (64 hex), becomes the on-chain payload hash"New value: +"sha256 of the document (64 hex); it becomes the payloadHash"
    • removedInput schema / properties / size
      Removed value: -{
      -  "description": "Content size in bytes, informational",
      -  "minimum": 0,
      -  "type": "integer"
      -}
    • removedInput schema / properties / sponsorSessionId
      Removed value: -{
      -  "description": "Optional second session that pays the dust fee",
      -  "format": "uuid",
      -  "type": "string"
      -}
    • removedInput schema / properties / storageRef
      Removed value: -{
      -  "description": "Where the bytes live, e.g. file://, s3://, ipfs://",
      -  "minLength": 1,
      -  "type": "string"
      -}
    • changedInput schema / required
      Previous value: -[
      -  "sha256",
      -  "storageRef",
      -  "sessionId",
      -  "contractAddress"
      -]New value: +[
      +  "sha256"
      +]
  3. First observedv0.1.0

TDQS

A4.6/5.0
Behavior5/5

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

With no annotations provided, the description carries the full burden and does so well: it discloses that a sponsor pays the fee, the call waits roughly one to two minutes, the first call downloads prover keys, and only the document hash and metadata hash go on-chain. It also explains retry deduplication behavior and persistence across server restarts when idempotencyKey is supplied.

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?

The description is information-dense and front-loads the core action and cost/latency behavior. It is relatively long but most sentences add substantive operational detail; some return-field enumeration could be tightened.

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?

This is a complex, stateful transaction tool with no annotations and no output schema, yet the description covers side effects, sponsorship, latency, on-chain data scope, return shape, retry behavior, and related sibling calls. An agent has enough context to invoke 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 schema already documents each parameter, but the description adds meaningful context: sha256 becomes payloadHash, the metadata hash is anchored alongside it, and contentRoot/schemaId must come from prepare_document_proof. It also clarifies idempotencyKey retry semantics beyond the schema's brief description.

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 description states a specific verb and resource: anchoring a document hash on Midnight in one call. It also distinguishes the tool from prepare_document_proof and verify_attestation by explaining how their outputs and checks fit into this workflow.

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?

The description gives clear workflow context: contentRoot and schemaId come from prepare_document_proof, and the resulting record supports submit_vault_call. It also explains retry and idempotency conditions, though it does not explicitly frame when not to use this tool.

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