Whenever a new device joins the MQTT pool, have its first publish contain a list of its registered functions (and maybe their type--switch, text, slider) that the server can cache and offer to web clients trying to discover functionalities of various devices on the network.