The JSDoc is wrong. It needs to return a handle to a function for the REST API method that it's passed into.