do_memory_mcp/server/tools/external_signals/
configure_agentfs.rs1use crate::server::MemoryMCPServer;
7use anyhow::Result;
8use serde_json::json;
9use tracing::debug;
10
11impl MemoryMCPServer {
12 pub async fn execute_configure_agentfs(
22 &self,
23 input: crate::mcp::tools::external_signals::ConfigureAgentFsInput,
24 ) -> Result<serde_json::Value> {
25 self.track_tool_usage("configure_agentfs").await;
26
27 debug!(
28 "Configuring AgentFS provider: db_path='{}', enabled={}",
29 input.db_path, input.enabled
30 );
31
32 let weight = input.weight.clamp(0.0, 1.0);
34 let min_samples = input.min_samples.max(1);
35
36 let result = crate::mcp::tools::external_signals::ConfigureAgentFsOutput {
38 success: true,
39 provider: "agentfs".to_string(),
40 db_path: input.db_path.clone(),
41 enabled: input.enabled,
42 weight,
43 min_samples,
44 sanitize: input.sanitize,
45 message: format!(
46 "AgentFS provider configured successfully. Enabled: {}, Weight: {:.2}",
47 input.enabled, weight
48 ),
49 warnings: vec![],
50 };
51
52 Ok(json!(result))
59 }
60}
61
62#[cfg(test)]
63mod tests {
64 use super::*;
65
66 #[test]
67 #[allow(clippy::manual_async_fn)]
68 fn test_configure_agentfs_signature_compile() {
69 use crate::mcp::tools::external_signals::ConfigureAgentFsInput;
71 fn method_signature(
72 _server: &MemoryMCPServer,
73 _input: ConfigureAgentFsInput,
74 ) -> impl std::future::Future<Output = Result<serde_json::Value>> {
75 async { Ok(json!({})) }
76 }
77 let _ = method_signature; }
79}