ToolResultContent class

The result of a tool use, provided by the user back to the assistant.

Inheritance
Implemented types
Annotations
  • @Deprecated('Deprecated as of protocol version 2026-07-28 (SEP-2577). ' 'Remains in the specification for at least twelve months.')

Constructors

ToolResultContent({required String toolUseId, required List<ContentBlock> content, Map<String, Object?>? structuredContent, bool? isError, Annotations? annotations, MetaObject? $meta})
Creates a ToolResultContent.
ToolResultContent.toMCP(Map<String, Object?> map)
Builds a ToolResultContent from a decoded MCP JSON map.
factory

Properties

$meta MetaObject?
Optional metadata.
getter/setter pairinherited
annotations Annotations?
Optional client annotations.
getter/setter pairinherited
content List<ContentBlock>
The unstructured result content of the tool use.
getter/setter pair
data String
Base64-encoded binary data (used for image / audio content).
getter/setter pairinherited
hashCode int
The hash code for this object.
no setterinherited
isError bool?
Whether the tool use resulted in an error.
getter/setter pair
mimeType String
MIME type of data.
getter/setter pairinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
structuredContent Map<String, Object?>?
An optional structured result value.
getter/setter pair
toolUseId String
The ID of the tool use this result corresponds to.
getter/setter pair
type String
The content type discriminator (e.g. "text", "image", "audio").
getter/setter pairinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toMap() Map<String, Object?>
Converts this ToolResultContent into a JSON-compatible map.
override
toString() String
A string representation of this object.
inherited

Operators

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