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

Helper module used to build `ToolExecution` structure.

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

## Short example:

```elixir
%ToolExecution{}
  |> ToolExecution.task_support(:optional)
  |> ToolExecution.build()
```

Result:

```elixir
%{taskSupport: :optional}
```

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

## Fields

| Field | Setter | Type | Required |
|---|---|---|---|
| `taskSupport` | `task_support/2` | term | no |

# `immediate_response`

```elixir
@type immediate_response() :: String.t() | nil
```

# `poll_interval`

```elixir
@type poll_interval() :: pos_integer() | nil
```

# `t`

```elixir
@type t() :: %OzMcp.Structs.ToolExecution{
  immediate_response: term() | nil,
  poll_interval: term() | nil,
  taskSupport: term() | nil
}
```

# `task_support`

```elixir
@type task_support() :: :forbidden | :optional | :required | String.t() | nil
```

# `build`

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

# `immediate_response`

```elixir
@spec immediate_response(t(), immediate_response()) :: t()
```

The text that the client shows to the model while a task of the tool
runs. The value is never sent to the client in `tools/list`: `build/1`
does not emit it. The `CreateTaskResult` of a task-augmented call
carries it as `io.modelcontextprotocol/model-immediate-response` in
`_meta`.

# `poll_interval`

```elixir
@spec poll_interval(t(), poll_interval()) :: t()
```

The preferred interval (ms) between two polls of `tasks/get` for the
tasks of the tool. The value is never sent to the client: `build/1`
does not emit it. The task records of the tool carry it as their
`pollInterval`.

# `task_support`

```elixir
@spec task_support(t(), term() | nil) :: t()
```

---

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