From 2a94dc3eae0c4d39baa7b9b1beb8c266480e80d8 Mon Sep 17 00:00:00 2001 From: CaptainB Date: Wed, 26 Mar 2025 19:12:18 +0800 Subject: [PATCH] fix: ensure tool parameters are properly handled by reloading JSON MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --bug=1053980 --user=刘瑞斌 【应用】MCP节点的工具参数引用参数时,对话过程中参数值发生变化,MCP节点没有获取最新的参数值 https://www.tapd.cn/57709429/s/1676830 --- apps/application/flow/step_node/mcp_node/impl/base_mcp_node.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/apps/application/flow/step_node/mcp_node/impl/base_mcp_node.py b/apps/application/flow/step_node/mcp_node/impl/base_mcp_node.py index 6042e269d8c..6c9fe97fc69 100644 --- a/apps/application/flow/step_node/mcp_node/impl/base_mcp_node.py +++ b/apps/application/flow/step_node/mcp_node/impl/base_mcp_node.py @@ -18,7 +18,8 @@ def save_context(self, details, workflow_manage): def execute(self, mcp_servers, mcp_server, mcp_tool, tool_params, **kwargs) -> NodeResult: servers = json.loads(mcp_servers) - params = self.handle_variables(tool_params) + params = json.loads(json.dumps(tool_params)) + params = self.handle_variables(params) async def call_tool(s, session, t, a): async with MultiServerMCPClient(s) as client: