class MCProtocol::CallToolResult

Overview

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.

Included Modules

Defined in:

mcprotocol/call_tool_result.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new(pull : JSON::PullParser) #

[View source]
def self.new(content : Array(String), _meta : JSON::Any | Nil = Nil, isError : Bool | Nil = Nil) #

[View source]

Instance Method Detail

def _meta : JSON::Any | Nil #

This result property is reserved by the protocol to allow clients and servers to attach additional metadata to their responses.


[View source]
def content : Array(String) #

[View source]
def isError : Bool | Nil #

Whether the tool call ended in an error.

If not set, this is assumed to be false (the call was successful).


[View source]