Skip to content

CallToolResponse isError() returns null rather than false if the value is not set #1090

Description

@nictownsend

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

Historical issue content (#1090 (comment))

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Moderate issues affecting some users, edge cases, potentially valuable featureneeds reproWe need a way to reproduce the problem

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions