We present a multi-dimensional, multistep negotiation mechanism for task allocation among cooperative agents based on distributed search. This mechanism uses marginal utility gain and marginal utility cost to structure this search process, so as to find a solution that maximizes their combined utility. These two utility values together with temporal constraints summarize the agents’ local information and reduce the communication load. This mechanism is anytime in character: by investing more time, the agents increase the likelihood of getting a better solution. A set of protocols are constructed and the experimental result shows a phase transition phenomenon as the complexity of negotiation situation changes. A measure of negotiation complexity is developed that can be used by an agent to choose the appropriate protocol, allowing the agents to explicitly balance the gain from the negotiation and the resource usage of the negotiation.