1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
//! MCP tools for hallucination detection and documentation validation
//!
//! Exposes Sprint 37's hallucination detection system via MCP to enable
//! AI agents to validate documentation claims against the actual codebase.
//!
//! Based on peer-reviewed research:
//! - Semantic Entropy (Farquhar et al., Nature 2024)
//! - MIND framework (IJCAI 2025)
//! - Unified Detection Framework (Complex & Intelligent Systems 2025)
use super::*;
use crate::agents::registry::AgentRegistry;
use crate::services::hallucination_detector::{
ClaimExtractor, CodeFactDatabase, HallucinationDetector, ValidationStatus,
};
use serde_json::json;
use std::path::PathBuf;
use std::sync::Arc;
/// Validate documentation tool - checks documentation claims against codebase
pub struct ValidateDocumentationTool {
_registry: Arc<AgentRegistry>,
}
impl ValidateDocumentationTool {
pub fn new(registry: Arc<AgentRegistry>) -> Self {
Self {
_registry: registry,
}
}
}
/// Check single claim tool - validates a single claim against codebase
pub struct CheckClaimTool {
_registry: Arc<AgentRegistry>,
}
impl CheckClaimTool {
pub fn new(registry: Arc<AgentRegistry>) -> Self {
Self {
_registry: registry,
}
}
}
include!("hallucination_detection_tools_validate.rs");
include!("hallucination_detection_tools_check.rs");
include!("hallucination_detection_tools_tests.rs");