Trait ValidatedToolHandler

Source
pub trait ValidatedToolHandler: ToolHandler {
    // Required method
    fn parameter_schema() -> Value;

    // Provided methods
    fn validation_config() -> ValidationConfig { ... }
    fn create_tool(
        name: String,
        description: Option<String>,
        handler: Self,
    ) -> Tool
       where Self: Sized + 'static { ... }
}
Expand description

Trait for tools that can provide their own parameter validation

Required Methods§

Source

fn parameter_schema() -> Value

Get the JSON schema for this tool’s parameters

Provided Methods§

Source

fn validation_config() -> ValidationConfig

Get validation configuration for this tool

Source

fn create_tool(name: String, description: Option<String>, handler: Self) -> Tool
where Self: Sized + 'static,

Create a tool instance with built-in validation

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§