ares/tools/mod.rs
1//! Built-in Tools for Agent Capabilities
2//!
3//! This module provides the tool infrastructure that enables agents to perform
4//! actions beyond text generation, such as calculations and web searches.
5//!
6//! # Module Structure
7//!
8//! - [`calculator`](crate::tools::calculator) - Mathematical expression evaluation
9//! - [`search`](crate::tools::search) - Web search integration (DuckDuckGo, Brave, etc.)
10//! - [`registry`](crate::tools::registry) - Tool registration and discovery
11//!
12//! # Available Tools
13//!
14//! ## Calculator
15//! Evaluates mathematical expressions safely:
16//! ```ignore
17//! let result = calculator::evaluate("2 + 2 * 3")?; // Returns 8
18//! ```
19//!
20//! ## Web Search
21//! Searches the web and returns relevant results:
22//! ```ignore
23//! let results = search::web_search("rust programming", 5).await?;
24//! for result in results {
25//! println!("{}: {}", result.title, result.url);
26//! }
27//! ```
28//!
29//! # Tool Registry
30//!
31//! The [`registry`](crate::tools::registry) module manages tool discovery and execution:
32//! ```ignore
33//! let registry = ToolRegistry::default();
34//! let tools = registry.list_tools(); // Get available tool schemas
35//! let result = registry.execute("calculator", json!({"expr": "2+2"})).await?;
36//! ```
37//!
38//! # MCP Integration
39//!
40//! Tools can also be provided via MCP (Model Context Protocol) servers.
41//! See the `mcp` module for external tool integration.
42
43/// Calculator tool for arithmetic operations.
44pub mod calculator;
45/// Tool registry for managing available tools.
46pub mod registry;
47/// MCP→ToolRegistry bridge: registers MCP client operations as agent-callable tools.
48#[cfg(feature = "mcp")]
49pub mod mcp_bridge;
50/// Web search tool using DuckDuckGo (requires `search-tools` feature).
51#[cfg(feature = "search-tools")]
52pub mod search;
53/// Web scraping tool — fetch URL, extract readable text (requires `search-tools` feature).
54#[cfg(feature = "search-tools")]
55pub mod web_scrape;