That would have to be something like: {def $objects = fetch( 'my_something', 'ez')}
take a look in kernel/content/function_definition.php, basically you'll have to have a similar file in your own module extension (my_extension/modules/my_module/function_definition.php).
But you can of course return a object from a template operator as well.