"Is the role of an MP or senator defined or set out in any legislation?"

Thanks for your question. There is no legislation—law—that defines the role of a senator or member of the House of Representative. Their work is largely dependent on how they choose to serve their the people in their community. They do this by:

The Australian Constitution contains the rules about how members of parliament are elected and the terms of their service but does not cover their role.

diagram to help explain Is the role of an MP or senator defined or set out in any legislation?