Helper module used to build Task structure.
(MCP protocol: 2025-11-25)
Short example:
%Task{}
|> Task.task_id("task-123")
|> Task.status(:working)
|> Task.created_at("2025-01-12T15:00:58Z")
|> Task.last_updated_at("2025-01-12T15:01:12Z")
|> Task.ttl(60_000)
|> Task.build()Result:
%{
status: "working",
ttl: 60000,
taskId: "task-123",
createdAt: "2025-01-12T15:00:58Z",
lastUpdatedAt: "2025-01-12T15:01:12Z"
}Specification: Task
Fields
| Field | Setter | Type | Required |
|---|---|---|---|
taskId | task_id/2 | string | yes |
status | status/2 | status() | yes |
statusMessage | status_message/2 | string | no |
createdAt | created_at/2 | string | yes |
lastUpdatedAt | last_updated_at/2 | string | yes |
ttl | ttl/2 | non-negative integer | no |
pollInterval | poll_interval/2 | non-negative integer | no |
Summary
Types
@type status() :: :working | :input_required | :completed | :failed | :cancelled
@type t() :: %OzMcp.Structs.Task{ createdAt: String.t(), lastUpdatedAt: String.t(), pollInterval: non_neg_integer() | nil, status: status(), statusMessage: String.t() | nil, taskId: String.t(), ttl: non_neg_integer() | nil }
Functions
@spec poll_interval(t(), non_neg_integer() | nil) :: t()
@spec ttl(t(), non_neg_integer() | nil) :: t()