pub struct ToolDescriptor {
pub tool_id: String,
pub source: ToolSource,
pub verb: Verb,
pub description: String,
pub input_schema: Value,
pub output_schema: Option<Value>,
pub capabilities: Vec<String>,
pub annotations: ToolAnnotations,
pub usage: ToolUsage,
pub embedding: Option<Vec<f32>>,
}Fields§
§tool_id: String§source: ToolSource§verb: Verb§description: StringUNTRUSTED. When sourced from an MCP server this string is
attacker-controllable (CVE-2025-54136 / “MCPoison” class — a
hostile server can ship a description crafted to inject
instructions into the user’s LLM context). Never inline this
directly into a system prompt; route it through
sanitization::render_tool_description_for_prompt which
strips control bytes, caps length, and fences the body inside
a labeled untrusted block. The hash-pin layer in
brainos-mcphost detects rug-pull changes to this field;
the sanitizer is what stops a single hostile description from
landing as live system instructions.
input_schema: Value§output_schema: Option<Value>§capabilities: Vec<String>§annotations: ToolAnnotations§usage: ToolUsageReasoner-facing usage guidance. Optional + defaulted so existing producers/consumers stay wire-compatible.
embedding: Option<Vec<f32>>Trait Implementations§
Source§impl Clone for ToolDescriptor
impl Clone for ToolDescriptor
Source§impl Debug for ToolDescriptor
impl Debug for ToolDescriptor
Source§impl<'de> Deserialize<'de> for ToolDescriptor
impl<'de> Deserialize<'de> for ToolDescriptor
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
Auto Trait Implementations§
impl Freeze for ToolDescriptor
impl RefUnwindSafe for ToolDescriptor
impl Send for ToolDescriptor
impl Sync for ToolDescriptor
impl Unpin for ToolDescriptor
impl UnsafeUnpin for ToolDescriptor
impl UnwindSafe for ToolDescriptor
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