> ## 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.

# Trace Context • Rust AI Agent SDK

> trace_context: Get or create trace context

# trace\_context

<div className="flex items-center gap-2">
  <Badge color="teal">Function</Badge>
</div>

> This function is defined in the [**extras**](../modules/extras) module.

Get or create trace context

## Signature

```python theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
def trace_context() -> TraceContextData
```

### Returns

<ResponseField name="Returns" type="TraceContextData">
  The result of the operation.
</ResponseField>

## Source

<Card title="View on GitHub" icon="github" href="https://github.com/MervinPraison/PraisonAI/blob/main/src/praisonai-rust/praisonai/src/parity/extras.rs#L685">
  `praisonai/src/parity/extras.rs` at line 685
</Card>

***

## Related Documentation

<CardGroup cols={2}>
  <Card title="Rust Context Management" icon="layer-group" href="/docs/rust/context-management" />

  <Card title="Rust Token Management" icon="coins" href="/docs/rust/token-management" />

  <Card title="Rust Tracing" icon="chart-line" href="/docs/rust/tracing" />

  <Card title="Rust Telemetry" icon="signal" href="/docs/rust/telemetry" />
</CardGroup>
