You can use your package manager's removal option. For instance, for an RPM-based distro, use
rpm -e to erase the package. You can find the package names from the agent installation instructions at Administration... Agents in your group. For the Automation Agent in RPM-based distros, the package name is
mongodb-mms-automation-agent-manager, so the total command would be rpm -e mongodb-mms-automation-agent-manager. This is just an example and could be different for your distro.
-Peter