Added detailed comments at the top of misc/tools.func describing its purpose, key features, and usage examples. This improves clarity for maintainers and users of the helper functions.