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

# Get Middleware • AI Agent SDK

> get_middleware: Get middleware for a runtime.

# get\_middleware

<div className="flex items-center gap-2">
  <Badge color="purple">Method</Badge>
</div>

> This is a method of the [**MiddlewareRegistry**](../classes/MiddlewareRegistry) class in the [**middleware\_registry**](../modules/middleware_registry) module.

Get middleware for a runtime.

## Signature

```python theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
def get_middleware(runtime_id: str) -> RuntimeToolResultMiddleware
```

## Parameters

<ParamField query="runtime_id" type="str" required={true}>
  Runtime identifier to look up
</ParamField>

### Returns

<ResponseField name="Returns" type="RuntimeToolResultMiddleware">
  Registered middleware or default pass-through middleware
</ResponseField>

## Used By

* [`get_middleware`](../functions/get_middleware)

## Source

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

***

## Related Documentation

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