Connected-client handle for one remote MCP task.
This is intentionally different from %FastestMCP.BackgroundTask{}, which is
a local runtime handle. A remote client task is a view over a task owned by a
connected peer.
The flow is:
create task remotely
-> register the remote task handle in the client
-> wait on notifications/tasks/status when available
-> fall back to tasks/get polling when needed
-> cache the final tasks/result payload
Summary
Functions
Cancels the remote task and updates the cached status.
Fetches fresh task status from the remote peer and updates the cache.
Registers a callback for task status changes.
Fetches and caches the final result using tasks/result.
Returns the last cached status, if any.
Waits for the task to reach a target state or any terminal state.
Types
@type kind() :: :tool | :prompt | :resource | :generic
@type t() :: %FastestMCP.Client.Task{ client: FastestMCP.Client.t(), kind: kind(), target: String.t() | nil, task_id: String.t() }
Functions
Cancels the remote task and updates the cached status.
Fetches fresh task status from the remote peer and updates the cache.
Registers a callback for task status changes.
Fetches and caches the final result using tasks/result.
Returns the last cached status, if any.
Waits for the task to reach a target state or any terminal state.