OzMcp.Structs.ToolExecution (OzMcp v0.9.0)

Copy Markdown View Source

Helper module used to build ToolExecution structure.

(MCP protocol: 2025-11-25)

Short example:

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

Result:

%{taskSupport: :optional}

Specification: ToolExecution

Fields

FieldSetterTypeRequired
taskSupporttask_support/2termno

Summary

Functions

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.

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.

Types

immediate_response()

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

poll_interval()

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

t()

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

task_support()

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

Functions

build(struct)

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

immediate_response(struct, value)

@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(struct, value)

@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(struct, value)

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