Skip to content

fix: initialize tools list when None before extending with MCP/platform tools#4645

Open
giulio-leone wants to merge 1 commit intocrewAIInc:mainfrom
giulio-leone:fix/mcp-tools-none-initialization
Open

fix: initialize tools list when None before extending with MCP/platform tools#4645
giulio-leone wants to merge 1 commit intocrewAIInc:mainfrom
giulio-leone:fix/mcp-tools-none-initialization

Conversation

@giulio-leone
Copy link

@giulio-leone giulio-leone commented Feb 28, 2026

Problem

When an Agent is created with mcps but without explicit tools, self.tools is None. The condition at line 1163:

if mcps and self.tools is not None:
    self.tools.extend(mcps)

silently skips MCP tool loading because self.tools is not None evaluates to False. The agent runs with no tools.

The same issue exists for platform_tools at line 1159.

Fix

Initialize self.tools to [] before calling .extend() when it is None.

Fixes #4568


Note

Low Risk
Low risk bug fix that only changes how Agent._prepare_kickoff appends platform/MCP tools when self.tools is unset; minimal behavioral impact beyond correctly enabling tool loading.

Overview
Fixes standalone Agent kickoff tool initialization so platform app tools and MCP tools are still added when self.tools starts as None.

_prepare_kickoff now initializes self.tools to an empty list before calling .extend() for platform/MCP tool lists, preventing those integrations from being silently skipped.

Written by Cursor Bugbot for commit f8174e6. This will update automatically on new commits. Configure here.

…rm tools

When an Agent is created with mcps but without explicit tools, self.tools
is None. The condition 'mcps and self.tools is not None' silently skips
MCP tool loading, so the agent runs with no tools at all.

Initialize self.tools to [] before extending when it is None. Applied
to both platform_tools and MCP tools branches.

Fixes crewAIInc#4568
@giulio-leone giulio-leone force-pushed the fix/mcp-tools-none-initialization branch from 143ee17 to f8174e6 Compare February 28, 2026 14:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG]When I use mcps but tools is None, it will not load mcp tools

1 participant