> ## Documentation Index
> Fetch the complete documentation index at: https://praison.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Extract Carrier • AI Agent SDK

> extract_carrier: Return a propagation carrier extracted from inbound ``carrier``.

# extract\_carrier

Method

> This is a method of the [**GatewayTraceHook**](https://praison.ai/docs/sdk/reference/praisonaiagents/classes/GatewayTraceHook.md) class in the [**protocols**](https://praison.ai/docs/sdk/reference/praisonaiagents/modules/protocols.md) module.

Return a propagation carrier extracted from inbound `carrier`.

Reads W3C trace-context (`traceparent`/`tracestate`) from an
inbound header mapping and returns a normalized carrier suitable to pass
as `stage(..., parent_carrier=...)`, or `None` when no usable
context is present. A no-op returning `None` when no exporter is
attached.

## Signature

```python theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
def extract_carrier(carrier: 'Mapping[str, str]') -> 'Optional[Mapping[str, str]]'
```

## Parameters

**carrier** `'Mapping[str, str]'` *required*

No description available.

### Returns

**Returns** `'Optional[Mapping[str, str]]'`

The result of the operation.

## Source

> [card] [View on GitHub](https://github.com/MervinPraison/PraisonAI/blob/main/src/praisonai-agents/praisonaiagents/gateway/protocols.py#L6815)
>
> `praisonaiagents/gateway/protocols.py` at line 6815


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.