From 28a1ac20d362a1948e9e2003df52511ccdf1dcc8 Mon Sep 17 00:00:00 2001 From: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Date: Tue, 22 Sep 2026 08:25:56 +0000 Subject: [PATCH] fix(mcp): keep the string guard on tools/list next_cursor Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> --- litellm/experimental_mcp_client/tools.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/litellm/experimental_mcp_client/tools.py b/litellm/experimental_mcp_client/tools.py index 8e640f8b837..df644fd7f4a 100644 --- a/litellm/experimental_mcp_client/tools.py +++ b/litellm/experimental_mcp_client/tools.py @@ -130,7 +130,7 @@ async def list_tools_with_pagination( tools.extend(result.tools) next_cursor = result.next_cursor - if not next_cursor: + if not isinstance(next_cursor, str) or not next_cursor: return tools if next_cursor in seen_cursors: verbose_logger.warning(