Files
crewAI/lib
Devin AI 3148a75684 fix: ignore extra fields (security_context) in MCP tool schemas
Fixes #4796

CrewAI's tool execution framework injects a security_context parameter
into tool arguments via _add_fingerprint_metadata(). MCP tools created
via create_model_from_schema() defaulted to ConfigDict(extra='forbid'),
causing Pydantic validation to fail with 'Extra inputs are not permitted'.

This change passes ConfigDict(extra='ignore') when creating Pydantic
models for MCP tool schemas, so that extra fields like security_context
are silently dropped during validation instead of raising errors.

Changes:
- lib/crewai-tools: MCPServerAdapter's CrewAIToolAdapter now creates
  args models with extra='ignore'
- lib/crewai: Native MCP tool resolver also uses extra='ignore'
- Added regression tests for both the adapter and schema utils

Co-Authored-By: João <joao@crewai.com>
2026-03-10 10:49:51 +00:00
..