#[non_exhaustive]pub struct McpRouterInput {
pub command: McpRouterCommand,
pub connection_id: Option<String>,
pub server_name: Option<String>,
pub tool_name: Option<String>,
pub arguments: Option<JsonObject>,
}Expand description
The input of the mcp_router tool (McpRouterInput).
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.command: McpRouterCommandThe operation to perform: ‘connect’, ‘list_connections’, ‘list_tools’, ‘call_tool’, ‘disconnect’.
connection_id: Option<String>A descriptive name for this connection. Required for all commands except list_connections. Must be unique per agent. Reusing an active id is rejected.
server_name: Option<String>Server name to connect to. Required for ‘connect’.
tool_name: Option<String>Tool name to invoke. Required for ‘call_tool’.
arguments: Option<JsonObject>Arguments to pass to the invoked tool. Used with ‘call_tool’.
Implementations§
Source§impl McpRouterInput
impl McpRouterInput
Sourcepub fn new(command: McpRouterCommand) -> Self
pub fn new(command: McpRouterCommand) -> Self
An input for command with no other fields.
use strands::vended_tools::mcp_router::{McpRouterCommand, McpRouterInput};
let input = McpRouterInput::new(McpRouterCommand::CallTool)
.with_connection_id("docs")
.with_tool_name("search");
assert_eq!(input.tool_name.as_deref(), Some("search"));Sourcepub fn with_connection_id(self, connection_id: impl Into<String>) -> Self
pub fn with_connection_id(self, connection_id: impl Into<String>) -> Self
Sets the connection id.
Sourcepub fn with_server_name(self, server_name: impl Into<String>) -> Self
pub fn with_server_name(self, server_name: impl Into<String>) -> Self
Sets the server to connect to.
Sourcepub fn with_tool_name(self, tool_name: impl Into<String>) -> Self
pub fn with_tool_name(self, tool_name: impl Into<String>) -> Self
Sets the tool to invoke.
Sourcepub fn with_arguments(self, arguments: JsonObject) -> Self
pub fn with_arguments(self, arguments: JsonObject) -> Self
Sets the arguments for the invoked tool.
Trait Implementations§
Source§impl Clone for McpRouterInput
impl Clone for McpRouterInput
Source§impl Debug for McpRouterInput
impl Debug for McpRouterInput
Source§impl<'de> Deserialize<'de> for McpRouterInput
impl<'de> Deserialize<'de> for McpRouterInput
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl JsonSchema for McpRouterInput
impl JsonSchema for McpRouterInput
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Returns a string that uniquely identifies the schema produced by this type. Read more
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Generates a JSON Schema for this type. Read more
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
Whether JSON Schemas generated for this type should be included directly in parent schemas,
rather than being re-used where possible using the
$ref keyword. Read moreSource§impl PartialEq for McpRouterInput
impl PartialEq for McpRouterInput
Source§impl Serialize for McpRouterInput
impl Serialize for McpRouterInput
impl StructuralPartialEq for McpRouterInput
Auto Trait Implementations§
impl Freeze for McpRouterInput
impl RefUnwindSafe for McpRouterInput
impl Send for McpRouterInput
impl Sync for McpRouterInput
impl Unpin for McpRouterInput
impl UnsafeUnpin for McpRouterInput
impl UnwindSafe for McpRouterInput
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> 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 moreCreates a shared type from an unshared type.