From 830c262e6b3cf6e54ad1d2ea9339f4a7ce881079 Mon Sep 17 00:00:00 2001 From: Zsanz3 <268133725+Zsanz3@users.noreply.github.com> Date: Wed, 2 Sep 2026 01:54:15 +0000 Subject: [PATCH] fix(mcp_tool): prevent confirmation-loop on require_confirmation pause McpTool's confirmation gate requested confirmation and returned the pause error but never set skip_summarization, so the LLM flow re-invoked the model and retried the tool. Match FunctionTool and set the flag before returning the pause error. Fixes #6977 Co-authored-by: Zsanz3 --- src/google/adk/tools/mcp_tool/mcp_tool.py | 1 + tests/unittests/tools/mcp_tool/test_mcp_tool.py | 1 + 2 files changed, 2 insertions(+) diff --git a/src/google/adk/tools/mcp_tool/mcp_tool.py b/src/google/adk/tools/mcp_tool/mcp_tool.py index 49ee80af039..7892f45cb40 100644 --- a/src/google/adk/tools/mcp_tool/mcp_tool.py +++ b/src/google/adk/tools/mcp_tool/mcp_tool.py @@ -430,6 +430,7 @@ async def run_async( " ToolConfirmation payload." ), ) + tool_context.actions.skip_summarization = True return { "error": ( "This tool call requires confirmation, please approve or" diff --git a/tests/unittests/tools/mcp_tool/test_mcp_tool.py b/tests/unittests/tools/mcp_tool/test_mcp_tool.py index 4e8564dce17..0b39bbe5abd 100644 --- a/tests/unittests/tools/mcp_tool/test_mcp_tool.py +++ b/tests/unittests/tools/mcp_tool/test_mcp_tool.py @@ -1056,6 +1056,7 @@ async def test_run_async_require_confirmation_true_no_confirmation(self): ) } tool_context.request_confirmation.assert_called_once() + assert tool_context.actions.skip_summarization is True @pytest.mark.asyncio async def test_run_async_require_confirmation_true_rejected(self):