pub struct ToolInfo {
pub name: ToolName,
pub title: Option<String>,
pub description: Option<String>,
pub input_schema: JsonSchema,
pub output_schema: Option<JsonSchema>,
pub annotations: ToolAnnotations,
pub icons: Vec<ToolIcon>,
pub interactions: ToolInteractionCapabilities,
pub metadata: BTreeMap<String, Value>,
}Expand description
Complete source-neutral declaration for one executable tool.
A declared output schema requires structured content on every successful result.
Missing content fails; explicit JSON null is validated against the schema.
Model-visible error results (is_error = true) are exempt from output-schema validation.
§Examples
use tools_kit::{declaration::{ToolInfo, ToolName}, schema::JsonSchema};
let info = ToolInfo::new(ToolName::new("ping")?, JsonSchema::strict(serde_json::json!({"type":"object"})));
assert!(info.output_schema.is_none());
Fields§
§name: ToolNameStable caller-facing name.
title: Option<String>Optional display label.
description: Option<String>Model-visible behavior description.
input_schema: JsonSchemaJSON Schema for invocation arguments.
output_schema: Option<JsonSchema>Optional JSON Schema for structured output.
annotations: ToolAnnotationsPortable behavior hints.
icons: Vec<ToolIcon>Optional visual metadata.
interactions: ToolInteractionCapabilitiesSupported source-neutral caller interactions.
metadata: BTreeMap<String, Value>Uninterpreted source-neutral metadata.
Implementations§
Source§impl ToolInfo
impl ToolInfo
Sourcepub fn new(name: ToolName, input_schema: JsonSchema) -> Self
pub fn new(name: ToolName, input_schema: JsonSchema) -> Self
Creates a complete declaration with no optional metadata.
§Examples
use tools_kit::{declaration::{ToolInfo, ToolName}, schema::JsonSchema};
let info = ToolInfo::new(ToolName::new("ping")?, JsonSchema::strict(serde_json::json!({"type":"object"})));
assert!(info.output_schema.is_none());
Trait Implementations§
Source§impl<'de> Deserialize<'de> for ToolInfo
impl<'de> Deserialize<'de> for ToolInfo
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
impl StructuralPartialEq for ToolInfo
Auto Trait Implementations§
impl Freeze for ToolInfo
impl RefUnwindSafe for ToolInfo
impl Send for ToolInfo
impl Sync for ToolInfo
impl Unpin for ToolInfo
impl UnsafeUnpin for ToolInfo
impl UnwindSafe for ToolInfo
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