pub struct McpTool {
pub server_label: String,
pub server_url: String,
pub headers: Option<HashMap<String, String>>,
pub allowed_tools: Option<McpToolAllowedTools>,
pub require_approval: Option<McpToolRequireApproval>,
}
Expand description
Give the model access to additional tools via remote Model Context Protocol (MCP) servers. Learn more about MCP.
Fields§
§server_label: String
A label for this MCP server, used to identify it in tool calls.
server_url: String
The URL for the MCP server.
headers: Option<HashMap<String, String>>
Optional HTTP headers to send to the MCP server. Use for authentication or other purposes.
allowed_tools: Option<McpToolAllowedTools>
List of allowed tool names or a filter object.
require_approval: Option<McpToolRequireApproval>
Specify which of the MCP server’s tools require approval.
Implementations§
Source§impl McpTool
impl McpTool
Sourcepub fn builder() -> McpToolBuilder<((), (), (), (), ())>
pub fn builder() -> McpToolBuilder<((), (), (), (), ())>
Create a builder for building McpTool
.
On the builder, call .server_label(...)
, .server_url(...)
, .headers(...)
(optional), .allowed_tools(...)
(optional), .require_approval(...)
(optional) to set the values of the fields.
Finally, call .build()
to create the instance of McpTool
.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for McpTool
impl<'de> Deserialize<'de> for McpTool
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
impl StructuralPartialEq for McpTool
Auto Trait Implementations§
impl Freeze for McpTool
impl RefUnwindSafe for McpTool
impl Send for McpTool
impl Sync for McpTool
impl Unpin for McpTool
impl UnwindSafe for McpTool
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