[autofix.ci] apply automated fixes

This commit is contained in:
autofix-ci[bot] 2025-11-19 17:18:21 +00:00 committed by GitHub
parent 03049edeea
commit 2ef2c1b113
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 5 additions and 6 deletions

View File

@ -235,9 +235,7 @@ class FunctionCallAgentRunner(BaseAgentRunner):
}
else:
inputs_to_pass = (
kwargs.get("inputs")
if tool_instance.tool_provider_type() == ToolProviderType.MCP
else None
kwargs.get("inputs") if tool_instance.tool_provider_type() == ToolProviderType.MCP else None
)
# invoke tool
tool_invoke_response, message_files, tool_invoke_meta = ToolEngine.agent_invoke(

View File

@ -168,8 +168,9 @@ class MCPTool(Tool):
sse_read_timeout=self.sse_read_timeout,
provider_entity=provider_entity,
) as mcp_client:
return mcp_client.invoke_tool(tool_name=self.entity.identity.name, tool_args=tool_parameters,
_meta=_meta)
return mcp_client.invoke_tool(
tool_name=self.entity.identity.name, tool_args=tool_parameters, _meta=_meta
)
except MCPConnectionError as e:
raise ToolInvokeError(f"Failed to connect to MCP server: {e}") from e
except Exception as e:

View File

@ -198,7 +198,7 @@ class ToolEngine:
conversation_id: str | None = None,
app_id: str | None = None,
message_id: str | None = None,
inputs: dict[str, Any] | None = None,
inputs: dict[str, Any] | None = None,
) -> Generator[ToolInvokeMessage | ToolInvokeMeta, None, None]:
"""
Invoke the tool with the given arguments.