Permissions needed for dbms_metadata.get_ddl in a function
Based on Raj's comment, the following works:

create or replace function utilities.getddl (p_type varchar2, p_object varchar2, p_owner varchar2)
authid current_user
return varchar2 as
begin
  return dbms_metadata.get_ddl(p_type, p_object, p_owner);
end getddl;

select getddl('TABLE', 'MYTABLE', 'UTILITIES') from dual;
&lt;DDL&gt;