For native functions (see limitations), you’ll want to use live_function_add with your own function for implementation, so
live_function_add("directory_contents(dname)", function(dname) {
return directory_contents(dname);
});
GMLiveAPI shouldn’t be touched by hand and is like that to minimize impact on compile times.