Add new share entry

I’ve learned by a lot of searching how I can add an entry to menu which appears when right clicking a file, but how can I add an entry to the “Share” sub-menu? I don’t want my entry to pollute the main menu

This menu is populated with by entries provided for the share X-Purpose-PluginTypes Frameworks / Purpose framework · GitLab

You can find examples for those in src/plugins · master · Frameworks / Purpose framework · GitLab they are C++ only.

But you might not need to go this route.
dolphin service menus can be structured, with sub-menus with X-KDE-Submenu