The process of cooperative problem solving can be divided into four stages. First, finding potential team members, then forming a team followed by constructing a plan for that team. Finally, the plan is executed by the team. Traditionally, very simple protocols like the Contract Net protocol are used for performing the first two stages of the process. In an open environment however, there can be discussion among the agents in order to form a team that can achieve the collective intention of solving the problem. For these cases fixed protocols like contract net do not suffice. In this paper we present an alternative solution, using structured dialogues, with an emphasis on persuasion, that can be shown to lead to the required team formation. The dialogues are described formally using modal logics and speech acts.