Api throws context error when adding UI tool to sculpt or particle mode
I had the same issue and figured out that there are a few issues in the python code. The problem is that context is not being passed into the methods for sculpt, but it is for all the rest. If you are up to it, you can edit the python scripts to fix this. There are 4 locations in space_toolsystem_common.py, 1 in keymap_from_toolbar.py, and 1 in _ _init__.py.

space_toolsystem_common.py:

Line 219 @staticmethod
Line 220     def _tools_flatten(**context**, tools):
.........
Line 241 @staticmethod
Line 242     def _tools_flatten_with_tool_index(**context**, tools):
.........
Line 274     for item in ToolSelectPanelHelper._tools_flatten(**context**, cls.tools_from_context(context, mode)):
.........
Line 291     for item, index in ToolSelectPanelHelper._tools_flatten_with_tool_index(**context**, cls.tools_from_context(context)):


keymap_from_toolbar.py:

Line 59     for item in ToolSelectPanelHelper._tools_flatten(**context**, cls.tools_from_context(context))


scripts/modules/bpy/utils/_ _init__.py

Line 769    item.idname for item in ToolSelectPanelHelper._tools_flatten(**_bpy.context**, tools)


That should fix it.