Update api/core/tools/mcp_tool/tool.py

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
This commit is contained in:
Zino 2025-11-18 10:48:33 +08:00 committed by GitHub
parent a87c7b0064
commit 71cd681c91
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 4 additions and 3 deletions

View File

@ -51,9 +51,10 @@ class MCPTool(Tool):
) -> Generator[ToolInvokeMessage, None, None]:
# If inputs is provided, flatten its key/value pairs into the tool_parameters.
# This is a conservative merge: only add a key from inputs if it does not already exist in tool_parameters.
for key, value in inputs.items():
if key not in tool_parameters:
tool_parameters[key] = value
if inputs:
for key, value in inputs.items():
if key not in tool_parameters:
tool_parameters[key] = value
result = self.invoke_remote_mcp_tool(tool_parameters)
# handle dify tool output
for content in result.content: