ToolResult

@SerialName(value = "tool_result")
data class ToolResult(val toolUseId: String, val content: List<AnthropicContent>, val isError: Boolean, val cacheControl: AnthropicCacheControl? = null) : AnthropicContent(source)

Represents the result of a tool invocation within the Anthropic content system.

Constructors

Link copied to clipboard
constructor(toolUseId: String, content: List<AnthropicContent>, isError: Boolean, cacheControl: AnthropicCacheControl? = null)

Properties

Link copied to clipboard

Optional cache control directive for explicit breakpoint prompt caching. When set on the last content block in the list, all content blocks are eligible for caching.

Link copied to clipboard

The list of content blocks generated by the tool invocation. May include text and image blocks.

Link copied to clipboard

Whether this tool result represents an error. When true, Anthropic will treat the content as an error message. Null means not an error (field omitted from the request).

Link copied to clipboard

The unique identifier of the invoked tool for which this result corresponds.