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

# Middleware Context • AI Agent SDK

> MiddlewareContext: Context passed to middleware during tool result normalization.

# MiddlewareContext

> Defined in the [**middleware**](../modules/middleware) module.

<Badge color="blue">AI Agent</Badge>

Context passed to middleware during tool result normalization.

Contains metadata about the tool execution and runtime environment
to help middleware make informed normalization decisions.

## Properties

<ResponseField name="tool_name" type="str">
  No description available.
</ResponseField>

<ResponseField name="runtime_id" type="str">
  No description available.
</ResponseField>

<ResponseField name="agent_id" type="Optional[str]">
  No description available.
</ResponseField>

<ResponseField name="session_id" type="Optional[str]">
  No description available.
</ResponseField>

<ResponseField name="execution_time_ms" type="float">
  No description available.
</ResponseField>

<ResponseField name="timestamp" type="float">
  No description available.
</ResponseField>

<ResponseField name="metadata" type="Dict[str, Any]">
  No description available.
</ResponseField>

## Source

<Card title="View on GitHub" icon="github" href="https://github.com/MervinPraison/PraisonAI/blob/main/src/praisonai-agents/praisonaiagents/runtime/middleware.py#L21">
  `praisonaiagents/runtime/middleware.py` at line 21
</Card>

***

## Related Documentation

<CardGroup cols={2}>
  <Card title="Context Concept" icon="layer-group" href="/docs/docs/concepts/context" />

  <Card title="Context Management" icon="sliders" href="/docs/docs/features/context-management" />

  <Card title="Context Strategies" icon="diagram-project" href="/docs/docs/features/context-strategies" />

  <Card title="Middleware Feature" icon="layer-group" href="/docs/docs/features/middleware" />
</CardGroup>
