FastestMCP.Client.CallbackContext (fastest_mcp v0.2.0)

Copy Markdown View Source

Context passed to server-initiated client callbacks.

Callbacks can cooperatively check cancellation and emit MCP progress without retaining transport details or constructing protocol notifications.

Summary

Functions

Returns whether the peer cancelled this callback or its task.

Sends a monotonic progress update for this callback.

Types

t()

@type t() :: %FastestMCP.Client.CallbackContext{
  cancellation_ref: reference() | nil,
  cancelled?: boolean(),
  client: FastestMCP.Client.t(),
  direction: :server_to_client,
  method: String.t(),
  progress_token: String.t() | integer() | nil,
  request_id: String.t() | integer(),
  sampling_context: term(),
  sampling_tools: term(),
  task_id: String.t() | nil
}

Functions

cancelled?(context)

Returns whether the peer cancelled this callback or its task.

report_progress(context, progress, opts \\ [])

Sends a monotonic progress update for this callback.