feat: add memory management tools and utility commands
This commit is contained in:
@@ -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))
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user