How to start modal operator from a menu item?

I’ve written a few operators and am trying to add them to a menu so that the user can start them by selecting the menu item.

This is working for my operators that are not modal and run by having their execute() function called. However, I have two modal operators that use invoke() instead and when they are called an error message is produced. I know the modal operators work because I can start them by pressing a button in a panel. How would I be able to call them as menu items?

ERROR (wm.operator): C:\b\buildbot-worker-windows\windows_291\blender.git\source\blender\windowmanager\intern\wm_event_system.c:1309 wm_operator_invoke: invalid operator call 'KITFOX_OT_uv_plane_layout_op'
ERROR (wm.operator): C:\b\buildbot-worker-windows\windows_291\blender.git\source\blender\windowmanager\intern\wm_event_system.c:1309 wm_operator_invoke: invalid operator call 'KITFOX_OT_uv_brush_operator'
def menu_start_uvBrush(self, context):
    self.layout.operator("kitfox.uv_brush_operator")

def menu_start_planarProject(self, context):
    self.layout.operator("kitfox.uv_plane_layout_op")

def menu_start_copySymmetricUvs(self, context):
    self.layout.operator("kitfox.copy_symmetric_uvs")

def menu_start_triplanarProject(self, context):
    self.layout.operator("kitfox.triplanar_uv_unwrap")


def register():
    
    #Register menus
    bpy.types.VIEW3D_MT_uv_map.append(menu_start_uvBrush)
    bpy.types.VIEW3D_MT_uv_map.append(menu_start_planarProject)
    bpy.types.VIEW3D_MT_uv_map.append(menu_start_copySymmetricUvs)
    bpy.types.VIEW3D_MT_uv_map.append(menu_start_triplanarProject)

def unregister():

    #Unregister menus
    bpy.types.VIEW3D_MT_uv_map.remove(menu_start_uvBrush)
    bpy.types.VIEW3D_MT_uv_map.remove(menu_start_planarProject)
    bpy.types.VIEW3D_MT_uv_map.remove(menu_start_copySymmetricUvs)
    bpy.types.VIEW3D_MT_uv_map.remove(menu_start_triplanarProject)

Figured it out. I needed to set the operator_context to INVOKE_DEFAULT first.


def menu_start_uvBrush(self, context):
    self.layout.operator_context = 'INVOKE_DEFAULT'
    self.layout.operator("kitfox.uv_brush_operator")

def menu_start_planarProject(self, context):
    self.layout.operator_context = 'INVOKE_DEFAULT'
    self.layout.operator("kitfox.uv_plane_layout_op")