diff --git a/lib/crewai/src/crewai/utilities/tool_utils.py b/lib/crewai/src/crewai/utilities/tool_utils.py index 42bdf52cd..b77eb9192 100644 --- a/lib/crewai/src/crewai/utilities/tool_utils.py +++ b/lib/crewai/src/crewai/utilities/tool_utils.py @@ -216,7 +216,7 @@ def execute_tool_and_check_finality( if tool: tool_input = tool_calling.arguments if tool_calling.arguments else {} hook_context = ToolCallHookContext( - tool_name=tool_calling.tool_name, + tool_name=sanitized_tool_name, tool_input=tool_input, tool=tool, agent=agent, @@ -240,7 +240,7 @@ def execute_tool_and_check_finality( tool_result = tool_usage.use(tool_calling, agent_action.text) after_hook_context = ToolCallHookContext( - tool_name=tool_calling.tool_name, + tool_name=sanitized_tool_name, tool_input=tool_input, tool=tool, agent=agent,