pub enum TraceEntry {
ListTools {
failure_reason: Option<String>,
},
ToolCall {
invocation: ToolInvocation,
response: Option<CallToolResult>,
failure_reason: Option<String>,
},
}Expand description
A trace entry capturing MCP interactions.
Variants§
ListTools
A list-tools request was issued.
ToolCall
A tool call, optionally annotated with a response on failure.
Fields
§
invocation: ToolInvocationThe invocation that was sent.
§
response: Option<CallToolResult>Optional response payload (omitted in compact traces).
Implementations§
Source§impl TraceEntry
impl TraceEntry
Sourcepub fn list_tools() -> Self
pub fn list_tools() -> Self
Creates a trace entry for a list-tools call.
Sourcepub fn list_tools_with_failure(reason: String) -> Self
pub fn list_tools_with_failure(reason: String) -> Self
Creates a trace entry for a failed list-tools call.
Sourcepub fn tool_call(invocation: ToolInvocation) -> Self
pub fn tool_call(invocation: ToolInvocation) -> Self
Creates a trace entry for a tool call without a response.
Sourcepub fn tool_call_with_response(
invocation: ToolInvocation,
response: CallToolResult,
) -> Self
pub fn tool_call_with_response( invocation: ToolInvocation, response: CallToolResult, ) -> Self
Creates a trace entry for a tool call with a response.
Sourcepub fn as_tool_call(&self) -> Option<(&ToolInvocation, Option<&CallToolResult>)>
pub fn as_tool_call(&self) -> Option<(&ToolInvocation, Option<&CallToolResult>)>
Returns the invocation and response when the entry is a tool call.
Trait Implementations§
Source§impl Clone for TraceEntry
impl Clone for TraceEntry
Source§fn clone(&self) -> TraceEntry
fn clone(&self) -> TraceEntry
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for TraceEntry
impl Debug for TraceEntry
Source§impl<'de> Deserialize<'de> for TraceEntry
impl<'de> Deserialize<'de> for TraceEntry
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
Source§impl JsonSchema for TraceEntry
impl JsonSchema for TraceEntry
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Returns a string that uniquely identifies the schema produced by this type. Read more
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Generates a JSON Schema for this type. Read more
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
Whether JSON Schemas generated for this type should be included directly in parent schemas,
rather than being re-used where possible using the
$ref keyword. Read moreAuto Trait Implementations§
impl Freeze for TraceEntry
impl RefUnwindSafe for TraceEntry
impl Send for TraceEntry
impl Sync for TraceEntry
impl Unpin for TraceEntry
impl UnsafeUnpin for TraceEntry
impl UnwindSafe for TraceEntry
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