refactor: apply zero-unwrap policy and optimize locks in store.rs and handlers
This commit is contained in:
1 parent
9f24e66d88
commit
8afbf97b11
33 files changed
+3127
-3207
No files matched your search
@@ -0,0 +1,16 @@
|
||||
use crate::state::MemoryState;
|
||||
use async_trait::async_trait;
|
||||
use serde_json::Value;
|
||||
use std::sync::Arc;
|
||||
|
||||
#[async_trait]
|
||||
pub trait McpTool: Send + Sync {
|
||||
/// The unique name of the tool
|
||||
fn name(&self) -> &'static str;
|
||||
|
||||
/// The JSON schema for the tool
|
||||
fn schema(&self) -> Value;
|
||||
|
||||
/// Execute the tool with the given arguments
|
||||
async fn execute(&self, args: Value, state: Arc<MemoryState>) -> Result<String, String>;
|
||||
}
|
||||
Reference in new issue
Block a user