Table of Contents

Class CallToolResponse

Namespace
ModelContextProtocol.Protocol
Assembly
ModelContextProtocol.Core.dll

Represents the result of a ToolsCall request from a client to invoke a tool provided by the server.

public class CallToolResponse
Inheritance
CallToolResponse
Inherited Members

Remarks

Any errors that originate from the tool should be reported inside the result object, with IsError set to true, rather than as a JsonRpcError.

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.

See the schema for details.

Properties

Content

Gets or sets the response content from the tool call.

[JsonPropertyName("content")]
public List<Content> Content { get; set; }

Property Value

List<Content>

IsError

Gets or sets an indication of whether the tool call was unsuccessful.

[JsonPropertyName("isError")]
public bool IsError { get; set; }

Property Value

bool

Remarks

When set to true, it signifies that the tool execution failed. Tool errors are reported with this property set to true and details in the Content property, rather than as protocol-level errors. This allows LLMs to see that an error occurred and potentially self-correct in subsequent requests.