fix: load MCP and platform tools when agent tools is None

Closes #4568
This commit is contained in:
Greyson LaLonde
2026-03-03 10:25:25 -05:00
committed by GitHub
parent 5d0811258f
commit e7f17d2284

View File

@@ -1156,11 +1156,15 @@ class Agent(BaseAgent):
# Process platform apps and MCP tools
if self.apps:
platform_tools = self.get_platform_tools(self.apps)
if platform_tools and self.tools is not None:
if platform_tools:
if self.tools is None:
self.tools = []
self.tools.extend(platform_tools)
if self.mcps:
mcps = self.get_mcp_tools(self.mcps)
if mcps and self.tools is not None:
if mcps:
if self.tools is None:
self.tools = []
self.tools.extend(mcps)
# Prepare tools