pub struct McpToolDefinition {
pub name: String,
pub description: Option<String>,
pub input_schema: Value,
}Expand description
A tool advertised by an MCP server.
The MCP server lists its tools in response to a tools/list request.
The agent then decides which tools to call based on their names and
descriptions.
§JSON shape (from server)
{
"name": "read_file",
"description": "Read the contents of a file.",
"inputSchema": {
"type": "object",
"properties": { "path": { "type": "string" } },
"required": ["path"]
}
}Fields§
§name: StringThe tool’s unique name within this MCP server.
description: Option<String>Human-readable description of what the tool does. The LLM uses this to decide whether to call the tool.
input_schema: ValueJSON Schema describing the tool’s input parameters. Follows the same JSON Schema format as OpenAI function parameters.
Trait Implementations§
Source§impl Clone for McpToolDefinition
impl Clone for McpToolDefinition
Source§fn clone(&self) -> McpToolDefinition
fn clone(&self) -> McpToolDefinition
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for McpToolDefinition
impl Debug for McpToolDefinition
Source§impl<'de> Deserialize<'de> for McpToolDefinition
impl<'de> Deserialize<'de> for McpToolDefinition
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
Auto Trait Implementations§
impl Freeze for McpToolDefinition
impl RefUnwindSafe for McpToolDefinition
impl Send for McpToolDefinition
impl Sync for McpToolDefinition
impl Unpin for McpToolDefinition
impl UnsafeUnpin for McpToolDefinition
impl UnwindSafe for McpToolDefinition
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