pub struct McpCallResult {
pub content: Vec<McpContentItem>,
pub is_error: bool,
}Expand description
Result of calling an MCP tool.
Contains the content returned by the tool execution and a flag indicating whether an error occurred.
§Fields
content- List of content items (text, images, or resources)is_error- Whether the tool execution failed
§Error Handling
When is_error is true, the content typically contains error messages
or diagnostic information. Clients should check this flag before
processing the content.
§Example
ⓘ
let result = McpCallResult {
content: vec![McpContentItem::Text {
text: "File contents here".to_string(),
}],
is_error: false,
};
if !result.is_error {
for item in result.content {
// Process content
}
}Fields§
§content: Vec<McpContentItem>Content items returned by the tool
is_error: boolWhether the tool execution encountered an error
Trait Implementations§
Source§impl Clone for McpCallResult
impl Clone for McpCallResult
Source§fn clone(&self) -> McpCallResult
fn clone(&self) -> McpCallResult
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 McpCallResult
impl Debug for McpCallResult
Source§impl<'de> Deserialize<'de> for McpCallResult
impl<'de> Deserialize<'de> for McpCallResult
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 McpCallResult
impl RefUnwindSafe for McpCallResult
impl Send for McpCallResult
impl Sync for McpCallResult
impl Unpin for McpCallResult
impl UnsafeUnpin for McpCallResult
impl UnwindSafe for McpCallResult
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