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

# Display

> Display API Documentation

**Source Code**

View the source code for this module on GitHub: [[https://github.com/mcp-use/mcp-use/blob/main/libraries/python/mcp\_use/agents/display.py](https://github.com/mcp-use/mcp-use/blob/main/libraries/python/mcp_use/agents/display.py)](https://github.com/mcp-use/mcp-use/blob/main/libraries/python/mcp_use/agents/display.py)

## log\_agent\_step

> [card]
>
> ### `function` log\_agent\_step
>
> Display or log an agent step based on pretty\_print flag.
>
> ```python theme={null}
> from mcp_use.agents.display import log_agent_step
> ```
>
> **Parameters**
>
> > **item** *required*
> >
> > Parameter value
> >
> > **pretty\_print** (default: True)
> >
> > Parameter value
>
> **Signature**
>
> ```python wrap theme={null}
> def log_agent_step(item, pretty_print = True):
> ```

## log\_agent\_stream

> [card]
>
> ### `function` log\_agent\_stream
>
> Handle streaming events from astream\_events.
>
> ```python theme={null}
> from mcp_use.agents.display import log_agent_stream
> ```
>
> **Parameters**
>
> > **chunk** *required*
> >
> > Event dictionary from LangChain's astream\_events
> >
> > **pretty\_print** (default: True)
> >
> > If True, use rich formatting. If False, do nothing.
>
> **Signature**
>
> ```python wrap theme={null}
> def log_agent_stream(chunk, pretty_print = True):
> ```


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