pub struct ToolDef {
pub name: String,
pub description: String,
pub input_schema: Value,
pub tags: Vec<String>,
pub category: Option<String>,
}Expand description
OpenAPI-style tool definition: name, description, input schema.
Describes a sub-tool registered with a ScriptedToolBuilder or usable
standalone. The input_schema is optional JSON Schema for documentation /
LLM prompts and for type coercion of --key value flags.
Fields§
§name: StringCommand name used as bash builtin (e.g. "get_user").
description: StringHuman-readable description for LLM consumption.
input_schema: ValueJSON Schema describing accepted arguments. Empty object if unspecified.
Categorical tags for discovery (e.g. ["admin", "billing"]).
category: Option<String>Grouping category for discovery (e.g. "payments").
Implementations§
Source§impl ToolDef
impl ToolDef
Sourcepub fn new(name: impl Into<String>, description: impl Into<String>) -> Self
pub fn new(name: impl Into<String>, description: impl Into<String>) -> Self
Create a tool definition with name and description.
Sourcepub fn with_schema(self, schema: Value) -> Self
pub fn with_schema(self, schema: Value) -> Self
Attach a JSON Schema for the tool’s input parameters.
Add categorical tags for discovery filtering.
Sourcepub fn with_category(self, category: &str) -> Self
pub fn with_category(self, category: &str) -> Self
Set the grouping category for discovery.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ToolDef
impl RefUnwindSafe for ToolDef
impl Send for ToolDef
impl Sync for ToolDef
impl Unpin for ToolDef
impl UnsafeUnpin for ToolDef
impl UnwindSafe for ToolDef
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