pub struct CallToolResponse { /* private fields */ }Expand description
Output of the tool-call dispatcher pipeline.
Some(value)— this plugin handled the call;valueis the tool’s response (returned to the MCP client as the tool result).None— this plugin did not handle the call. yeti-mcp continues iterating the chain; if every registered plugin returnsNone, the host falls through to its built-in auto-inventory dispatcher.
Wrapped in a transparent newtype so the inner Option<String> can
carry the bincode-safe JSON-text wire encoding of the Value (see
ToolDefinition::input_schema for why bincode can’t ride a
serde_json::Value directly). CallToolResponse::some /
CallToolResponse::none / CallToolResponse::value are the
construction / read helpers.
Implementations§
Source§impl CallToolResponse
impl CallToolResponse
Sourcepub const fn none() -> Self
pub const fn none() -> Self
Ok(None) equivalent — the plugin did not handle the call.
Yeti-mcp falls through to the next service / auto-inventory.
Sourcepub fn some(value: &Value) -> Self
pub fn some(value: &Value) -> Self
Wrap a Value for the wire. Equivalent to Some(value) —
the plugin handled the call and value is the tool’s response.
Sourcepub fn value(&self) -> Option<Value>
pub fn value(&self) -> Option<Value>
Parse the wire form back into the typed Option<Value> the
host’s dispatcher consumes. Decoding errors flatten to None
so a malformed plugin response degrades to “not handled” rather
than poisoning the chain.
Trait Implementations§
Source§impl Clone for CallToolResponse
impl Clone for CallToolResponse
Source§fn clone(&self) -> CallToolResponse
fn clone(&self) -> CallToolResponse
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more