# `OzMcp.Structs.ToolResultContent`
[🔗](https://github.com/oz-elixir/oz_mcp/blob/v0.9.0/lib/oz_mcp/structs/tool_result_content.ex#L1)

Helper module used to build `ToolResultContent` structure: the result of a
tool call, inside a sampling message.

_(MCP protocol: 2025-11-25)_

## Short example:

```elixir
%ToolResultContent{}
  |> ToolResultContent.tool_use_id("call_1")
  |> ToolResultContent.content([%TextContent{} |> TextContent.text("18 C")])
  |> ToolResultContent.build()
```

Result:

```elixir
%{type: "tool_result", toolUseId: "call_1", content: [%{type: "text", text: "18 C"}]}
```

Specification: [ToolResultContent](https://modelcontextprotocol.io/specification/2025-11-25/schema#toolresultcontent)

## Fields

| Field | Setter | Type | Required |
|---|---|---|---|
| `toolUseId` | `tool_use_id/2` | string | yes |
| `content` | `content/2` | list() | yes |
| `structuredContent` | `structured_content/2` | map | no |
| `isError` | `is_error/2` | boolean | no |
| `_meta` | `_meta/2` | map | no |

# `t`

```elixir
@type t() :: %OzMcp.Structs.ToolResultContent{
  _meta: map() | nil,
  content: list(),
  isError: boolean() | nil,
  structuredContent: map() | nil,
  toolUseId: String.t()
}
```

# `build`

```elixir
@spec build(t()) :: map()
```

# `content`

```elixir
@spec content(t(), list()) :: t()
```

# `is_error`

```elixir
@spec is_error(t(), boolean() | nil) :: t()
```

# `structured_content`

```elixir
@spec structured_content(t(), map() | nil) :: t()
```

# `tool_use_id`

```elixir
@spec tool_use_id(t(), String.t()) :: t()
```

---

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