1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
//! Callable trait — type-erased tool interface. use async_trait::async_trait; use rskit_errors::AppResult; use rskit_schema::ValidationResult; use crate::context::Context; use crate::definition::Definition; use crate::io::ToolInput; use crate::result::ToolResult; /// Type-erased tool interface for heterogeneous registries. #[async_trait] pub trait Callable: Send + Sync { /// Return the tool's metadata. fn definition(&self) -> &Definition; /// Validate input against the tool's input schema. fn validate(&self, input: &ToolInput) -> ValidationResult; /// Execute the tool with a context and JSON input. async fn call(&self, ctx: &Context, input: ToolInput) -> AppResult<ToolResult>; }