feat: add memory management tools and utility commands

This commit is contained in:
asepharyana
2026-07-11 20:44:15 +07:00
parent 08490532d2
commit fe82840c03
13 changed files with 535 additions and 0 deletions
+35
View File
@@ -0,0 +1,35 @@
use serde_json::{json, Value};
use anyhow::Result;
use super::super::Tool;
use super::super::ToolCtx;
pub struct Pong;
impl Tool for Pong {
fn name(&self) -> &'static str {
"pong"
}
fn description(&self) -> &'static str {
"Simple connectivity check. Echoes back any input for health checks and latency testing."
}
fn parameters(&self) -> Value {
json!({
"type": "object",
"properties": {
"message": {
"type": "string",
"description": "Message to echo back"
}
}
})
}
fn run(&self, _ctx: &ToolCtx, args: &Value) -> Result<String> {
let msg = args.get("message")
.and_then(|v| v.as_str())
.unwrap_or("pong");
Ok(format!("pong: {}", msg))
}
}