pub trait ToolInvocationEnforcer: Send + Sync {
// Required methods
fn check_invocation_allowed<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
tool: &'life1 McpTool,
context: &'life2 InvocationContext,
) -> Pin<Box<dyn Future<Output = Result<EnforcementDecision, ToolInvocationError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait;
fn execute_tool_with_enforcement<'life0, 'life1, 'async_trait>(
&'life0 self,
tool: &'life1 McpTool,
context: InvocationContext,
) -> Pin<Box<dyn Future<Output = Result<InvocationResult, ToolInvocationError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn get_enforcement_config(&self) -> &InvocationEnforcementConfig;
fn update_enforcement_config(&mut self, config: InvocationEnforcementConfig);
}Expand description
Trait for tool invocation enforcement
Required Methods§
Sourcefn check_invocation_allowed<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
tool: &'life1 McpTool,
context: &'life2 InvocationContext,
) -> Pin<Box<dyn Future<Output = Result<EnforcementDecision, ToolInvocationError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn check_invocation_allowed<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
tool: &'life1 McpTool,
context: &'life2 InvocationContext,
) -> Pin<Box<dyn Future<Output = Result<EnforcementDecision, ToolInvocationError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Check if a tool invocation should be allowed based on verification status
Sourcefn execute_tool_with_enforcement<'life0, 'life1, 'async_trait>(
&'life0 self,
tool: &'life1 McpTool,
context: InvocationContext,
) -> Pin<Box<dyn Future<Output = Result<InvocationResult, ToolInvocationError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn execute_tool_with_enforcement<'life0, 'life1, 'async_trait>(
&'life0 self,
tool: &'life1 McpTool,
context: InvocationContext,
) -> Pin<Box<dyn Future<Output = Result<InvocationResult, ToolInvocationError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Execute a tool invocation with enforcement checks
Sourcefn get_enforcement_config(&self) -> &InvocationEnforcementConfig
fn get_enforcement_config(&self) -> &InvocationEnforcementConfig
Get the current enforcement configuration
Sourcefn update_enforcement_config(&mut self, config: InvocationEnforcementConfig)
fn update_enforcement_config(&mut self, config: InvocationEnforcementConfig)
Update the enforcement configuration