Skip to main content
Glama

emem, the verifiable memory protocol for the physical world

Server-side ed25519 receipt verifier

emem_verify_receipt
Read-onlyIdempotent

Verify a signed receipt envelope server-side: rebuilds the canonical preimage under the rule the receipt's OWN preimage_version names (v2, current: tagged length-prefixed segments plus a segment binding the inclusion proof; v1: the same without that segment; absent/0: the legacy request_id | served_at | primitive | cells, | fact_cids, concatenation), runs ed25519 over the embedded pubkey + signature, and returns {valid, reason, failure_detail, signature_valid, merkle_proof_valid, signer_pubkey_b32, preimage_blake3_hex}. A RECEIPT IS BYTE-FOR-BYTE OR NOTHING: v2 binds the proof so it cannot be stripped in transit, and the cost of that is that any reshaping — dropping a field, re-keying it, summarising it — invalidates the signature by design and looks exactly like tampering. Use when the in-browser /verify path is blocked (CDN offline, agent runtime has no crypto) or when you want a server-side audit of a third-party receipt. Memory algebra: the verify operation (https://emem.dev/docs/model.html).

When to use: Pass a receipt object EXACTLY as returned by the read primitive, whole and unmodified (signature can be byte[] or sig_b32; pubkey can be byte[] or responder_pubkey_b32, the verifier tolerates those two spellings and nothing else). Do not omit merkle_proof, and do not reshape any field: under preimage_version 2 that returns signature_valid: false on data nobody tampered with. Exactly two omissions reach this failure rather than a 400: merkle_proof and preimage_version (whose absence deserialises to 0 and silently selects the v0 rule, so the inclusion proof still walks while the signature reads as forged). When this responder holds the cited fact it can tell reshaping from tampering and says so — reason: receipt_reshaped_after_signing with a failure_detail naming the field, instead of signature_invalid — but it never accepts such a receipt, and an offline verifier has no way to make that distinction at all. Optionally override pubkey_b32 to assert verification against a specific signer. Returns 200 with valid: false when the signature fails, never 4xx for a structurally-well-formed bad signature.

Example arguments: {"receipt":{"primitive":"recall","served_at":"2026-05-14T12:00:00Z","request_id":"req-1","cells":["damO.zb000.xUti.zde78"],"fact_cids":["qbq2dy7adyuvozs7s3gqg5jnpkcwq2duegltjyhbxsivuqbpjofq"],"signature":[1,2,3],"responder_pubkey":[4,5,6]}}

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
factsNoThe fact value(s) you intend to rely on. Each is content-addressed and checked for membership in the receipt's `fact_cids`, so a genuine receipt presented beside a tampered fact answers `valid:false` / `fact_mismatch`. Omit it and only the signature is checked, which a doctored fact survives.
receiptYesThe signed receipt envelope (as returned by any read primitive). Must carry primitive/served_at/request_id/cells/fact_cids and either `signature` byte[] + `responder_pubkey` byte[] or their b32 string forms.
pubkey_b32NoOptional explicit responder pubkey (base32). When omitted, uses the receipt's embedded pubkey/responder fields.
current_responder_epochNoThe responder key epoch you currently trust, from `/v1/manifests`. Produces an advisory `key_epoch_advisory` comparison against the receipt's epoch; a mismatch is reported, never rejected.

TDQS

A4.7/5.0
Behavior5/5

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

Beyond the read-only and idempotent hints, the description discloses crucial behavioral details: the byte-for-byte verification rule, preimage_version handling (v2/v1/absent), the distinction between reshaping and tampering with specific failure reasons, the 200-with-valid:false behavior for bad signatures versus 4xx, and the effect of omitting merkle_proof or preimage_version. This richness significantly exceeds the annotations.

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 long but well-structured with clear paragraphs and a logical flow from purpose to usage to example. While some points are repeated (e.g., byte-for-byte warning appears twice), each section adds substantial value, and the length is justified by the complexity of the verification semantics. It is slightly verbose but not wasteful.

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 tool has no output schema, so the description must explain return values, and it does: it lists all seven fields in the response object. It also covers failure modes, edge cases (omitted fields), the effect of optional parameters, and even includes an example. For a complex tool with nested objects and no output schema, the description is outstandingly complete.

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

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Although the schema already covers all parameters, the description adds critical semantics: the two accepted spellings for signature and pubkey, the prohibition on omitting merkle_proof, the advisory nature of current_responder_epoch, and how the facts parameter behaves with a doctored fact. This goes well beyond the schema descriptions and materially aids correct invocation.

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 opens with 'Verify a signed receipt envelope server-side', which is a specific verb+resource statement that clearly identifies the tool's function. It also details the verification algorithm and distinguishes itself from in-browser verification alternatives, making the purpose unambiguous.

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 explicitly states when to use this tool: 'Use when the in-browser /verify path is blocked... or when you want a server-side audit of a third-party receipt.' It also provides detailed 'When to use' instructions about passing the receipt exactly as returned. However, it does not explicitly name an alternative tool or provide a 'when not to use' exclusion, so it falls just short of a 5.

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.

TDQS

A4.3/5.0
Disambiguation4/5

Most tools are sharply distinct, with the entity_* family (mint/resolve/link) and memory_* family (token/bundle/contradictions) explicitly cross-referenced to prevent confusion. The only mild overlap is the verify cluster — emem_echo_verify, emem_verify_receipt, and emem_guard_verdict all touch verification but are well-delineated (value drift vs. cryptographic envelope vs. policy gate) — and emem_intent's type:'ask' row duplicating emem_ask.

Naming Consistency4/5

All tools share the emem_ prefix and snake_case, with systematic sub-families (emem_entity*, emem_memory_token*, emem_verify*) that make relationships predictable. However, the pattern is not uniformly verb_noun: bare nouns (emem_entity, emem_intent, emem_tools, emem_recall) and mixed constructions like emem_echo_verify and emem_find_similar deviate from a single convention.

Tool Count4/5

16 tools is just over the ideal 3-15 range, but the count is deliberate: the server curates a small core loop and provides emem_tools as a discovery meta-tool to reach the broader 108-tool catalog. Each listed tool earns its place in the locate → recall → cite → resolve → verify workflow, so the slight overage feels justified rather than bloated.

Completeness4/5

The full consumption lifecycle is covered: locate (emem_locate), recall (emem_recall), ask (emem_ask), cite (emem_memory_token/bundle), resolve (emem_memory_token_resolve), verify (emem_verify_receipt/echo_verify), with entity identity, contradiction detection, similarity search, and policy guard as extras. Minor gaps exist — emem_diff for pair quantification and emem_recall_polygon for regions are referenced but not in the core list, and there is no write/attest tool (though that appears to be by design for a verifiable memory protocol).