pub struct McpHandler { /* private fields */ }Expand description
Executes one tool discovered from an MCP server.
A handler with no client is used only while normalizing the discovered tool
metadata stored on McpToolParam into model-visible function tools.
Implementations§
Source§impl McpHandler
impl McpHandler
pub const fn discovered_tool_spec_only() -> Self
pub fn tool_call(client: Arc<McpClient>) -> Self
Sourcepub async fn discovered_tool_handlers(
server_label: &str,
client: Arc<McpClient>,
allowed_tools: Option<&[String]>,
) -> Result<Vec<McpDiscoveredHandler>, ToolError>
pub async fn discovered_tool_handlers( server_label: &str, client: Arc<McpClient>, allowed_tools: Option<&[String]>, ) -> Result<Vec<McpDiscoveredHandler>, ToolError>
Discovers and normalizes the tools exposed by one MCP server.
§Errors
Returns ToolError::Execution when the server’s tools/list
operation fails or times out.
Sourcepub const fn spec_from_param(_param: &Value) -> Self
pub const fn spec_from_param(_param: &Value) -> Self
Returns the spec-only MCP tool handler used during request normalization.
Trait Implementations§
Source§impl GatewayExecutor for McpHandler
impl GatewayExecutor for McpHandler
Source§impl ToolHandler for McpHandler
impl ToolHandler for McpHandler
Auto Trait Implementations§
impl !RefUnwindSafe for McpHandler
impl !UnwindSafe for McpHandler
impl Freeze for McpHandler
impl Send for McpHandler
impl Sync for McpHandler
impl Unpin for McpHandler
impl UnsafeUnpin for McpHandler
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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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 more