pub struct ImprovedToolMetadata {
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
complete improved metadata for tools
Fields§
§behavior_hints: ToolBehaviorHintsTool 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 ImprovedToolMetadata
impl ImprovedToolMetadata
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 ImprovedToolMetadata
impl Clone for ImprovedToolMetadata
Source§fn clone(&self) -> ImprovedToolMetadata
fn clone(&self) -> ImprovedToolMetadata
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 ImprovedToolMetadata
impl Debug for ImprovedToolMetadata
Source§impl Default for ImprovedToolMetadata
impl Default for ImprovedToolMetadata
Source§impl From<&ImprovedToolMetadata> for ToolAnnotations
impl From<&ImprovedToolMetadata> for ToolAnnotations
Source§fn from(metadata: &ImprovedToolMetadata) -> Self
fn from(metadata: &ImprovedToolMetadata) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for ImprovedToolMetadata
impl RefUnwindSafe for ImprovedToolMetadata
impl Send for ImprovedToolMetadata
impl Sync for ImprovedToolMetadata
impl Unpin for ImprovedToolMetadata
impl UnwindSafe for ImprovedToolMetadata
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