https://modelcontextprotocol.io/specification/2025-06-18/schema#calltoolresult
isError?: boolean
Whether the tool call ended in an error.
If not set, this is assumed to be false (the call was successful).
|
@JsonProperty("isError") Boolean isError, |
has a generated method
isError() that returns
null if the value has not been set.
It should return false if not set, otherwise CallToolResult is not aligned with the spec when an MCP server does not return isError
However -
|
Assert.notNull(isError, "isError must not be null"); |
invoked by
|
@JsonProperty("isError") Boolean isError, @JsonProperty("structuredContent") Object structuredContent, |
do not treat the JSON property as optional.
I found this when trying to connect to https://docs.confluent.io/cloud/current/ai/ai-tools/managed-mcp-server.html#global-and-regional-mcp-servers - https://api.confluent.cloud/mcp/v1 using
final HttpClientStreamableHttpTransport.Builder transportBuilder =
HttpClientStreamableHttpTransport.builder(url).endpoint(url)
.clientBuilder(httpClientBuilder);
Note .endpoint(url) needed because the confluent servers don't end in /mcp
https://modelcontextprotocol.io/specification/2025-06-18/schema#calltoolresult
java-sdk/mcp-core/src/main/java/io/modelcontextprotocol/spec/McpSchema.java
Line 3206 in 8ee8ccb
isError()that returnsnullif the value has not been set.It should return
falseif not set, otherwiseCallToolResultis not aligned with the spec when an MCP server does not returnisErrorHistorical issue content (#1090 (comment))
However -
java-sdk/mcp-core/src/main/java/io/modelcontextprotocol/spec/McpSchema.java
Line 3333 in 8ee8ccb
invoked by
java-sdk/mcp-core/src/main/java/io/modelcontextprotocol/spec/McpSchema.java
Line 3216 in 8ee8ccb
do not treat the JSON property as optional.
I found this when trying to connect to https://docs.confluent.io/cloud/current/ai/ai-tools/managed-mcp-server.html#global-and-regional-mcp-servers - https://api.confluent.cloud/mcp/v1 using
Note
.endpoint(url)needed because the confluent servers don't end in/mcp