# `Omni.Content.ToolResult`
[🔗](https://github.com/aaronrussell/omni/blob/v1.2.1/lib/omni/content/tool_result.ex#L1)

A tool result content block representing the output of a tool invocation.

Appears in user messages to provide the result of a preceding
`Omni.Content.ToolUse`. The `tool_use_id` links back to the originating
tool use block. Content is restricted to `Text` and `Attachment` blocks
(image attachments are only supported by some providers).

# `content`

```elixir
@type content() :: Omni.Content.Text.t() | Omni.Content.Attachment.t()
```

Allowed content types within a tool result.

# `t`

```elixir
@type t() :: %Omni.Content.ToolResult{
  content: [content()],
  is_error: boolean(),
  name: String.t(),
  tool_use_id: String.t()
}
```

Output of a tool invocation, linked to its originating `ToolUse` by ID.

# `new`

```elixir
@spec new(Enumerable.t()) :: t()
```

Creates a new tool result content block from a keyword list or map.

String content is wrapped in a `Text` block. `nil` content becomes `[]`.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
