Skip to main content

talos_core/
tool.rs

1//! Agent tool abstraction layer.
2//!
3//! This module defines the [`AgentTool`] trait for implementing pluggable tools,
4//! a [`ToolRegistry`] for dynamic tool registration and lookup, and associated
5//! types for tool execution results and errors.
6
7mod agent_tool;
8mod authorization;
9mod protocol;
10mod registry;
11mod result_presentation;
12
13pub use self::{agent_tool::*, authorization::*, protocol::*, registry::*, result_presentation::*};
14
15/// Helper macro to generate a JSON Schema value from a type that implements
16/// `schemars::JsonSchema`.
17#[macro_export]
18macro_rules! tool_parameters {
19    ($type:ty) => {{
20        let schema = schemars::schema_for!($type);
21        serde_json::to_value(schema).unwrap_or(serde_json::Value::Object(Default::default()))
22    }};
23}
24
25#[cfg(test)]
26mod tests;