Skip to main content
Glama

Check whether the citations in a draft actually verify

emem_guard_verdict
Read-onlyIdempotent

Check any text for unresolved emem citations before you send it; get an allow/deny verdict with a fix code that tells you how to repair the problem.

Instructions

Run emem-guard's policy pipeline over text you are about to send, against this responder's corpus. Finds every emem: citation, resolves each one, and returns allow or deny with a machine-readable reason: EMEM-GUARD DENY <CODE> token=<token|-> fix=<fix> leaf=<leaf|->. Codes are PROV_SIG (signature did not verify), PROV_BYTES (resolved to different content than claimed), PROV_DRIFT (reading has moved past its band threshold), CLAIM_UNGROUNDED (a measurable claim with no citation, opt-in via claim_gating). fix is the actionable half: refresh_token, remove_reference, contact_admin, cite_observation. ADVISORY: nothing is blocked, and a citation this responder does not hold is never a denial, because it is indistinguishable from one minted elsewhere. Memory algebra: the verify operation (https://emem.dev/docs/model.html).

When to use: Call it on your own draft before you assert something, or on a tool result before you reason on it, to catch a citation that does not resolve while you can still fix it. Set claim_gating:true to also be told which measurable claims carry no citation at all and which emem band would answer them. Checking a payload some other framework produced (a CloudEvent, an OPA input, an OpenAI moderations body, another server's tool call)? Send it as-is and name its shape, because the default reader only sees texts/messages and a check that read nothing still answers allow. To ENFORCE this rather than consult it, run your own node: emem_guard_selfhost returns the procedure, and it works across Anthropic Inference hooks, Claude Code hooks, MCP tool calls, OpenAI-shaped clients, CloudEvents and OPA-style policy clients.

Example arguments: {"texts":["Elevation there is 918 m per emem:fact:defi.zb493.xuqA.zcb5f:yqbolgeoycqkvj3zkxukb4bjw4odhpwvfzqo3fbgwf4spk45zala"]}

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
agentNoOptional free-text label for who is asking. Advisory only, never a trust boundary.
shapeNoWhich envelope YOUR payload is in, so you never have to reshape it to ask the question: send the body your own framework produced and name its shape. native reads `texts`/`messages`; `mcp` reads a JSON-RPC tools/call or tool result; `openai` reads a moderations (`input`) or chat-completions body; `cloudevent` reads a CloudEvents 1.0 structured event; `policy` reads {input}. It matters: a CloudEvent whose citation sits at data.text is invisible to the native reader, and a check that read nothing answers `allow`, so confirm `citations_found` matches what you sent. Unrecognised values fall back to native rather than erroring. This selects how the body is READ only — the verdict always comes back in this tool's declared output shape, because a tool that declares an outputSchema owes conforming structuredContent. To get the ANSWER translated into the same envelope too (an OPA `result:{allow,deny}`, an MCP CallToolResult to substitute on a deny), call POST /v1/guard/verdict?shape=… directly.native
textsNoFree text to check. Any number of pieces, in any order: a draft answer, a tool result, a whole turn.
messagesNoA chat-completions-shaped transcript, read for its text. Accepted so the same body works against a self-hosted emem-guard node and against any OpenAI-shaped client. Each item is {role, content} where content is a string or an array of blocks.
claim_gatingNoAlso flag measurable physical-world claims that carry NO citation (deny code CLAIM_UNGROUNDED, fix cite_observation). Off by default: it reports on the absence of a citation rather than on a failed check. The verdict names the sentence, the magnitude, and the emem band that would answer it.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
fixNoThe actionable half: what to change and retry.
codeNoPresent only on a deny.
claimNoOn CLAIM_UNGROUNDED: the sentence, magnitude, quantity, anchor, and source_band. source_band is a recallable band key, or null when this responder observes no band in that quantity.
actionYesNOT a clearance. `allow` means no rule fired, which on a transcript that cited nothing is silence rather than approval. Branch on citations_found and receipt.fact_cids.
checkedYesHow many were actually resolved, bounded by the verdict budget.
receiptYesed25519 receipt. `fact_cids` lists what actually resolved and is the field that separates a real citation from an invented one.
advisoryYesTrue on the hosted route, where nothing is blocked. Run your own node to enforce.
citations_foundYesHow many emem: tokens were found in the text. Compare with receipt.fact_cids: a well-formed token that resolved to nothing counts here and not there.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv1.3.9
  2. Removedv1.3.8
  3. Changed1 schema field changedv1.3.4
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "properties": {
      +    "action": {
      +      "description": "NOT a clearance. `allow` means no rule fired, which on a transcript that cited nothing is silence rather than approval. Branch on citations_found and receipt.fact_cids.",
      +      "enum": [
      +        "allow",
      +        "deny"
      +      ],
      +      "type": "string"
      +    },
      +    "advisory": {
      +      "description": "True on the hosted route, where nothing is blocked. Run your own node to enforce.",
      +      "type": "boolean"
      +    },
      +    "checked": {
      +      "description": "How many were actually resolved, bounded by the verdict budget.",
      +      "type": "integer"
      +    },
      +    "citations_found": {
      +      "description": "How many emem: tokens were found in the text. Compare with receipt.fact_cids: a well-formed token that resolved to nothing counts here and not there.",
      +      "type": "integer"
      +    },
      +    "claim": {
      +      "description": "On CLAIM_UNGROUNDED: the sentence, magnitude, quantity, anchor, and source_band. source_band is a recallable band key, or null when this responder observes no band in that quantity.",
      +      "type": "object"
      +    },
      +    "code": {
      +      "description": "Present only on a deny.",
      +      "enum": [
      +        "PROV_SIG",
      +        "PROV_BYTES",
      +        "PROV_DRIFT",
      +        "PROV_VALUE",
      +        "GEO_ZONE",
      +        "CLAIM_UNGROUNDED",
      +        "POLICY_MODULE"
      +      ],
      +      "type": "string"
      +    },
      +    "fix": {
      +      "description": "The actionable half: what to change and retry.",
      +      "enum": [
      +        "refresh_token",
      +        "remove_reference",
      +        "contact_admin",
      +        "redact_and_retry",
      +        "cite_observation",
      +        "correct_value"
      +      ],
      +      "type": "string"
      +    },
      +    "receipt": {
      +      "description": "ed25519 receipt. `fact_cids` lists what actually resolved and is the field that separates a real citation from an invented one.",
      +      "type": "object"
      +    }
      +  },
      +  "required": [
      +    "action",
      +    "advisory",
      +    "checked",
      +    "citations_found",
      +    "receipt"
      +  ],
      +  "type": "object"
      +}
  4. Addedv1.3.3

TDQS

A4.8/5.0
Behavior5/5

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

Annotations already declare readOnly/idempotent/non-destructive, so the bar is lower, yet the description adds substantial behavioral context: the ADVISORY that nothing is blocked, that a citation this responder does not hold is never a denial, and critically that 'a check that read nothing still answers allow.' It also discloses exact deny codes and fix semantics. This is exactly the kind of subtle behavior an agent must know before relying on the result.

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 information-dense, and every section earns its place: output format, codes, advisory, when-to-use, shape caveats, enforcement alternative, example. The core purpose and machine-readable output are front-loaded before the caveats. It loses one point only because a few asides (the memory-algebra link, the selfhost integration list) are tangential for a single invocation decision.

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?

For a tool with 5 parameters, an output schema, and subtle behavioral traps, the description is remarkably complete. It covers the exact output string format, all deny codes and fixes, the advisory open-world behavior, empty-read behavior, cross-framework payload handling, the enforcement alternative, and a worked example. An agent has everything needed to call this correctly and interpret the result.

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. The description earns a 4 by adding practical semantics beyond the schema: a concrete example argument, the rationale for claim_gating ('reports on the absence of a citation rather than on a failed check'), and the practical consequence of shape selection ('a CloudEvent whose citation sits at data.text is invisible to the native reader'). It also clarifies that shape only affects reading, not the output envelope.

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: 'Run emem-guard's policy pipeline over text you are about to send, against this responder's corpus,' then specifies exactly what happens (finds every emem: citation, resolves each one, returns allow or deny). It differentiates from siblings by framing this as the consult-inline tool versus emem_guard_selfhost for enforcement, and by the draft-checking scenario, which none of the sibling names suggest.

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?

Explicit 'When to use' guidance names concrete triggers: call on your own draft before asserting something, or on a tool result before reasoning on it. It also gives explicit when-not-to-use guidance: 'To ENFORCE this rather than consult it, run your own node: emem_guard_selfhost returns the procedure.' The shape parameter guidance further clarifies when to set non-native shapes versus sending native texts/messages.

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