feat(core): impl &mcp_core::types::Tool for ToolDefinition

This commit is contained in:
Joshua Mo 2025-04-09 22:27:06 +01:00
parent 64d20a88d0
commit a0c8f5bc75
1 changed files with 11 additions and 0 deletions

View File

@ -204,6 +204,17 @@ where
}
}
#[cfg(feature = "mcp")]
impl From<&mcp_core::types::Tool> for ToolDefinition {
fn from(val: &mcp_core::types::Tool) -> Self {
Self {
name: val.name.to_owned(),
description: val.description.to_owned().unwrap_or_default(),
parameters: val.input_schema.to_owned(),
}
}
}
#[cfg(feature = "mcp")]
impl From<mcp_core::types::Tool> for ToolDefinition {
fn from(val: mcp_core::types::Tool) -> Self {