We propose a new algorithm for detecting functional structure in neuronal networks based solely upon the information derived from the spike timings of the neurons. Unlike traditional algorithms that depend on knowledge of the topological structure of the network to parse the network into communities, we dynamically cluster the neurons to build communities with similar functional interactions. We define means to derive optimal clustering parameters and investigate what conditions have to be fulfilled to obtain reasonable predictions of functional structures. The success of the algorithm is verified using simulated spike train data, and we provide examples of the application of our method to experimental data where it detects known changes in neural states.