pub struct EnhancedToolMetadata {
pub behavior_hints: ToolBehaviorHints,
pub category: Option<ToolCategory>,
pub performance: Arc<RwLock<ToolPerformanceMetrics>>,
pub deprecation: Option<ToolDeprecation>,
pub version: Option<String>,
pub author: Option<String>,
pub custom: HashMap<String, Value>,
}
Expand description
Comprehensive enhanced metadata for tools
Fields§
§behavior_hints: ToolBehaviorHints
Tool behavior hints for client understanding
category: Option<ToolCategory>
Tool categorization for organization
performance: Arc<RwLock<ToolPerformanceMetrics>>
Performance tracking metrics (using thread-safe interior mutability)
deprecation: Option<ToolDeprecation>
Deprecation information
version: Option<String>
Tool version information
Author/maintainer information
custom: HashMap<String, Value>
Custom metadata fields
Implementations§
Source§impl EnhancedToolMetadata
impl EnhancedToolMetadata
Sourcepub fn with_behavior_hints(self, hints: ToolBehaviorHints) -> Self
pub fn with_behavior_hints(self, hints: ToolBehaviorHints) -> Self
Set behavior hints
Sourcepub fn with_category(self, category: ToolCategory) -> Self
pub fn with_category(self, category: ToolCategory) -> Self
Set category
Sourcepub fn with_version(self, version: String) -> Self
pub fn with_version(self, version: String) -> Self
Set version
Set author
Sourcepub fn with_custom_field(self, key: String, value: Value) -> Self
pub fn with_custom_field(self, key: String, value: Value) -> Self
Add custom metadata field
Sourcepub fn deprecated(self, deprecation: ToolDeprecation) -> Self
pub fn deprecated(self, deprecation: ToolDeprecation) -> Self
Deprecate the tool
Sourcepub fn is_deprecated(&self) -> bool
pub fn is_deprecated(&self) -> bool
Check if tool is deprecated
Sourcepub fn deprecation_warning(&self) -> Option<String>
pub fn deprecation_warning(&self) -> Option<String>
Get deprecation warning message
Sourcepub fn record_success(&self, execution_time: Duration)
pub fn record_success(&self, execution_time: Duration)
Record a successful execution (with thread-safe interior mutability)
Sourcepub fn record_error(&self, execution_time: Duration)
pub fn record_error(&self, execution_time: Duration)
Record a failed execution (with thread-safe interior mutability)
Sourcepub fn get_performance_snapshot(&self) -> ToolPerformanceMetrics
pub fn get_performance_snapshot(&self) -> ToolPerformanceMetrics
Get performance metrics snapshot
Sourcepub fn execution_count(&self) -> u64
pub fn execution_count(&self) -> u64
Get execution count
Sourcepub fn success_rate(&self) -> f64
pub fn success_rate(&self) -> f64
Get success rate
Sourcepub fn average_execution_time(&self) -> Duration
pub fn average_execution_time(&self) -> Duration
Get average execution time
Trait Implementations§
Source§impl Clone for EnhancedToolMetadata
impl Clone for EnhancedToolMetadata
Source§fn clone(&self) -> EnhancedToolMetadata
fn clone(&self) -> EnhancedToolMetadata
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for EnhancedToolMetadata
impl Debug for EnhancedToolMetadata
Source§impl Default for EnhancedToolMetadata
impl Default for EnhancedToolMetadata
Source§impl From<&EnhancedToolMetadata> for ToolAnnotations
impl From<&EnhancedToolMetadata> for ToolAnnotations
Source§fn from(metadata: &EnhancedToolMetadata) -> Self
fn from(metadata: &EnhancedToolMetadata) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for EnhancedToolMetadata
impl RefUnwindSafe for EnhancedToolMetadata
impl Send for EnhancedToolMetadata
impl Sync for EnhancedToolMetadata
impl Unpin for EnhancedToolMetadata
impl UnwindSafe for EnhancedToolMetadata
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more