# `Snodo.Context`
[🔗](https://github.com/joshrotenberg/snodo/blob/v0.4.1/lib/snodo/context.ex#L1)

Immutable request-scoped protocol, transport, auth, and tracing context.

MRTR retries are new requests, not suspended handlers. `input_responses`
contains the client's bare input results and `request_state` is untrusted
opaque client input. Use `Snodo.Elicitation.response/3` (or the deprecated
`Snodo.Sampling.response/3` and `Snodo.Roots.response/3`) to consume a named
answer and `Snodo.MRTR.State` to protect state that affects business logic.
`request_method` and `request_params` preserve the incoming operation for
request-bound state verification; tool and prompt arguments remain unchanged.

`dispatch_check` is set by `Snodo.Server` while extension middleware runs; use
it through `Snodo.Extension.check_dispatch/3`.

`trace_context` contains valid W3C `traceparent` and `tracestate` values from
request `_meta` with string keys. When it contains `"traceparent"`, pass it as
a client's `:trace_context` option to forward those values. `metadata`
retains the original request values.

# `t`

```elixir
@type t() :: %Snodo.Context{
  auth: map() | nil,
  cancellation: term() | nil,
  client_capabilities: map(),
  client_info: map() | nil,
  dispatch_check:
    (term(), map(), t() -&gt;
       :ok | {:ok, Snodo.Result.t()} | {:error, Snodo.Error.t()})
    | nil,
  extension_options: %{optional(String.t()) =&gt; keyword() | map()},
  extensions: map(),
  input_responses: map(),
  metadata: map(),
  progress: Snodo.Progress.t() | nil,
  protocol: module(),
  protocol_version: String.t(),
  request_id: Snodo.Envelope.id(),
  request_method: String.t() | nil,
  request_params: map(),
  request_state: String.t() | nil,
  server_capabilities: map(),
  server_info: map(),
  session: term() | nil,
  trace_context: Snodo.TraceContext.t(),
  transport: Snodo.Transport.Context.t()
}
```

---

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