ToolResultContent extends Content
FinalYes
The result of a tool use, provided by the user back to the assistant.
since protocol revision 2026-07-28 (SEP-2577), earliest removal 2027-07-28. Integrate with an LLM provider's API directly instead.
Carries the same content blocks as a tools/call result, so it accepts everything
CallToolResult does.
Table of Contents
Properties
- $content : array<int, ToolResultBlock>
- $isError : bool
- $meta : array<string|int, mixed>|null
- $structuredContent : array<string|int, mixed>|null
- $toolUseId : string
- $type : string
Methods
- __construct() : mixed
- fromArray() : self
- jsonSerialize() : array<string, mixed>
Properties
$content read-only
public
array<int, ToolResultBlock>
$content
$isError read-only
public
bool
$isError
= false
$meta read-only
public
array<string|int, mixed>|null
$meta
= null
$structuredContent read-only
public
array<string|int, mixed>|null
$structuredContent
= null
$toolUseId read-only
public
string
$toolUseId
$type read-only
public
string
$type
Methods
__construct()
public
__construct(string $toolUseId, array<string|int, ToolResultBlock> $content[, array<string, mixed>|null $structuredContent = null ][, bool $isError = false ][, array<string, mixed>|null $meta = null ]) : mixed
Parameters
- $toolUseId : string
- $content : array<string|int, ToolResultBlock>
-
keys are discarded, the property always holds a list
- $structuredContent : array<string, mixed>|null = null
- $isError : bool = false
- $meta : array<string, mixed>|null = null
fromArray()
public
static fromArray(array<string, mixed> $data) : self
Parameters
- $data : array<string, mixed>
Return values
selfjsonSerialize()
public
jsonSerialize() : array<string, mixed>