1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
//! Tool system — define and register tools for agents to call.
//!
//! Tools are the primary way agents interact with the world: calling APIs, reading
//! files, executing code, searching the web, and more.
//!
//! # Defining a Tool — The `#[tool]` Macro
//!
//! The recommended way to define a tool is with the [`#[tool]`](macro@crate::tool) macro:
//!
//! ```rust,no_run
//! use echo_agent::{tool, prelude::*};
//!
//! #[tool(name = "add", description = "Add two numbers")]
//! async fn add(a: f64, b: f64) -> Result<ToolResult> {
//! Ok(ToolResult::success(format!("{}", a + b)))
//! }
//! ```
//!
//! This generates `AddParams`, `AddTool`, and a full `Tool` trait implementation
//! with automatic JSON Schema generation.
//!
//! # Registering Tools
//!
//! ```rust,ignore
//! use echo_agent::prelude::*;
//!
//! # fn main() -> echo_agent::error::Result<()> {
//! let agent = ReactAgentBuilder::new()
//! .model("qwen3-max")
//! .register_tool(Arc::new(AddTool))
//! .build()?;
//! # Ok(())
//! # }
//! ```
//!
//! # Built-in Tools
//!
//! | Module | Tools | Feature |
//! |--------|-------|---------|
//! | [`builtin`] | `ThinkTool`, `FinalAnswerTool`, memory tools, data tools, git, RAG, chart | various |
//! | [`web`] | `WebSearchTool`, `WebFetchTool` | `web` |
//! | [`media`] | `ImageFetchTool`, PDF/Excel/Word tools | `media` |
//! | [`files`] | File read/write/list/delete tools | default |
//! | [`shell`] | Shell command execution (sandboxed) | default |
//!
//! # Key Types
//!
//! | Type | Description |
//! |------|-------------|
//! | [`Tool`] | Trait — implement `name()`, `description()`, `parameters()`, `execute()` |
//! | [`ToolManager`] | Registry — register, list, execute tools with concurrency control |
//! | [`ToolResult`] | `ToolResult::success(...)` / `ToolResult::error(...)` |
//! | [`ToolExecutionConfig`] | Timeout, retry count, max concurrency per tool |
/// Built-in tools (security, think, etc.)
/// File manipulation tools
/// Direct re-exports from `echo_execution::tools`.
pub use ;