Skip to main content
Glama

Run Hallucination Detection Benchmark

prove_zero_hallucination

Runs a fixed 60-scenario benchmark to measure code hallucination detection and false-positive rates before or after changes, using local repository ground truth and offline execution.

Instructions

Runs a fixed 60-scenario hallucination detection benchmark, distinguishing from 'heal_hallucinated_code' for a single candidate snippet and 'audit_code_quality' for repository findings. Results apply only to the tested cases and do not prove absence of other hallucinations.

Parameters:

  • workspace_dir (str, optional, default='.'): Target repository root directory containing ground-truth AST symbol definitions.

  • export_docs (bool, optional, default=True): When True, updates docs/ZERO_HALLUCINATION_PROOF.md and docs/zero_hallucination_proof.json.

Behavior:

  • Mutability: export_docs=True writes benchmark artifacts in docs/ relative to the server working directory; False avoids those writes.

  • Idempotency: Report timestamps and measured latencies may differ between runs.

  • 100% Offline: Operates entirely locally with zero external network access.

  • Auth & Rate Limits: Zero authentication or cloud credentials required; completes in <100ms.

  • Error Handling: Emits clean verification status and confusion matrix.

Usage Guidelines:

  • When to use: Measure detection and false-positive rates on the bundled scenarios before or after changes.

  • When NOT to use: Do not use for inspecting a single candidate snippet (use 'heal_hallucinated_code' instead); do not use for secret scans (use 'verify_security_guard' instead).

Returns: Markdown benchmark results with case counts, detection and false-positive rates, and latency.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "prove_zero_hallucination"
  }
}

Input Schema

NameRequiredDescriptionDefault
export_docsNoWhether to write ZERO_HALLUCINATION_PROOF.md to docs/.
workspace_dirNoTarget repository root directory (default: current directory)..

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv11.14.0

TDQS

A4.4/5.0
Behavior3/5

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

The annotations already declare the key profile (readOnlyHint=false, destructiveHint=false, idempotentHint=false, openWorldHint=false), and the description usefully explains WHY it is not read-only: export_docs=True writes docs artifacts, mitigated by export_docs=False. It also adds offline operation, no auth, and <100ms latency, corroborating the non-idempotency claim with a reason (differing timestamps and latencies). It stops short of describing output structure in depth, which the output schema covers anyway.

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?

Front-loaded purpose sentence followed by clearly labeled behavior, usage, and return sections, so it scans fast. Slightly over-structured for a two-parameter tool, and the 'Returns' paragraph is partly redundant given the output schema.

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 two-parameter benchmark tool, it covers scope, side effects of both parameter values, determinism, network/auth requirements, and failure reporting. Nothing an agent needs in order to call this correctly is missing.

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?

The schema documents both parameters at 100%, so the baseline is 3. It earns more 'workspace_dir' contains ground-truth AST symbol definitions, which is essential context, and 'export_docs' writes TWO artifacts (the JSON report as well as the Markdown), extending what the schema states.

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?

States a specific verb and resource ('Runs a fixed 60-scenario hallucination detection benchmark') and immediately distinguishes itself from 'heal_hallucinated_code' (single snippet) and 'audit_code_quality' (repository findings). Scope is also bounded explicitly: results apply only to the tested cases.

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?

Provides explicit 'When to use' (measuring detection and false-positive rates before or after changes) and 'When NOT to use' sections naming two concrete alternatives for two concrete scenarios. No inference is required to pick the right tool.

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