Skip to main content
Glama

groundcheck_detect_hallucinations

Read-only

Identify unsupported or contradicted claims in a RAG answer by comparing it to source texts. Returns exact spans and failing source passages for targeted corrections.

Instructions

Find only the unsupported or contradicted claims in answer.

Use this in a fix-it loop where you only care about what's wrong, not a
full faithfulness report -- for the full picture with a score and every
claim's verdict, use groundcheck_evaluate_faithfulness instead.

Args:
    answer: the RAG-generated answer text to check.
    sources: list of {id, text} chunks the answer was generated from.

Returns an empty list if the answer is clean. Otherwise, each entry has
the exact answer span, the closest source passage that fails to support
it, and a one-line reason. Costs 2 model calls via your client's
sampling -- no API key needed if your client supports sampling.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
answerYes
sourcesYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
hallucinationsYesEmpty list means the answer is clean.
Behavior4/5

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

Annotations indicate readOnlyHint=true and destructiveHint=false, but the description goes beyond by explaining return behavior (empty list if clean), entry structure, and cost (2 model calls, no API key needed if client supports sampling). No contradictions.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is concise and well-structured: brief purpose, usage distinction, parameter explanations, and return value description. No fluff.

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?

Given the tool has an output schema, the description sufficiently explains the return format (empty list or entries with span, closest source, reason) and usage context. Complete for the intended purpose.

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?

Input schema has 0% description coverage, but the description's Args section provides clear definitions for both parameters: answer as 'RAG-generated answer text' and sources as 'list of {id, text} chunks'. This compensates for the schema's lack of descriptions.

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 clearly states the tool finds unsupported or contradicted claims in an answer. It distinguishes itself from the sibling tool groundcheck_evaluate_faithfulness by specifying this tool is for a fix-it loop focusing only on wrong claims.

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 explicitly tells when to use this tool ('fix-it loop where you only care about what's wrong') and when to use the alternative ('for the full picture with a score and every claim's verdict, use groundcheck_evaluate_faithfulness').

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/offquestxo/groundcheck'

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