# `Urchin.Result.CallTool`
[🔗](https://github.com/urth-inc/urchin/blob/v0.4.0/lib/urchin/result.ex#L1)

An explicit `tools/call` result.

Handlers usually return `{:ok, content}` and let the dispatcher build this, but they
may construct it directly to set `structured_content` or `is_error`.

# `t`

```elixir
@type t() :: %Urchin.Result.CallTool{
  content: [map()],
  is_error: boolean(),
  structured_content: map() | nil
}
```

# `error`

```elixir
@spec error([map()]) :: t()
```

Builds an error result (`isError: true`) from a list of content blocks.

# `ok`

```elixir
@spec ok(
  [map()],
  keyword()
) :: t()
```

Builds a successful result from a list of content blocks.

# `to_map`

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

Serializes to the `CallToolResult` wire shape.

---

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