rskit-tool 0.2.0-alpha.1

Tool definition, auto-wiring, registry and middleware for agentic systems
Documentation
//! 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>;
}