• OBSERVE
  • AUDIT
  • REPAIR
  • MANUAL

How to debug agent thread states with your AI

Connect your agent to LangGraph Cloud to look inside active threads. You can see exactly where a process stalled and fix it without starting over.

Ask AI about this page

Short answer

How can I debug my agent's thread state?

Your AI uses LangGraph Cloud tools to pull the current state of any thread or list all active threads. Once you find the error, you can push a new state to the thread to bypass the bug or correct the logic. You'll get a clear path to fixing stuck agents.

Where your debugging efforts land.

Fixing agent logic.

The AI handles the data retrieval and state injection so you can focus on the logic.

OBSERVE

Identify the bottleneck

The AI pulls the current state of a specific thread. You get a clear view of the variables and history causing the stall.

AUDIT

Find the right thread

The AI scans your active sessions. You can quickly locate the specific thread ID that needs attention.

REPAIR

Inject corrected state

The AI pushes a manual update to the thread. This lets you overwrite bad data and keep the agent moving.

MANUAL

Human intervention

The AI identifies the error, but you decide if the state change is safe. You remain the final judge of the agent's logic.

The workflow

What your AI does when <the thing arrives>.

The AI acts as a bridge between your chat interface and the LangGraph Cloud runtime.

  1. Locate the thread

    The AI finds the specific conversation or process you are worried about by looking through all existing threads.

    list_threads
  2. Inspect the data

    The AI reads the exact values, checkpoint history, and current variables stored in that thread.

    get_thread_state
  3. Analyze the error

    Your agent compares the current state against your expected logic to find where the loop or error occurred.

    get_thread_state
  4. Fix the state

    The AI writes new data into the thread to correct a mistake or skip a broken node.

    update_thread_state

Try it

Copy these to start.

Use these prompts to begin debugging immediately.

Starting points

Swap out the thread IDs and variable names for your actual LangGraph data.

LangGraph Cloud Connector

You're all set. Choose your MCP client and follow the setup instructions.

Connector linkhttps://edge.vinkius.com/vk_preview_W9eYJ3x7BufqP9zavlkhkY5HUux0v9z8z0xZYWei/mcp

Claude Desktop

Follow the steps below to connect in seconds.

  1. 1In Claude Desktop, open Settings → Connectors.
  2. 2Click “Add custom connector” and paste the connector link above as the remote MCP server URL.
  3. 3Click Add and start a new chat — LangGraph Cloud capabilities are ready to use.
Configuration · claude_desktop_config.jsonCopy
{
  "mcpServers": {
    "langgraph-cloud-stateful-ai-agents-mcp": {
      "url": "https://edge.vinkius.com/vk_preview_W9eYJ3x7BufqP9zavlkhkY5HUux0v9z8z0xZYWei/mcp"
    }
  }
}
Copy into chat04
  • List all my active LangGraph threads so I can find the one that's stuck.

  • Show me the current state of thread id 'abc-123' so I can see why the agent stopped.

  • Update the state of thread 'xyz-789' by setting the 'user_input' variable to 'retry'.

  • Check the state of thread 'debug-456' and tell me what the last successful node was.

  • Claude
  • ChatGPT
  • Cursor
  • VS Code
  • Windsurf
  • Claude Code
  • JetBrains
  • Cline

Start here

Connect LangGraph Cloud once, then ask.

Just link your account. Your credentials stay encrypted, and you can start debugging threads through your preferred AI client immediately.

Connect LangGraph Cloud to your AI

FAQ

How this task behaves.

  • 01

    Can the AI delete a thread?

    No. The AI can only list, read, or update thread states. Deleting threads must be done manually in LangGraph Cloud.

  • 02

    Will updating a state trigger a new node immediately?

    The AI updates the state, but the actual execution of the next node depends on your LangGraph configuration and how you trigger the graph.

  • 03

    Can the AI see my entire database?

    No. The AI only sees the specific thread states and metadata provided by the LangGraph Cloud tools.

  • 04

    Can the AI change the graph's code?

    No. The AI can only modify the data within a running thread, not the underlying Python logic or graph structure.

  • 05

    How do I find a specific thread ID?

    You can ask the AI to list all threads, which will return the available IDs for you to choose from.

  • More questions about LangGraph Cloud? The Connector page answers them. See everything the LangGraph Cloud Connector can do

Connect LangGraph Cloud to Claude, Cursor, ChatGPT & more