Skip to main content

forgeai_tools/
lib.rs

1use serde_json::Value;
2
3#[derive(Debug, thiserror::Error)]
4pub enum ToolError {
5    #[error("tool not found: {0}")]
6    NotFound(String),
7    #[error("tool execution failed: {0}")]
8    Execution(String),
9}
10
11pub trait ToolExecutor: Send + Sync {
12    fn call(&self, name: &str, input: Value) -> Result<Value, ToolError>;
13}