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
//! Universal Tool Framework (UTF) Procedural Macros
//!
//! This crate provides the procedural macros that power UTF's code generation.
//! Users should depend on `universal-tool-core`, not this crate directly.
//!
//! See `parser.rs` for detailed documentation on the feature propagation system.
use TokenStream;
/// The main attribute macro for defining universal tools.
///
/// This macro will generate interface-specific methods (CLI, REST, MCP)
/// from your tool implementation.
///
/// # Example
///
/// ```ignore
/// #[universal_tool_router]
/// impl MyTools {
/// #[universal_tool(description = "Analyze code for quality metrics")]
/// async fn analyze_code(
/// &self,
/// path: String,
/// detailed: Option<bool>
/// ) -> Result<AnalysisResult, ToolError> {
/// // Your business logic here
/// }
/// }
/// ```
/// Attribute macro for individual tool methods within a universal_tool_router impl block.
// Note: universal_tool_param is not a proc macro attribute!
// It's an inert helper attribute that gets parsed by universal_tool_router.
// This allows it to be used on function parameters, which Rust doesn't allow
// for arbitrary proc macro attributes.