pub struct McpBackend { /* private fields */ }Expand description
Tool backend for executing tools via MCP servers
Implementations§
Source§impl McpBackend
impl McpBackend
Sourcepub async fn new(
server_name: String,
transport: McpTransport,
tool_filter: ToolFilter,
) -> Result<McpBackend, ToolError>
pub async fn new( server_name: String, transport: McpTransport, tool_filter: ToolFilter, ) -> Result<McpBackend, ToolError>
Create a new MCP backend
Trait Implementations§
Source§impl Drop for McpBackend
impl Drop for McpBackend
Source§impl ToolBackend for McpBackend
impl ToolBackend for McpBackend
Source§fn execute<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
tool_call: &'life1 ToolCall,
_context: &'life2 ExecutionContext,
) -> Pin<Box<dyn Future<Output = Result<ToolResult, ToolError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
McpBackend: 'async_trait,
fn execute<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
tool_call: &'life1 ToolCall,
_context: &'life2 ExecutionContext,
) -> Pin<Box<dyn Future<Output = Result<ToolResult, ToolError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
McpBackend: 'async_trait,
Execute a tool call in this backend’s environment Read more
Source§fn supported_tools<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Vec<String>> + Send + 'async_trait>>where
'life0: 'async_trait,
McpBackend: 'async_trait,
fn supported_tools<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Vec<String>> + Send + 'async_trait>>where
'life0: 'async_trait,
McpBackend: 'async_trait,
List the tools this backend can handle Read more
Source§fn get_tool_schemas<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Vec<ToolSchema>> + Send + 'async_trait>>where
'life0: 'async_trait,
McpBackend: 'async_trait,
fn get_tool_schemas<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Vec<ToolSchema>> + Send + 'async_trait>>where
'life0: 'async_trait,
McpBackend: 'async_trait,
Get API tool descriptions for this backend Read more
Source§fn metadata(&self) -> BackendMetadata
fn metadata(&self) -> BackendMetadata
Backend metadata for debugging and monitoring Read more
Source§fn health_check<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = bool> + Send + 'async_trait>>where
'life0: 'async_trait,
McpBackend: 'async_trait,
fn health_check<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = bool> + Send + 'async_trait>>where
'life0: 'async_trait,
McpBackend: 'async_trait,
Check if the backend is healthy and ready to execute tools Read more
Source§fn requires_approval<'life0, 'life1, 'async_trait>(
&'life0 self,
_tool_name: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<bool, ToolError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
McpBackend: 'async_trait,
fn requires_approval<'life0, 'life1, 'async_trait>(
&'life0 self,
_tool_name: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<bool, ToolError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
McpBackend: 'async_trait,
Check if a tool requires approval before execution Read more
Auto Trait Implementations§
impl !RefUnwindSafe for McpBackend
impl !UnwindSafe for McpBackend
impl Freeze for McpBackend
impl Send for McpBackend
impl Sync for McpBackend
impl Unpin for McpBackend
impl UnsafeUnpin for McpBackend
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
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request