Skip to main content
Glama

Server-side ed25519 receipt verifier

emem_verify_receipt
Read-onlyIdempotent

Verify signed receipts server-side when the in-browser path is blocked or for audits. Rebuilds canonical preimage, checks ed25519 signature and Merkle proof, and reports why a receipt is invalid.

Instructions

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.
Behavior5/5

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

Despite readOnlyHint and other annotations, the description adds substantial behavioral context: v2 binds the inclusion proof so any reshaping looks like tampering, returns 200 with valid:false for structurally-well-formed bad signatures (never 4xx), names the two omissions that silently cause verification failure, and explains the advisory nature of key_epoch_advisory. It also clarifies the distinction between 'receipt_reshaped_after_signing' and 'signature_invalid' when the fact is held.

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 and dense, but it is front-loaded with the core purpose and return shape, and uses labeled sections ('When to use') to organize a high volume of necessary caveats. While verbose, every sentence earns its place for a complex cryptographic verification tool; a slightly tighter structure would make it a 5.

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?

With no output schema, the description enumerates all return fields, explains version-specific preimage rules, failure modes, exact omission behaviors, and provides a full example. It is sufficiently complete for an agent to invoke the tool correctly in varied contexts, including edge cases.

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 baseline is 3, but the description adds semantic depth beyond the schema: it clarifies tolerated spellings (byte[] vs b32), the consequence of omitting the facts parameter (only signature checked, doctored fact survives), and the exact behavior of pubkey_b32 override. It also explains that current_responder_epoch only produces an advisory, never a rejection.

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 a specific verb and resource ('Verify a signed receipt envelope server-side'), details the cryptographic process and return fields, and explicitly contrasts with the in-browser /verify path. This clearly distinguishes it from sibling tools like emem_echo_verify and makes the tool's 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 Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description contains a dedicated 'When to use' section that names the exact situations (CDN offline, agent runtime lacks crypto, server-side audit of third-party receipt) and gives explicit instructions on what to pass, what to avoid (omitting merkle_proof or preimage_version, reshaping fields), and when the tool should not be used (offline verifier cannot distinguish reshaping from tampering). This is comprehensive when/when-not guidance.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Vortx-AI/emem'

If you have feedback or need assistance with the MCP directory API, please join our Discord server