# get_thread_agent

> **Function** in `deepagents_cli`

📖 [View in docs](https://reference.langchain.com/python/deepagents-cli/sessions/get_thread_agent)

Get agent_name for a thread.

## Signature

```python
get_thread_agent(
    thread_id: str,
) -> str | None
```

## Returns

`str | None`

Agent name associated with the thread, or None if not found.

---

[View source on GitHub](https://github.com/langchain-ai/deepagents/blob/88c2b5cb874dc1d093acf54d2a967ba6e085c99b/libs/cli/deepagents_cli/sessions.py#L930)