pub struct CodeTool { /* private fields */ }Expand description
One registered native tool: an MCP-shaped definition (name + description + input JSON Schema) plus the Rust handler.
Implementations§
Source§impl CodeTool
impl CodeTool
Sourcepub fn new(
name: impl Into<String>,
description: impl Into<String>,
input_schema: Value,
handler: impl Fn(&Value) -> Result<Value, String> + Send + Sync + 'static,
) -> CodeTool
pub fn new( name: impl Into<String>, description: impl Into<String>, input_schema: Value, handler: impl Fn(&Value) -> Result<Value, String> + Send + Sync + 'static, ) -> CodeTool
Build a tool. input_schema is the MCP inputSchema the model sees —
give it real properties; the model routes on schemas.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for CodeTool
impl !UnwindSafe for CodeTool
impl Freeze for CodeTool
impl Send for CodeTool
impl Sync for CodeTool
impl Unpin for CodeTool
impl UnsafeUnpin for CodeTool
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