Skip to main content
Glama

IA-QA — 152 QA & Dev Tools for AI Agents

hallucination_check

Read-onlyIdempotent

Lexical hallucination check: verifies an LLM answer's words, numbers and polarity against the provided source/context. Fast, deterministic, no API key needed. Each answer sentence is aligned to its best-matching source sentence, so a number only counts as support when it sits on the SAME statement ("founded in 1998" is not grounded by "sold 1998 units"), and a negation or antonym flip against that sentence returns verdict "contradicted" — the corrupted-fact hallucination that reuses source vocabulary. Limitations: still lexical — it cannot follow a paraphrase, a synonym, or multi-sentence reasoning, so a "well_grounded" verdict means "nothing lexical found", never "verified true". Entailment: run_semantic_tests (NLI/embedding) or a calibrated judge.

Input Schema

NameRequiredDescriptionDefault
casesNoBatch instead of answer + context: one result per case, and the worst gate overall.
answerNoThe LLM answer to verify (with context).
strictNoEvery sentence must be supported (default false).
contextNoThe source text that should ground it.

Output Schema

NameRequiredDescriptionDefault
detailNo
messageNo
numbersNo
overlapNo
verdictNo
analysisNo
entitiesNo
groundedNo
sentenceNo
total_wordsNo
matched_wordsNo
contradictionsNo
grounded_countNo
unbound_claimsNo
grounding_scoreNo
total_sentencesNo
ungrounded_countNo
unsupported_claimsNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed6 schema fields changed
    • addedInput schema / examples
      Added value: +[
      +  {
      +    "answer": "Le remboursement prend plus de 7 jours ouvrés.",
      +    "context": "Le remboursement prend plus de 7 jours ouvrés."
      +  }
      +]
    • changedInput schema / properties / answer / description
      Previous value: -"The LLM-generated answer to verify"New value: +"The LLM answer to verify (with context)."
    • addedInput schema / properties / cases
      Added value: +{
      +  "description": "Batch instead of answer + context: one result per case, and the worst gate overall.",
      +  "items": {
      +    "properties": {
      +      "answer": {
      +        "type": "string"
      +      },
      +      "context": {
      +        "type": "string"
      +      },
      +      "id": {
      +        "type": "string"
      +      }
      +    },
      +    "required": [
      +      "answer",
      +      "context"
      +    ],
      +    "type": "object"
      +  },
      +  "maxItems": 50,
      +  "type": "array"
      +}
    • changedInput schema / properties / context / description
      Previous value: -"The source/reference text that should ground the answer"New value: +"The source text that should ground it."
    • changedInput schema / properties / strict / description
      Previous value: -"If true, every sentence in the answer must be supported (default: false)"New value: +"Every sentence must be supported (default false)."
    • removedInput schema / required
      Removed value: -[
      -  "answer",
      -  "context"
      -]
  2. Changed2 schema fields changed
    • addedOutput schema / properties / contradictions
      Added value: +{}
    • addedOutput schema / properties / unbound_claims
      Added value: +{}
  3. Changed1 schema field changed
    • addedOutput schema / properties
      Added value: +{
      +  "analysis": {},
      +  "detail": {
      +    "type": "string"
      +  },
      +  "entities": {},
      +  "grounded": {
      +    "type": "boolean"
      +  },
      +  "grounded_count": {
      +    "type": "number"
      +  },
      +  "grounding_score": {},
      +  "matched_words": {
      +    "type": "number"
      +  },
      +  "message": {
      +    "type": "string"
      +  },
      +  "numbers": {},
      +  "overlap": {
      +    "type": "number"
      +  },
      +  "sentence": {},
      +  "total_sentences": {
      +    "type": "number"
      +  },
      +  "total_words": {
      +    "type": "number"
      +  },
      +  "ungrounded_count": {
      +    "type": "number"
      +  },
      +  "unsupported_claims": {},
      +  "verdict": {
      +    "type": "string"
      +  }
      +}
  4. Changed1 schema field changed
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "additionalProperties": true,
      +  "type": "object"
      +}
  5. First observed

TDQS

Score is being calculated.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.