cerebro 1.1.8

A blazing-fast AI memory layer that enables teams of specialized agents to collaborate through a shared cognitive architecture.
Documentation
//! # Swarm Tools
//!
//! Framework for agents to invoke capabilities via LLM function calling.

use super::agent::ToolDefinition;
use crate::traits::Result;
use async_trait::async_trait;
use serde_json::Value;
use std::fmt::Debug;

/// Trait for defining a tool that an agent can execute.
#[async_trait]
pub trait AgentTool: Send + Sync + Debug {
    /// Provide the definition (name, description, schema) of the tool.
    fn definition(&self) -> ToolDefinition;

    /// Execute the tool with the given JSON arguments.
    async fn execute(&self, args: Value) -> Result<String>;
}