CallToolResult class

Tool call result.

Spec 2025-06-18 added structuredContent (optional JSON object that pairs with Tool.outputSchema). Tools returning structured content SHOULD also include the serialized JSON in a TextContent block for backward compatibility with clients that don't read structuredContent.

Constructors

CallToolResult({required List<Content> content, Map<String, dynamic>? structuredContent, @Deprecated('See CallToolResult.isStreaming — removed in 3.0.') bool isStreaming = false, bool? isError})
const

Properties

content List<Content>
final
hashCode int
The hash code for this object.
no setterinherited
isError bool?
final
isStreaming bool
NON-STANDARD (makemind) legacy hint. Not part of the MCP CallToolResult spec and honored nowhere (the transport closes a tool-call stream on the final result regardless of this flag). The standard pattern is: enable streaming with a tool (tools/call) and deliver the stream via a reactive resource (subscriptions/listen on 2026-07-28, resources/ subscribe on ≤2025-11-25). Retained + still serialized for backward compatibility; slated for removal in the next major (3.0).
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
structuredContent Map<String, dynamic>?
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() Map<String, dynamic>
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited