pub struct AgentMcpHandler { /* private fields */ }Expand description
MCP ToolHandler that wraps an agent
Implementations§
Source§impl AgentMcpHandler
impl AgentMcpHandler
Sourcepub fn new<F, Fut>(
name: impl Into<String>,
description: impl Into<String>,
handler: F,
) -> Selfwhere
F: Fn(AgentMcpInput) -> Fut + Send + Sync + 'static,
Fut: Future<Output = Result<AgentMcpOutput, String>> + Send + 'static,
pub fn new<F, Fut>(
name: impl Into<String>,
description: impl Into<String>,
handler: F,
) -> Selfwhere
F: Fn(AgentMcpInput) -> Fut + Send + Sync + 'static,
Fut: Future<Output = Result<AgentMcpOutput, String>> + Send + 'static,
Create a new handler with a custom async function
Sourcepub fn with_config(self, config: AgentMcpConfig) -> Self
pub fn with_config(self, config: AgentMcpConfig) -> Self
Create with custom configuration
Sourcepub fn with_capability(self, capability: impl Into<String>) -> Self
pub fn with_capability(self, capability: impl Into<String>) -> Self
Add a capability tag
Sourcepub fn with_capabilities(self, capabilities: Vec<String>) -> Self
pub fn with_capabilities(self, capabilities: Vec<String>) -> Self
Add multiple capabilities
Sourcepub fn builder(name: impl Into<String>) -> AgentMcpHandlerBuilder
pub fn builder(name: impl Into<String>) -> AgentMcpHandlerBuilder
Create a builder for fluent construction
Sourcepub fn capabilities(&self) -> &[String]
pub fn capabilities(&self) -> &[String]
Get the capabilities
Trait Implementations§
Source§impl ToolHandler for AgentMcpHandler
impl ToolHandler for AgentMcpHandler
Auto Trait Implementations§
impl Freeze for AgentMcpHandler
impl !RefUnwindSafe for AgentMcpHandler
impl Send for AgentMcpHandler
impl Sync for AgentMcpHandler
impl Unpin for AgentMcpHandler
impl UnsafeUnpin for AgentMcpHandler
impl !UnwindSafe for AgentMcpHandler
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