pub struct ToolDescriptor {
pub tool_id: String,
pub name: String,
pub version: String,
pub description: Option<String>,
pub input_schema: Option<String>,
pub output_schema: Option<String>,
pub requires: Vec<String>,
pub estimated_time_ms: u32,
pub stateless: bool,
pub streaming: bool,
pub tags: Vec<String>,
pub node_count: u32,
}Expand description
One row in the result of MeshNode::list_tools(...). Aggregates a
single (tool_id, version) across however many nodes currently
advertise it via the capability fold; node_count is filled by
the aggregator and is 0 on a freshly-constructed descriptor.
Source-of-truth fields are pulled from ToolCapability
(tool_id / name / version / input_schema /
output_schema / requires / estimated_time_ms / stateless)
plus CapabilitySet::metadata keys description_metadata_key,
streaming_metadata_key, and tags_metadata_key.
Fields§
§tool_id: StringnRPC service name. Same string the caller passes to
TypedMeshRpc::call / call_service / call_service_streaming.
name: StringHuman-readable name. Same field as ToolCapability::name.
version: StringTool version (semver-ish). Aggregation dedupes by
(tool_id, version); two nodes advertising the same tool at
different versions surface as separate descriptors.
description: Option<String>Human-readable description; the model reads this to decide
when/how to call. None for legacy tools that didn’t go
through serve_tool.
input_schema: Option<String>JSON Schema (draft 2020-12) for the request body. None when
the schema is too large for the capability fold’s per-entry
budget; fetch via the future tool.metadata.fetch RPC.
output_schema: Option<String>JSON Schema for the response body. None for non-strict
tools (many models don’t require it).
requires: Vec<String>Required dependencies / sibling capabilities — direct mirror
of ToolCapability::requires.
estimated_time_ms: u32Soft latency hint for the model scheduler / UI spinner.
0 if the host didn’t supply an estimate.
stateless: boolTool is a pure function (same input → same output, no session state). Adapters use this to decide caching + parallel-invocation safety.
streaming: booltrue if the handler is server-streaming
(serve_tool_streaming). Adapters lower this into their
provider’s streaming protocol.
Free-form tags the host attached at register time.
node_count: u32How many nodes currently advertise this (tool_id, version)
pair across the scope queried. Filled by the aggregator;
stays at 0 on a freshly-constructed descriptor.
Implementations§
Source§impl ToolDescriptor
impl ToolDescriptor
Sourcepub fn from_capability(
cap: &ToolCapability,
metadata: &BTreeMap<String, String>,
) -> ToolDescriptor
pub fn from_capability( cap: &ToolCapability, metadata: &BTreeMap<String, String>, ) -> ToolDescriptor
Build a descriptor from one ToolCapability + the metadata
map it was announced with. node_count is left at 0; the
MeshNode::list_tools aggregator fills it during the merge
pass.
The metadata map is CapabilitySet::metadata — the same
hook ToolCapability::input_schema_metadata_key /
output_schema_metadata_key use.
Trait Implementations§
Source§impl Clone for ToolDescriptor
impl Clone for ToolDescriptor
Source§fn clone(&self) -> ToolDescriptor
fn clone(&self) -> ToolDescriptor
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§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<ToolDescriptor, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<ToolDescriptor, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
impl Eq for ToolDescriptor
Source§impl PartialEq for ToolDescriptor
impl PartialEq for ToolDescriptor
Source§fn eq(&self, other: &ToolDescriptor) -> bool
fn eq(&self, other: &ToolDescriptor) -> bool
self and other values to be equal, and is used by ==.Source§impl Serialize for ToolDescriptor
impl Serialize for ToolDescriptor
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
impl StructuralPartialEq for ToolDescriptor
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.