Recently,, the distributed agent concept has become a new computing paradigm in the Internet distributed computing, including the mobile computing. Mobile agent planning is one of the most important techniques for completing a given task efficiently. The static planning technique may, not be the best approach in real network environments. This is mainly due to the fluctuation of network traffic, that is, connection failures or heavy, traffic on the network. For better performance, it is necessary that mobile agents be more sensitive to the network conditions. In this paper we propose a dynamic planning algorithm, named n-ary agent chaining, which is based on static mobile agent planning. Mobile agents can change their itinerary, dynamically according to current network status using the proposed algorithm. The proposed algorithm also takes into account the locality, of target nodes on the network. Thus, with a properly, chosen locality, factor, it can adapt to realistic network situations. Using an agent reproduction technique, the nodes, not processed by, the original agent, obtain a second chance to be visited. Agents reproduced from the original one, named cloned agents, process the unprocessed nodes in the proposed algorithm. Since the turn-around time can be calculated mathematically with known network statistics before launching the agents, the proposed algorithm is suitable for agent problem domains with deadline constraints.