use crate::error::Result;
use async_trait::async_trait;
use rmcp::model::Tool;
use serde::{Deserialize, Serialize};
use serde_json::Value;
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct ToolInfo {
pub name: String,
pub description: String,
pub input_schema: Value,
}
#[derive(Debug, Clone, Default)]
pub struct StorageRequirements {
pub stable_memory: Option<u64>,
pub requires_persistence: bool,
}
#[async_trait]
pub trait IcarusTool: Send + Sync {
fn info(&self) -> ToolInfo;
fn to_rmcp_tool(&self) -> Tool;
fn requires_stable_storage(&self) -> bool {
false
}
fn storage_requirements(&self) -> StorageRequirements {
StorageRequirements::default()
}
async fn execute(&self, args: Value) -> Result<Value>;
}