pub struct CallToolResult {
pub content: Vec<CallToolResultContentItem>,
pub is_error: Option<bool>,
pub meta: Map<String, Value>,
}
Expand description
The server’s response to a tool call.
Any errors that originate from the tool SHOULD be reported inside the result
object, with isError
set to true, not as an MCP protocol-level error
response. Otherwise, the LLM would not be able to see that an error occurred
and self-correct.
However, any errors in finding the tool, an error indicating that the server does not support tool calls, or any other exceptional conditions, should be reported as an MCP error response.
JSON schema
{
"description": "The server's response to a tool call.\n\nAny errors that originate from the tool SHOULD be reported inside the result\nobject, with `isError` set to true, _not_ as an MCP protocol-level error\nresponse. Otherwise, the LLM would not be able to see that an error occurred\nand self-correct.\n\nHowever, any errors in _finding_ the tool, an error indicating that the\nserver does not support tool calls, or any other exceptional conditions,\nshould be reported as an MCP error response.",
"type": "object",
"required": [
"content"
],
"properties": {
"_meta": {
"description": "This result property is reserved by the protocol to allow clients and servers to attach additional metadata to their responses.",
"type": "object",
"additionalProperties": {}
},
"content": {
"type": "array",
"items": {
"anyOf": [
{
"$ref": "#/definitions/TextContent"
},
{
"$ref": "#/definitions/ImageContent"
},
{
"$ref": "#/definitions/EmbeddedResource"
}
]
}
},
"isError": {
"description": "Whether the tool call ended in an error.\n\nIf not set, this is assumed to be false (the call was successful).",
"type": "boolean"
}
}
}
Fields§
§content: Vec<CallToolResultContentItem>
§is_error: Option<bool>
Whether the tool call ended in an error.
If not set, this is assumed to be false (the call was successful).
meta: Map<String, Value>
This result property is reserved by the protocol to allow clients and servers to attach additional metadata to their responses.
Trait Implementations§
Source§impl Clone for CallToolResult
impl Clone for CallToolResult
Source§fn clone(&self) -> CallToolResult
fn clone(&self) -> CallToolResult
Returns a copy 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 CallToolResult
impl Debug for CallToolResult
Source§impl<'de> Deserialize<'de> for CallToolResult
impl<'de> Deserialize<'de> for CallToolResult
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 From<&CallToolResult> for CallToolResult
impl From<&CallToolResult> for CallToolResult
Source§fn from(value: &CallToolResult) -> Self
fn from(value: &CallToolResult) -> Self
Converts to this type from the input type.
Source§impl From<&CallToolResult> for ServerResult
impl From<&CallToolResult> for ServerResult
Source§fn from(value: &CallToolResult) -> Self
fn from(value: &CallToolResult) -> Self
Converts to this type from the input type.
Source§impl From<&CallToolResultContentItem> for CallToolResult
impl From<&CallToolResultContentItem> for CallToolResult
Source§fn from(value: &CallToolResultContentItem) -> Self
fn from(value: &CallToolResultContentItem) -> Self
Converts to this type from the input type.
Source§impl From<&EmbeddedResource> for CallToolResult
impl From<&EmbeddedResource> for CallToolResult
Source§fn from(value: &EmbeddedResource) -> Self
fn from(value: &EmbeddedResource) -> Self
Converts to this type from the input type.
Source§impl From<&ImageContent> for CallToolResult
impl From<&ImageContent> for CallToolResult
Source§fn from(value: &ImageContent) -> Self
fn from(value: &ImageContent) -> Self
Converts to this type from the input type.
Source§impl From<&TextContent> for CallToolResult
impl From<&TextContent> for CallToolResult
Source§fn from(value: &TextContent) -> Self
fn from(value: &TextContent) -> Self
Converts to this type from the input type.
Source§impl From<&str> for CallToolResult
impl From<&str> for CallToolResult
Source§impl From<()> for CallToolResult
impl From<()> for CallToolResult
Source§impl From<CallToolResult> for ServerResult
impl From<CallToolResult> for ServerResult
Source§fn from(value: CallToolResult) -> Self
fn from(value: CallToolResult) -> Self
Converts to this type from the input type.
Source§impl From<CallToolResultContentItem> for CallToolResult
impl From<CallToolResultContentItem> for CallToolResult
Source§fn from(content: CallToolResultContentItem) -> Self
fn from(content: CallToolResultContentItem) -> Self
Converts to this type from the input type.
Source§impl From<EmbeddedResource> for CallToolResult
impl From<EmbeddedResource> for CallToolResult
Source§fn from(value: EmbeddedResource) -> Self
fn from(value: EmbeddedResource) -> Self
Converts to this type from the input type.
Source§impl From<ImageContent> for CallToolResult
impl From<ImageContent> for CallToolResult
Source§fn from(value: ImageContent) -> Self
fn from(value: ImageContent) -> Self
Converts to this type from the input type.
Source§impl From<String> for CallToolResult
impl From<String> for CallToolResult
Source§impl From<TextContent> for CallToolResult
impl From<TextContent> for CallToolResult
Source§fn from(value: TextContent) -> Self
fn from(value: TextContent) -> Self
Converts to this type from the input type.
Source§impl<T: Into<CallToolResultContentItem>> From<Vec<T>> for CallToolResult
impl<T: Into<CallToolResultContentItem>> From<Vec<T>> for CallToolResult
Source§impl PartialEq for CallToolResult
impl PartialEq for CallToolResult
Source§impl Serialize for CallToolResult
impl Serialize for CallToolResult
impl StructuralPartialEq for CallToolResult
Auto Trait Implementations§
impl Freeze for CallToolResult
impl RefUnwindSafe for CallToolResult
impl Send for CallToolResult
impl Sync for CallToolResult
impl Unpin for CallToolResult
impl UnwindSafe for CallToolResult
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