# `ExMCP.Protocol.TraceContext`
[🔗](https://github.com/azmaveth/ex_mcp/blob/v1.4.0/lib/ex_mcp/protocol/trace_context.ex#L1)

Validates and bounds W3C trace-context fields carried in MCP `_meta`.

`traceparent` and `tracestate` follow the W3C Trace Context wire grammar.
Baggage is bounded before filtering and only explicitly allowlisted baggage
keys are propagated. This module handles wire values only; it does not attach
them to process-global OpenTelemetry state.

# `error_key`

```elixir
@type error_key() :: String.t()
```

# `keys`

```elixir
@spec keys() :: [String.t()]
```

Returns the trace-context keys used in MCP metadata.

# `normalize`

```elixir
@spec normalize(map()) :: {:ok, map()} | {:error, error_key()}
```

Validates, bounds, and filters a trace-context map.

---

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