# get_current_thread_id

> **Function** in `deepagents_code`

📖 [View in docs](https://reference.langchain.com/python/deepagents-code/tools/get_current_thread_id)

Get the current Deep Agents thread ID for LangSmith or MCP tooling.

## Signature

```python
get_current_thread_id(
    config: RunnableConfig,
) -> str
```

## Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `config` | `RunnableConfig` | Yes | Runtime config injected by LangChain. |

## Returns

`str`

The current `configurable.thread_id`, or an explanatory message if missing.

---

[View source on GitHub](https://github.com/langchain-ai/deepagents/blob/e14e0adcbe78565ed3650e7f24b2a775d5437d25/libs/code/deepagents_code/tools.py#L305)